FX Oil Barrel Explosion Tutorial
Creating an exploding Oil Barrel
This tutorial assumes that you have down the 3 part particle explosion tutorial as a prerequisite. We will learn how to add all 3 to an object as an fx that can later be triggered in game via script. It is best to construct your fx in the same area that you created your particles and other source material. You do not have to, it just makes any editing or tweaking that much easier. Please note: the path to the particles and prt files you created earlier may not be identical to the paths listed below if you are doing these tutorials in the HeroCloud.
Step 1 Open up the FX Editor
Press F5 to open the hotspot menu, then under the Tools tab click on FX. This is a list of all the fx's in your world.
- Create a new FX Spec by choosing the Add button. This brings up a blank FX. Fill in a name and description. You can then turn off the Edit Spec Data Panel by toggling it's switch( see fig 1). It is also wise to name your fx group to something unique and descriptive of what your doing, since there can be multiple groups and they can be nested. Do this by double clicking on any node, it will bring up a dialog representing the node.
Step 2 - Add Particles
Drag an drop 3 emitter nodes from the tool bar to the default FXGroup. Name them FlashBang, streaks, and debris. Select the Emitter named FlashBang by double clicking on it. Under the resource property, paste in the spec path for the emitter we plan to use. You can get this by copying the name property off your emitter under the Type section. For this particular example it is
When finished add the explosionStreaks_main spec to the streaks FX particle node and the debris particle spec to the debris particle FX node.
Step 3 Adjust node settings
Now we want to adjust the FX node properties. On all 3 particle FX nodes, change the following.
- FXEmitter section can be left alone, the defaults are fine.
- FXEvent section can be left alone. This section can be used to create very complex starts, stops, and chained events.
- Under the FX3DController Set both the StartLoc and AttacthTo to "Target". We do this because it's the target that is going to blow up and we want the fx to attach it self to that object during the explosion.
On the main FXGroup node change the fire rate to half a second by entering 0:00:00.5 into the FireRate property.
Step 4 Test
We need an object to test out. You can use any static asset or preferably the Oil Barrel. Load an instance of it into the scene from the create menu or the asset panel. Go to the oil barrels properties panel and set the OerrideMaterialClass property to IGNORE. This is so that the particle do not collide with the interior of the object. If they did, you would see nothing when we play the FX. With the Oil Barrel selected, change the options on the preview panel, as follows.
- Set Caster to Selection
- Set Target to Selection
- Press store selected.
- Reset both Caster and Target to Stored
Now you can deselect your oil barrel and it will still be active with the FX
- NOTE if you have the oil barrel selected while previewing the fx, it's collision is overridden so it will not react as expected.
Press preview on the preview panel and yo should see all the particles do a times half second run on the oil barrel.
- NOTE the unload switch on the preview panel is used to unload an fx if external pieces such as particles are being tweaked while the fx editor is still open. It allows the fx the particles to be reloaded clean.
Finally save your FX for later use!!!