Loop to delay
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(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_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
- - -
&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(¤t_sprite, 12);
sp_touch_damage(¤t_sprite, 0);
sp_timing(¤t_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
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.
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.
Every player will have a diff. gold amount.
Maybe only a freeze command is missing.
Maybe only a freeze command is missing.
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
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
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.
//&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.