View Single Post
 
Reply
Posted 2008-01-04, 07:21 AM in reply to Meganroid_6's post "soory i dont know how"
A conditional branch is basically an If statement:

<> If a variable = TRUE Then
<> Do actionA
<> Else
<> Do actionB

In this case, you want an event to not happen once it's happened once. As switches are global (that is, they work for all maps, not just the one they are used in), you can turn it on in the first map, go to a second map, go back to the first map, and it will be still on.

I'll pseudocode your event, just to demonstrate:

<> If Switch0001 is OFF Then
<> Event Actions Occur
<> Turn Switch0001 ON
<> Else
<> Do nothing

In the above code - the event checks if the switch is OFF. If it is, then the event takes place. At the end of the event, the switch is turned ON. Next time you run the event, it will check to see if the swtich is OFF. It will find it ON, and skip the event action. This effectively disables it.

---

Create a new event (1). Double click the event box (2) to bring up the commands menu, and go to page 3 (3). A third of the way down the second column, click Conditional Branch (4). In the switches 'tutorial', we created a switch called "Name it here". Use the dots to bring up the switches screen to select it (or make a new switch), OK it, and select OFF from the drop-down menu (5). Make sure the custom handler box is ticked (6) and click OK (7).

Back in the Event screen, double click the first blank line starting with "<>" (8) and add the event actions that you wish to do.

Directly after the actions, bring up the commands menu by double clicking the next blank line starting with "<>", go to page 1 (9), and click Switch Operations (10) halfway down the first column. Select the switch that you've used for the event by clickin the dots (11) to bring up the Switch menu, and set it to Turn On (12), then click OK (13), and save the event.







---

Now BlueCube will probably pop up and tell me that it's easier to do with Preconditions and extra pages, but I prefer the above method as it keeps it all on one page, and to me is easier to work.
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny