Home   Help Search Login Register  

Author Topic: if and then?  (Read 776 times)

0 Members and 2 Guests are viewing this topic.

StonedSoldier

  • Guest
if and then?
« on: 30 Oct 2002, 00:17:49 »
hi again guys,

anyway this might sound complicated but i'll try and explain it as simple as possible,
in the mission there are 2 varibles "fail" and "done"
in the final waypoint is it possible to script something like

if varible "done" is true then end #1
but
if varible "fail" is true then loose

thankx

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re:if and then?
« Reply #1 on: 30 Oct 2002, 01:13:00 »
I assume you meant that the if-then is in a trigger.  If you didn't mean that, then you must put it in a trigger for it to work the way you want.  Optionally, you can have your final waypoint execute a script that has the if-then statement.

If you use a trigger, in the condition field, the following code:

done

That's it.  When done is true, the condition will be met and the trigger will activate.  Have this trigger perform End #1.

Make a second trigger, but put fail in the condition field instead.  When fail is true, then this second trigger will be activated.  Have this trigger perform Loose (which should be spelled "Lose").

Depending on how your mission is made, it might be possible for both done and fail to become true at the same time (or nearly the same time).  You might want to use safer code, such as the following:

done and not fail

and

fail and not done
« Last Edit: 30 Oct 2002, 01:15:11 by Ranger »
Ranger

StonedSoldier

  • Guest
Re:if and then?
« Reply #2 on: 30 Oct 2002, 11:27:25 »
thankx ranger,

i didnt really want the mission to end instantly as soon as either done or fail were true although i modified the done and not fail command and that seems to work