Home   Help Search Login Register  

Author Topic: Beware the exitWith {}  (Read 1401 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Beware the exitWith {}
« on: 25 Jun 2007, 12:03:51 »
exitWith only exists the current scope, using it doesnt guarantee to exit any script.
As an example:
Code: [Select]
SCOPE 0
while {true} do
{
   SCOPE 1
   while {player in truck1} do
   {
      SCOPE 2
      if (damage truck1 > 0.5) exitWith {hint "Too much damage"};
   }
   RETURN POINT OF EXITWITH INSIDE SCOPE 2
   if (damage truck1 > 0.5) exitWith {};
}
RETURN POINT OF EXITWITH INSIDE SCOPE 1

Offline Nixer6

  • Members
  • *
Re: Beware the exitWith {}
« Reply #1 on: 28 Jun 2007, 23:17:20 »
Thanks Mando

Really good info and much appreciated.
Why do I have to be a Rocket Scientist to make a good mission?

Offline ViperMaul

  • Members
  • *
    • Theatre Of War (Team PvP Campaign)
Re: Beware the exitWith {}
« Reply #2 on: 03 Jul 2007, 10:34:51 »
Yes Thanks!
ViperMaul
Theatre of War (Co-Lead Dev)
ACE (Jr Project Manager)