The Dink Network

Reply to Re: dmod in Femdom

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
August 15th, 11:01 AM
spike.gif
SlipDink
Peasant Male United States bloop
2nd generation. No easy way to be free. 
To get started writing in DinkC you can read this 3.1 version of the DinkC reference, at https://www.dinknetwork.com/file/dinkc_reference/ or this (4.0 I think) version of the DinkC reference in Windows Help File format at https://www.dinknetwork.com/file/dinkc_reference_windows_help_file/ . You can also learn a lot by studying the DinkC code of other dmods.

Another way for you to start would be to use this excellent multi-part video tutorial at http://www.dinknetwork.com/forum.cgi?MID=115633&Posts=34 .

Meanwhile, I have taken the below sample psuedo-code and made it a bit more DinkC compliant. Let's say that all the following is in a file named "spittle.c" .

void main(void)
{
	// To my knowledge, there is no DinkC spit() function, though
	// perhaps this was meant to refer to an internal spit()
	// function within this module, which I will call spittle.c .
	// Also, I don't think you can count on code being executed
	// in the main() procedure unless it is between the curly
	// braces, not just in front of the first curly brace after
	// the [void main(void)] declaration.
	// 
	// I have removed the [spit();] code above.

	// Presumably this integer was declared in main.c as a global
	// variable, like: [make_global_int("&spit_hit_face", 0);]
	// and later set to 1 somewhere in another DinkC script when
	// it is time to show the spittle is in it's proper place.
	if (&spit_hit_face == 1)
	{
		// To my knowledge, there is no DinkC display() function.
		// To put an image on screen requires a process much like
		// the following:
		// a) You find and/or create the image, perhaps in this
		//    case of just some spittle.
		// b) You convert the image type to .bmp, which works
		//    with more versions of the dink engine than .png
		//    files including the most popular and stable
		//    freedink 1.08+ versions.
		// c) You create entries for this image in dink.ini for
		//    your dmod, assigning it a sequence and frame number.
		//    In this case, we will pretend that this sequence and
		//    frame are 518 and 1 respectively. 
		// d) Decide where on screen you want the image to appear.
		//    In this case, it would be based on Dink's location
		//    on the screen. Dink, is always runtime sprite #1.
		//    In this case we assume that the spit should be
		//    offset from Dink's location so that it ends up
		//    on his face instead of at his feet.

		// display ("spit.png")
		int &dinkx = 0;
		int &dinky = 0;
		int &spit = 0;
		&dinkx = sp_x(1, -1);
		&dinky = sp_y(1, -1);
		&dinky -= 80;
		&spit = create_sprite(&dinkx, &dinky, 11, 518, 1);
	}
	else
	{
		// The say() function requires that you state which sprite
		// on screen says the words. In this case, we will have
		// sprite #1 (Dink) say it. There are other variants on
		// the say() function such as say_xy(), say_stop() and 
		// say_stop_xy() that behave a little differently and take
		// other parameters.
		say("You have failed spitting on the face, try again?", 1);
	}
}