ALE help

ALE help

Postby Grav7ty » 24 January 2020, 22:01

How do you make a button with two different functions?

On my base map, I want to have a button that can open and close a door, depending on the state of the door.

Grav7ty
Recruit
 
Posts: 10
Joined: 1 January 2020, 23:40

Re: ALE help

Postby Metaphoric Tree Hugger » 24 January 2020, 23:05

I know how to do this. I'm not good at explaining stuff though, but I'll give it a shot:

To make a toggle switch, create a trigger, and set it to have the following actions:
- define a variable's value
You can either use a separate trigger so it only occurs once, or use the 'set if value not defined action'.
- move the door to a region, depending on the variable's value
- switch the variable's value
By doing this, the door will be moved to the other region the next time the trigger is activated

Example:
Set variable 'A' to value 'B' if not defined (A: [toggle], B: 0)
Skip next action if variable 'A' does not equal value 'B' (A: [toggle], B: 0)
Move movable 'A' to region 'B' (A: #door, B: #r*open)
Skip next action if variable 'A' does not equal value 'B' (A: [toggle], B: 1)
Move movable 'A' to region 'B' (A: #door, B: #r*closed)
Skip next action if variable 'A' does not equal value 'B' (A: [toggle], B: 1)
Set value of variable 'A' to value 'B' (A: [toggle], B: 2)
Skip next action if variable 'A' does not equal value 'B' (A: [toggle], B: 0)
Set value of variable 'A' to value 'B' (A: [toggle], B: 1)
Skip next action if variable 'A' does not equal value 'B' (A: [toggle], B: 2)
Set value of variable 'A' to value 'B' (A: [toggle], B: 0)

To make it dependent on the door's location instead, create a trigger, and set it to have the following actions:
- define a variable's value
- move the door to a region, depending on the variable's value
This time however, set the regions to be activated by a movable, and have each region activate a different trigger when activated.

Example:
Set variable 'A' to value 'B' if not defined (A: [toggle], B: 0)
Skip next action if variable 'A' does not equal value 'B' (A: [toggle], B: 0)
Move movable 'A' to region 'B' (A: #door, B: #r*open)
Skip next action if variable 'A' does not equal value 'B' (A: [toggle], B: 1)
Move movable 'A' to region 'B' (A: #door, B: #r*closed)
Regions' attributes:
#r*closed (Activation on movable, activates a trigger - Set value of variable 'A' to value 'B' (A: [toggle], B:0)
#r*open (Activation on movable, activates a (different trigger) - Set value of variable 'A' to value 'B' (A: [toggle], B:1)

One problem with toggle switches is that they may become unsynchronised, although I believe it is possible to fix that by synchronising the variables' values.

If it would help you, I could make an example map for you. Apologies in advance if I've made it complex, or if I haven't explained it well.
User avatar
Metaphoric Tree Hugger
Recruit
 
Posts: 4
Joined: 5 August 2019, 14:59
Location: United Kingdom

Re: ALE help

Postby Grav7ty » 25 January 2020, 21:39

Sorry, I do not understand, but it's hard to understand people with just text. Thanks, though.

Grav7ty
Recruit
 
Posts: 10
Joined: 1 January 2020, 23:40

Re: ALE help

Postby daft punk 777 » 26 January 2020, 03:41

i know easy system by only 3 doors, 3 buttons , and you need big floor. (dont forget to mute two invis doors !!) (by this tutorial you can do not only door open/close functions)
and watch this :
User avatar
daft punk 777
Falkok [250]
 
Posts: 295
Joined: 22 December 2016, 11:15


Return to Bug Reporting Archive

Who is online

Users browsing this forum: No registered users