Jump to content
Sign in to follow this  
Totibbs

Stop the script

Recommended Posts

How can you stop a script? Because Ive a script with a loop in it. But I want to stop the loop if a East soldier gets in a trigger.

East, Present

condition: this

on activation:<< what to type here to stop the script?>>

Share this post


Link to post
Share on other sites

Ok.

In the activation field of the trigger put </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">stopScript1 = true;<span id='postcolor'>

and in your script at the beginning put </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">stopScript1 = false;<span id='postcolor'> then down in the script somewhere check for and do </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">?stopScript:exit;<span id='postcolor'>

smile.gif

Share this post


Link to post
Share on other sites

it doesnt seems to work sad.gif

this is the script:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">

#loop

stopScript1 = false

?stopScript:exit

ofi playmove"FXStandDip"

ofi_1 playmove"FXStandDip"

Goto "loop"<span id='postcolor'>

Share this post


Link to post
Share on other sites

You must not initialize "stopScript1" in the loop! And keep the variable's name... ;-)

correct code-sample:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

stopScript1 = false

#loop

?stopScript1: exit

ofi playmove "FXStandDip"

ofi_1 playmove "FXStandDip"

Goto "loop"

<span id='postcolor'>

Share this post


Link to post
Share on other sites

It is still not working. Im really dont know what I do wrong. Because I copy/paste it.

The eastern boy activates the trigger with on activation:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">stopScript1 = true<span id='postcolor'> because I made a sound effect in it... "we surrender". Its just a check I know the trigger is activated.

But the "stopScript1 = true" doesnt seem to work sad.gif

Share this post


Link to post
Share on other sites

What I would do is:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

stopScript1 = 0

#loop

~1

?stopScript1 == 1: goto "end"

ofi playmove "FXStandDip"

ofi_1 playmove "FXStandDip"

Goto "loop"

#end

hint "script stopped"

exit

<span id='postcolor'>

(edit: if you use this make sure you make the triggers onactivation field "stopScript1 = 1")

RED

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×