Candles that can be turned on/off with a frob
In this tutorial, I will explain how to create a candle archetype that,
with minimal effort, can be used to create candles that the player can
turn on or off by simply frobbing them.
As this tutorial explains how to create a custom archetype for these candles, it assumes the use of a custom gamesys. If you do not want to use a custom gamesys, then just create an instance of the new archetype's parent object, and modify that instance each time the tutorial tells you to modify the new archetype.
Now, let's begin. First of all, create a new archetype under Candle
(-181), and name it 'LitCandle'.
Add Engine Features>Frobinfo and give it these settings:
Once that's done, add S>Scripts and enter 'StdLever' into both the Script 0 and the Script 1 boxes, as that script needs to be on the object twice for this system to work.
In order for the StdLever script to work
properly, you need to add the Tweq->Joints
property. There's no need to change any of the settings in there, though;
just press Ok.
Now, you will need to create the candle's flame. Find the FireParticleFX (-3663) archetype, and create an archetype named 'CandleFlameYellow'.
Change this new object's Shape->Model Name to FX_Particle, and give it a Renderer->Transparency (Alpha) of 0.50.
Now, you need to set up this particle group to look like a candle flame. To do this, add SFX->Particles and set it up as follows:
Once that's done, you also need to set up the SFX->Particle Launch Info property, as follows:
Now the appearance of the candle flame is set up, but you still need the actual light.
First add S>Scripts and enter 'StdParticleGroup'
into Script 0, and AnimLight
Next, add the actual Renderer->Anim Light property, as set it up:
Don't forget to make use of the coloured lighting by adding Renderer->LightColour and setting it to Hue: 0.10, Saturation: 0.75.
Finally, add this link to the candle flame:
The candle system is now fully set up, but the candles will not be extinguished
when they are hit with a water or gas arrow, which is something of a must.
Give Joints2On the Tweq->JointsState
property and set the AnimC to On, Reverse.
Now, go back to the LitCandle archetype and add these two Act/React Receptron:
The WaterStim receptron will now douse the candle, and the FireStim receptron will relight it, even though that is a little bit unrealistic when it's a fire arrow that caused that FireStim!
And that concludes the tutorial.
One final note: You might also want to create an archetype under LitCandle named 'LitCandleGold', and give it a Shape->Model Name of Trcandle-v.