The Dink Network

Loop to delay

April 15th 2007, 03:26 AM
duckdie.gif
RadFrog
Peasant They/Them
 
I want to freeze Dink until the countdown of &gold is complete. This is my best (un-effective) effort so far. Too bad it don't work. Dink just can't wait.
- - -
&temp = &gold;
&temp -= 1000;
&gold -= 1000;
loop:
wait(100);
if(&gold > &temp)
{
goto loop;
}
// put axe in Dink's tools
playsound(10,22050,0,0,0);
add_item("item-axe", 438, 6);
sp_brain(&current_sprite, 12);
sp_touch_damage(&current_sprite, 0);
sp_timing(&current_sprite, 0);

unfreeze(1);

If anyone has scripted such a thing, I would really like to know how they did it.

Thanks in advance.

RadFrog
April 15th 2007, 03:32 AM
duckdie.gif
Hasai
Peasant He/Him Finland
I want to have your abortion 
I'm not exactly sure if I understand what you want to do...

However, I didn't see a freeze(1); command in there - also, I'm not quite sure what the point of the loop is - why not just use a wait(5000); (or however long it takes)? If you are waiting for the gold to countdown on the display, then just timing it might be the best way.
April 15th 2007, 03:39 AM
milder.gif
Harshit
Peasant He/Him India
Milderr!! 4: Return of the Legend 
Every player will have a diff. gold amount.
Maybe only a freeze command is missing.
April 15th 2007, 03:53 AM
duckdie.gif
RadFrog
Peasant They/Them
 
I will try the wait(5000) Thanks.

I didn't post the entire procedure, which includes the Freeze(1);

Maybe my convention of three dashes to show the example is only an excerpt is antiquated?

Sorry for the confusion, but thanks for the solution.

RadFrog
April 15th 2007, 06:25 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
The gold countdown is only a graphical thing. At the moment you decrease &gold, the variable is immediately decreased. Say, we start the script with 2500 gold:

//&gold = 2500

&temp = &gold;
//&temp = &gold = 2500
&temp -= 1000;
//&temp = 1500 now
&gold -= 1000;
//&gold = 1500 now
loop:
wait(100);
if(&gold > &temp)
//1500 > 1500 returns false, skip this section.

As you see, there won't be any loop.