- First off the difference between elevators and platforms are, elevators move up and down and platforms move side to side
- Both elevator and platform entities are controled with the "platform X Y" command, where X is the trigger tag and Y is the trigger state.
For the switch, you can use a variety of trigger types that will yeild drifferent results. A good reference to these would be http://sandboxgamemaker.com/platinumart ... _mapmodel_
- I use the switch mapmodel as an example but you can really use any mapmodel you want you can even trigger the platforms with keys, that when pick up (using trigger types 12 or 13) move the elevator or platfom.
- Trigger tag # are associated with level_trigger_#. I believe elevator and platform tags have nothing to do with the "level_trigger_#" and only apply to the "platform # [state#]" so you can have a switch with triger tag 1 and also have a platform with tag 1, and the two will be unrelated.
- Also i think platforms and elevators are not availible in RPG mode. I'm doing this all in FPS mode, so if these examples don't work that might be why O__O
- all codes are put into mapname.cfg
First example: a switch that can only be touched once will move an elevator
you need:
the switch mapmodel ( trigger tag 1, trigger type 9 )
an elevator entity ( tag 1 )
Code: Select all
level_trigger_1 = [
platform 1 1
echo "the elevator rises"
]
Code: Select all
level_trigger_1 = [
platform 1 1
sleep 5000 [
platform 1 0
]
]
Second example: A switch that toggles moves an elevator up and down
you need:
a switch mapmodel ( trigger tag 2, trigger type 8 or 7 )
an elevator entity ( tag 2 )
Code: Select all
level_trigger_2 = [
if (= $triggerstate 1) [
platform 2 1
echo "elevator rises"
] [
platform 2 -1
echo "elevator lowers"
]
]
Code: Select all
swt = 0
level_trigger_2 = [
if (= $swt 0) [
platform 2 1
echo "elevator rises"
swt = 1
] [
platform 2 -1
echo "elevator lowers"
swt = 0
]
]
I set up these codes so you can put both example 1 and 2 in the same map for testing and whatnot. I hope this tutorial helps, and if im wrong on any of this ,since im still learning myself, do tell me XD