The Dink Network

murderous pigs planning a piggy reveloutoin.

September 10th 2004, 01:53 PM
pig.gif
i have a subquest in my dmod about killer pigs ect, (you know, the usual) and in one of the cutscenes 2 of the pigs dont freeze when i want them to. here are all scripts involved.

//cutscene script

void main(void)
{
freeze(1);
freeze(¤t_sprite);
freeze(&deathpig1);
freeze(&deathpig2);
freeze(&deathpig3);
freeze(&deathpig4);
say_stop("`5enough nonesense, eat the girl before she blabs about le resitanse de piggy to the king!", &deathpig1);
say_stop("`2uhh chief,", &deathpig1);
say_stop("`5what now cletus?", &deathpig1);
say_stop("`2there be an intruder!", &deathpig3);
sp_dir(1,4);
say("dum de doo...", 1);
wait(1200);
say_stop("`5GET THAT ASSMOLE BEFORE HE TALKS", &deathpig1);
say("well, i'll be going...", 1);
say_stop("`5not so fast pig ass", &deathpig1);
say_stop("did you call me a pig ass", 1);
say_stop("then it's time to die!", 1);
playmidi("106.mid");
unfreeze(1);
unfreeze(&deathpig1);
unfreeze(&deathpig2);
unfreeze(&deathpig3);
unfreeze(&deathpig4);
sp_target(&deathpig1, 1);
sp_target(&deathpig2, 1);
sp_target(&deathpig3, 1);
sp_target(&deathpig4, 1);
}

//first pig that doesent freeze

void main(void)
{
&deathpig3 = (¤t_sprite);
}

//second pig that doesent freeze

void main(void)
{
&deathpig4 = (¤t_sprite);
}

//extract from main.c

make_global_int("&deathpig3", 0);
make_global_int("&deathpig4", 0);

ive been trying to fix this for 2 days now, but i just cant see the problem. thanks.

September 10th 2004, 02:07 PM
spike.gif
Hmm. Weird. Try renaming those two globals.
September 10th 2004, 02:17 PM
pig.gif
nope, no luck. i'll try that again in the morning though, because i didnt do it properly as my dads presurizing me to get on the computer.
September 10th 2004, 02:26 PM
spike.gif
There might be some silly explanation to your problem, like that you've attached the wrong scripts to the pigs in the editor. Check out!
September 10th 2004, 05:28 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
Try putting a wait(100); at the begining of the cutscene scripts' main() just to make sure the globals in the sprite script has time to get assigned before those sprites are controlled.
Also if there is a local variable anywhere that starts with d ( &dxxx..) that is changing at that time it may confuse the Dink engine and change the wrong var.
September 10th 2004, 05:32 PM
anon.gif
MiloBones
Ghost They/Them
 
get_sprite_with_this_brain, combined with using nonexisting brains, is awesome in this sort of situation. You don't have to burn any globals.

But this isn't relevant, so I'll shut up.
September 10th 2004, 05:54 PM
goblinm.gif
An example from the waller:

//wallbr.c
//marks bottom right corner
void main( void )
{
sp_brain(&current_sprite, 90);
wait(2);
sp_brain(&current_sprite, 0);
}

//walltl.c
//marks top left corner and makes walls
void main( void )
{
...
wait(1);
//get sprite number of marker for bottom right corner
int &wallbr = get_sprite_with_this_brain(90, 1);
...
September 11th 2004, 01:53 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
"Also if there is a local variable anywhere that starts with d ( &dxxx..) that is changing at that time it may confuse the Dink engine and change the wrong var."

You mean the dxxx will be mistaken for a deathpigx? I don't think so. This way there would only be a possibility for 26 vars, and that's not really much.

It will go wrong if you have a &d and a &deathpig at the same time, or, more generally, an &xxx and an &xxxyyy. (don't start about &magic and &magic_cost and &magic_level, I dunno that, probably an engine thing).

If you didn't mean that... I dunno anything
September 11th 2004, 05:07 AM
pq_frog.gif
Ric
Peasant They/Them Canada
 
Dink keeps global variables straight but locals can confuse it. Read 'Dink C reference 3.1' for details. That's probably not the problem though.
September 11th 2004, 05:39 AM
pig.gif
i fixed the problem, by making it wait before the cutscene. thanks everyone. theres another problem though, that just happend, the girl who the pigs are trying to eat turns into a pig. i'm not that botherd, because i havent had a proper look at the problem, but anyway. thanks.
September 11th 2004, 07:14 AM
pig.gif
Do'h. clasical mistake, i put the wrong walk sequence in. that happens to me a lot, does it say what they are anywere?

alls well, and thanks to all.
September 11th 2004, 08:12 AM
goblinm.gif
September 11th 2004, 10:24 AM
pig.gif
Thanks, had i known about that earlyer it would have saved me a lot of trouble.
September 13th 2004, 02:18 AM
sob_scorpy.gif
I think the wait(100) or something like that could be changed to give more time for the globals or something to be assigned properly, like wait(300).
September 13th 2004, 02:23 AM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
I don't think that would make a difference. Wait(100) is easily long enough in my experience.

I could be wrong though.
September 14th 2004, 12:33 AM
sob_scorpy.gif
Uh, to me, it's too fast a number to properly assign the vars of my global stuff... That is, in MY DMOD. I'm not sure about other DMODs.
September 14th 2004, 03:05 AM
custom_fish.png
SabreTrout
Noble He/Him United Kingdom
Tigertigertiger. 
Well, I never have to check globals so quickly after changing them in my d-mod, so I don't really know.