The Dink Network

Why this doesnt work?

March 29th 2009, 01:05 PM
goblinh.gif
mkbul
Peasant He/Him Greece
TPA~ 
Well, i have a code in one dmod.

void main(void)

{
int &queen = create_sprite(311, 193, 0, 521, 7);
int &guard = create_sprite(206, 204, 0, 283, 2);

freeze(1);

move_stop(1, 8, 230, 0);
say_stop("Greetings my Queen!", 1);
wait(200);
say_stop("`3Hello traveller, whats the problem?", &queen);
wait(200);
say_stop("I respectfully ask you what place is this.", 1);
wait(200);
say_stop("`3There is no need to be respectful for me.", &queen);
wait(200);
say_stop("`3This is the city...umm village of Vasti.", &queen);
wait(200);
say_stop("`8<Whispers to other guard> City...hehehe...", &guard);
wait(200);
say_stop("I need your advice, im looking for a place called Karja.", 1);
wait(200);
say_stop("`3Umm...ive heart of it, but not sure where it is.", &queen);
wait(200);
say_stop("`3There is a person on the...west i think that can help you.", &queen);
wait(200);
say_stop("Okay, thanks for your advice!", 1);
wait(200);
say_stop("`8Ok, queen is closed for today! CLOSE THE GATE!", &guard);
move_stop(1, 2, 600, 0);

unfreeze(1);
}

It works just fine, but exept that &guard doesnt show up on the game! Why?
March 29th 2009, 01:29 PM
spike.gif
Do the guard's lines still appear somewhere on the screen? If so, try adding

preload_seq(283);

after you create the sprite.
March 29th 2009, 01:34 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
Script works for me. And &guard does show up. &queen doesn't show up for me, but that is because sequence 521 doesn't exist in skeleton B. Most likely that is your problem, that you try to create a sprite with a sequence/frame that doesn't exist...

March 29th 2009, 01:58 PM
goblinh.gif
mkbul
Peasant He/Him Greece
TPA~ 
Actually text doesnt appear too! And Guard's seq exists

EDIT: preload worked thanks!
April 1st 2009, 06:31 AM
fairy.gif
GlennGlenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
Question from me; Why do you have to preload a sequence?
April 8th 2009, 01:49 PM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
This is based on my limited understanding and computer vocabulary:

Sometimes, when drawing sprites created in DinkC on the screen, the game will try to draw it before it has been loaded into the memory buffer. This can cause errors such as the sprite not showing up, or having an incorrect hardbox. Preloading the sequence ensures that the sprite sequence is fully loaded into the memory.

Back when Dink was first released, this was used to make sure the game loaded in a timely manner and that sprites were only loaded as needed, as loading all the sequences at once could have taken several minutes on the average computer back then.