The Dink Network

2 NPC conversation

May 4th 2007, 03:35 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Well i have question.How to make one guard talk to second guard while Dink asked one of them about the second one?
May 4th 2007, 04:48 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
I may have the wrong idea, but anyway, you could make one guard say something then the other guard say something that seems like he's talking to that other guard. Make them kinda facing eachother too if you can.
May 4th 2007, 05:08 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
I need a script.When i do this the one guard will say what the second will say!
May 4th 2007, 05:18 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Ahh! I know what you mean. Go to your Main.C where it says Add you own globals here blah blah Put something like

make_global_int("&guard1", 0);
make_global_int("&guard2", 0);

Then in your script for the first guard in a void main(void) put something like &guard = &current_sprite;

Then in other script do same thing put with &guard2. Then in any script put say_stop("blah", &guard2); Then guard2 should say it. Then change &guard2 to &guard1 and guard1 will say it. Does this help?
May 4th 2007, 05:29 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Thanx.It helped!
May 4th 2007, 08:38 AM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
This method costs you two globals, if you want to save two use this script and attach it to the guard you're speaking (guard1) to: (and remove the other guard(guard2) from the map)

void main(void)
{
int &guard2 = create_sprite(x,y,brain,seq,frame);
sp_script(&guard2,"guard2");
}
void talk(void)
{
say("BlaBla",1);
say("`7I agree",&current_sprite);
say("`8So do I",&guard2);
}

Put the talk and hit information for the second guard in the guard2.c script.

I used this trick numerous times in the scourger, in my current work I choose to use two globals but continuously re-use them which is a good choice too...
May 4th 2007, 04:42 PM
spike.gif
A quick way is to use sp(); to get the other sprite (check sprite number in editor, do int &guard = sp(x); in script) though Windinkedit can sometimes spontaneously change these numbers, screwing your scripts up. Never had any problems with Dinkedit myself.
May 8th 2007, 12:38 AM
wizardb.gif
Endy
Peasant He/Him United States
 
I've been using get_sprite_with_this_brain() for one sprite to find another's number. Works pretty well if there's only a couple of sprites, anymore and you'll have to use different brain types.
May 8th 2007, 01:18 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
:This method costs you two globals:

So what! You've got 200! Only someone that makes HUGE Dmods would have to worry about that. IE: SimonK. (Even though he's over Dink Smallwood)
May 8th 2007, 09:55 AM
wizardg.gif
slayer4990
Peasant He/Him Canada
Foppery and Whim! 
Still... I can't say it's a -great- idea to use up your globals when you could do the exact same thing with a local variable.
May 8th 2007, 04:43 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
It may not be a good idea to just go handing out globals everywhere, but you may find it necessary to have a couple global variables for things. Keep in mind you could still use the variables for other purposes.

Let's say you did use a variable for one of the two knights. It would only be for that screen, so you could have it set when you enter that screen and go along to use the variable for another character on another screen. It's better what metatarasal said to do though, I was just providing an example. It's good practice to be conservative.
May 9th 2007, 02:53 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
void main(void)
{
int &guard2 = create_sprite(x,y,brain,seq,frame);
sp_script(&guard2,"guard2");
}
void talk(void)
{
say("BlaBla",1);
say("`7I agree",&current_sprite);
say("`8So do I",&guard2);
}


That is good. It does save two globals. But when you got the talking bit you said...

say("BlaBla",1);
say("`7I agree",&current_sprite);
say("`8So do I",&guard2);


That would actually make them all say it at the same time. So you might want to change it to...

say_stop("BlaBla",1);
say_stop("`7I agree",&current_sprite);
say_stop("`8So do I",&guard2);
May 9th 2007, 03:15 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Well, you get the point. The say(); commands where only added to illustrate it really, I mean it should be obvious to replace them with whatever you want. I for one like to add a wait(); command between say_stop(); commands so for me it would look like:

say_stop("BlaBla",1);
wait(200);
say_stop("`7I agree",&current_sprite);
wait(200);
say_stop("`8So do I",&guard2);

It should be obvious....
May 11th 2007, 02:41 AM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
I don't usually wait unless they're thinking or something like that.