Triggering Emitters
From FleshWorks
by GlasWolf, info from Krypt
Intro
Most of the stock emitters in the actor browser are continuous, things like smoke or dripping water. However, some are one-time emitters that show effects with a short lifespan - a puff of dust or a burst of lightning for example. If you place the latter type of emitter in your map, they will fire as soon as the map loads then never be seen again, which will generally not be what you want to happen. So we need to trigger the emitter in some way when we want it.
The trick is to spawn the emitter when it's needed, instead of physically placing it in your map. To do that we need a link, a script and an actor. (I'll assume you know the basics of creating links and writing scripts.)
The Trigger Action
First we need to decide the action that will trigger the emitter - lets say that you want a puff of dust to rise when you open a trap door (ok it's a weak example but it's easy). Place the trap door in the map, then go into the script editor and create a new script. Make the condition
Frob -> When I am frobbed by player and the action
Objects -> Spawn object type at end of [Spawn] at all locations at the end of [TriggerScript]. We'll assume this is only to run once, otherwise we'd add
Scripts -> Reset script conditions and actions to the end. But you knew that. OK everything to close the script editor, right-click on the trap door in the map and add the new script to its Scripts -> Triggerscripts property. Now we need to set up the relevant links.
Open the actor browser and select the emitter type you want. Now back in the map, right-click on the trap door again and look at its Actor Links. Add a link here, make it of type Spawn and click Use Current Archetype beside the To field. The emitter name you've selected in the actor browser should appear. OK all that. Now go back to the actor browser and add an actor of type Marker -> Keypoint -> InvisibleMarker to your map. Place it on top of the trap door, which is where you want the emitter effect to appear. Finally, use the links tool to create a TriggerScript link, running from the trap door to the InvisibleMarker.
Test it in game - hopefully you're all done.
Back to Mission Design: Environmental
