The Dink Network

conversations with over 2 people

August 20th 2004, 12:55 PM
pig.gif
how do you have a conversation in dink with 3 or more people? ive tryed looking at sources for conversations, and it came up as;

say_stop("im a badger (or whatever)", &badger);

i was led to belive for a while that you just needed to name the script "badger", then it would work, but after a while of trail and error, i still couldent get it to work... I then fuigerd out "badger" was a variable that had been set in MAIN.c. im compleatly beffafled for how to get it to work, would someone help me please?
August 20th 2004, 01:35 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
There are a few different ways to accomplish this, but you're almost to the point of understanding the easiest way.

Right, &badger is a global variable that is used to refer to the 'Badger' chracter. All you need to do is give Badger a script, with something simple like this in it:

//badger.c
void main(void)
{
&badger = &current_sprite;
}

And it should work fine. As an alternative, you could use create_script to place the characters on the screen and not worry about different scripts and globals and such. Something like this should work (for a cutscene-esque thing anyway):

void main(void)
{
int &guy1 = create_sprite(300, 200, 9, 371 1);
int &guy2 = create_sprite(400, 150, 9, 363, 1);
int &guy3 = create_sprite(200, 400, 9, 357, 1);
freeze(1);
say_stop("`1Hello!", &guy1);
say_stop("`2Hello!", &guy2);
say_stop("`3Hello!", &guy3);
//And for people talking at the same time,
//give the last one a say_stop
say("`1I am talking at the same time as you!", &guy1);
say_stop("`2Indeed you are!", &guy2);
unfreeze(1);
}
August 20th 2004, 01:35 PM
goblinm.gif
Ok, this is actually fairly simple. There are two numbers associated with a sprite placed in the editor (as opposed to one placed with create_sprite). The first number is the sprite number. This is the number used in all practical applications. The second is the editor number, which you can see in DinkEdit by pressing i. So, lets say that the badger has editor number 12. Then to have a random script make the badger talk you would do:
int &badger;
&badger = sp(12); //sp takes the editor number, 12, and spits out the sprite number, probably 13
say_stop("I'm a cowgirl!", &badger);

Edit: You *could* do it the Redink way, but that would be too easy.
August 20th 2004, 03:39 PM
pig.gif
thanks very much everyone.