Home   Help Search Login Register  

Author Topic: velocity, and scripts  (Read 1605 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:velocity, and scripts
« Reply #15 on: 08 Mar 2005, 06:51:03 »
ok, thanks, i have it like this


@ (speed _man >0.1) : goto "loop"

but i get a unknown operator error,

the # is here

@ (speed _man >0.1)# : goto "loop"

thanks

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:velocity, and scripts
« Reply #16 on: 08 Mar 2005, 10:57:16 »
@ is not an if statement.  It just stops the script until the condition is true.  So the follwoing should not give you an error

@ (speed _man >0.1)
goto "loop"

The script will wait at the @ statement until the condition is true.  Once it becomes true the script will continue running at the next line

StonedSoldier

  • Guest
Re:velocity, and scripts
« Reply #17 on: 08 Mar 2005, 13:12:57 »
or try;

?(speed _man) >0.1 : goto "loop"

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:velocity, and scripts
« Reply #18 on: 08 Mar 2005, 13:52:40 »
?(speed _man) >0.1 : goto "loop"

It's not the same as an @ command. If/? won't hold the script, if speed _man < 0.1, the script will just continue, maybe exit, and the loop will break.

StonedSoldier

  • Guest
Re:velocity, and scripts
« Reply #19 on: 08 Mar 2005, 14:44:16 »
Code: [Select]
#loop
?(speed _man) >0.1 : goto "loop"
hint "The unit is stationary"

there you are, that wouldnt break

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:velocity, and scripts
« Reply #20 on: 08 Mar 2005, 18:16:14 »
Er, yes...but we don't want to go to the original #loop until Speed _man > 0.1, so if we're insisting on a 'looped if'solution:

Code: [Select]
#checkloop
~1
?((speed _man) =< 0.1): Goto "checkloop"
hint "The unit is no longer substantially stationary"
goto "loop"
It was also an unrestricted loop which is bad, lag-inducing practice; if we're trying to inform and educate (or be pedantic).

Code: [Select]
@ (speed _man >0.1)
goto "loop"
does the job in a far simpler way.