Using Switches (general guide) - CleverChaoFrontiers/Blendhog-Level-Creator-Blender-Addon GitHub Wiki
So you want things to activate or deactivate by pressing down a switch. Well, here's a tutorial explaining that general process.
Here is a button, placed next to a laser object. We want the button to turn off the laser. How would we connect these objects?
Actions parameter
Start by activating the manual parameter menu for the switch. Scrolling down you will find options tagged Actions[0], Actions[1] etc.
These parameters basically means "when this object is activated, do this action" There are three options per action.
"action"
This is the instruction on what the object should do to other objects. Most of the time, you want to use "On" and "Off". In this case, set it to "Off".
"objectIds"
Here you put in the object ID's of the object you want to influence (this ID is in the form {D53A4D9E-5191-F038-7AAE-1A0D47C366E7} for example). This is quite an annoying process, therefore you can also select the object with the colorpicker and its ID will be added automatically when exporting. If you want to influence more objects, you can press the plus button to add items to the list.
"Delay time"
This option sets how many seconds from the button being pressed to the object being influenced. We will leave this at zero.
Now if you export, the laser will turn off when pressing the button! (in 3.9.0 of the add-on there is a bug where, if the button was added before the laser, the connection will not work the first time you export. If you export again, it will work)
EventDriven
Right, so what if you want the laser to activate instead? The laser only has options for being on after all. That's where the "EventDriven" parameter comes in!
Activating the parameter menu for the laser reveals a "isEventDriven" parameter. Many objects have these and basically tells the object "do not do your thing until an event activates you". This can be useful for many things, like having platforms not move until you press a switch or in this case have a laser not turn on until you press a button.
Turning this on, will set the laser to be off. Going back to the switch, we can now set the "action" to "On" instead. This gives the result we want.
That is pretty much all you need to know about how to use switches! There are many different switches, even objects such as springs and dash panels have "Actions" parameters. Using several "Actions" with different delaytimes can do things like activating a camera, then opening a path, then resetting the camera. Keep experimenting and you will be able to create something cool!
Written by CleverChao