Many 2d games feature moving platforms and things to interact with, Doom3 only offers 'stupid' movers and an interaction system based on GUIs, which cannot be used for a platform.
That's why we have added new entities in HQ2 which will help the mapper to save a lot of time: not a single line of script is now needed for the more common tasks.
Let's start from an empty boxy map.
1) Platforms moving along a path
You can easily define a path for a mover thanks to the target_mover_path entity.All you need to do is to place as many targets_mover_path you want and to connect each other to create a circular path.In this example I choose to place 3 of them:
Than connect them to create a circular path like this:
Now you can add the entity that will move along this path.
This entity is named func_mover_path, which is a func mover that can follow a path by itself. All we have to do is to link it with a target of the path.
If we want it to start moving as soon as the map starts, we can set the key "start_off" "0" on it. Otherwise the mover will start moving when triggered.
Let's set "start_off" "1". We will trigger it in the next step.
Tip1: Paths can be as long and complex as you wish.
Tip2: The simpler and more common path is build by 2 targets_mover_path targeting each other.
Tip3: If a targets_mover_path has more than 1 target, than the mover will randomly choose one of them.
Tip4: Any target_mover_path allows you to specify node-specific settings for the mover, such as speed, acceleration, deceleration.
2) Triggers for interaction
What if we want to trigger something when the player presses the interact button?
We can use a trigger_interact_once or trigger_interact_multiple.
In this example we use a trigger_interact_once and we connect them to our func_mover_path.
When the player will touch the trigger, the "interaction" icon will be shown and the trigger will be ready to use: if the player will press the interact button, than the trigger will trigger its targets. In our case, the mover will start moving.
Tip: if you want to start/stop the mover each time you press the interact button, you can set "toggle" "1" on the mover and use a trigger_interact_multiple instead.
Compile and test the map.
A func_plat_w_target i's just the usual func_plat, but you can use a target to define its destination position.
Note that in this example the platform has the key "no_touch" "1" and it's triggered by a trigger_interact_multiple. This means we can send it up/down simply interacting with the trigger.
Another interesting entity is the func_plat_autorevert. This platform moves towards its destination as long as the player is touching it. It comes back to its stating position as soon as it's left alone.
5) Make your own tests!
You can find other examples in the "playground" map, which also includes vanilla D3 entities like func_pendulum, func_rotating and func_platform.