Wall Mounted Candle & similar models

Models & required textures:
RSWallCand (GCandel.gif, trchbrak.gif) - wall mounted candle
RSHandCand (GCandel.gif, trchbrak.gif) - handheld candle for placing on a desk etc, has a handle instead of a wall bracket

To allow the player to carry a candle on its own:
RSWallCandSc (trchbrak.gif) - just the sconce (wall-mounted), no candle
RSCandle (GCandel.gif) - candle on its own. Can be placed on the empty sconce model
RSCandleL (cndflame.tga, GCandel.gif) - candle on its own with a fake flame texture for being carried like a lit flare
(if the player can carry an illuminated candle, give it the properties Inventory > RenderType. Type: Alternate Model, Resource: RSCandleL)

Each of the candle models has a vhot so that a particle effect can be added, and the light will be emmitted from the top rather than the middle.
For an idea of the size, the candle on this object is similar in size to the candle on the gold candlesticks that someone always steals...

Credits:
	GCandel.gif - NV's Enhancement Pack
	candsnuff.wav - modified version of puff2.wav (orignal resource)


Installation:
1)
Extract the required files, see the top for which bin requires which texture(s).

The files should be extracted to the following folders:
	bin files   	obj
	textures        txt16
	candsnuff.wav	snd
	Candle.sch		schema - note this you'll need all the other schema files if you want to update them (see section 2)

2)
This requires a custom gamesys (or use .cow files).

Make sure you have NVScript.osm in your game's folder and loaded into your mission.

2)a)
It's recommended that you create a new archetype under:
'SFX > FireFX > FireParticleFX'
Call it:
CandleFlameYellow
(or any name that makes sense to you)


2)b)
Add to this the property Shape > Model Name, and change its contents to:
FX_Particle

Now add the property SFX > Particles, and set the following values:
(where there are three numbers spaced out, these correspond X, Y, Z fields)

Active						False
Particle Render Type 		Single-coloured disc
Particle Animation 	  		Launched continually
Particle Group Motion 		Attached To Object
Number of particles 		45
Size of particle 	  		0.10
Bitmap name 				
Velocity					0		0 		0
Gravity Vector 	  			0 		0 		2
Colour (Palettised) 		125
2nd colour 	  				188
3rd colour 	  				47
Alpha 	  					90
Fixed-group radius 	  		0
Spin / pulse group 	  		False
Spin speed 	  				0 		0 		0
Pulse magnitute 	  		0.00
Pulse cycle time ms 		0
Particle fade time 	  		0.40
Launch period 	  			0.03
Animation offset ms 		0
Group scale velocity		0.00
Always simulate 	  		False
Always simulate group 		False
Sort particles (slow) 		False (Unavailiable)
Particles start launched 	True
Alpha subpixel particles 	False
Skip subpixel particles 	False
Ignore attachment refs		False
Force matching unrefs 	  	False


2)c)
Now add the property SFX > Particle Launch Info:

Launch Type		Bounding Box
Box Min 	  	-0.04 	-0.04 	0
Box Max 	  	0.04 	0.04 	0
Min Radius 	  	2.00
Max Radius 	  	2.00
Loc unrotated? 	False
Velocity min 	0 		0		0
Velocity Max 	0 		0 		0
Vel unrotated? 	False
Min Time 	  	0.70
Max Time 	  	0.75

Feel free to experiment with the values above. The ones here are just suggestions.


2)d)
Create a new archetype under:
'physical > Lights > Extinguishable'
Call it:
WallCandle
(or any name that makes sense to you)


2)e)
Add to it the property Shape > Model Name: RSWallCand (or RSHandCand with a suitable object hierarchy name)
Add the property Renderer > AnimLight, with the following values:

Mode					SmoothlyBrighten
millisecs to brighetn	256
millisecs to brighetn	256
max brighness			40
min brighness			0
radius					10
inner radius			0
quad lit				False
offset from object		0		0		0
currently rising?		False
current countdown		256
inactive				False

Then add Renderer Light Colour:
Hue						0.1
Saturation				0.6


2)f)
Currently this object will inherit an ambient sound from a parent archetype, so add the 
property 'A > AmbientHacked', change Radius to 0 and delete the Schema Name


2)g)
Now you need to add four scripts (the last one is optional, i.e. for perfectionists).
Add the S > Scripts property and delete any scripts already in there. Add the following:
Script 0		AnimLight
Script 1		NVRelayTrap
Script 2		NVMetaTrap
Script 3		NVSimpleSchemaPlayerTrap
Don't Inherit	True


2)h)
Add the property Editor > Design Note and copy and paste in the following:
NVRelayTrapOff="FrobWorldEnd";NVRelayTrapOn="FireStimStimulus";NVRelayTrapTDest="[me]" ;NVMetaTrapOn="TurnOff";NVMetaTrapOff="TurnOn";NVMetaproperty="FrobInert"

And if you're using the optional fourth script, copy and paste this at the end of the previous (including the semicolon!):
;NVSimpleSchemaPlayerTrapOn="TurnOff";NVSimpleSchemaPlayerTrapOff="null";NVSchema="CandleSnuff"


2)i)
(There is no need for this if you don't want a sound, though the sound is recommended)

Currently there will be no "CandleSnuff" schema, so you will have to make one. A sound file 
and a suitable schema file have been included. This will require a custom gamesys.

Download the Schema Files from Telliamed's website. The direct link is:
http://www.thiefmissions.com/telliamed/schema118r1.zip
The website address is:
http://www.thiefmissions.com/telliamed/

Extract the contents of the .zip file to your FM's schema folder alongside Candle.sch


In Dromed load your mission and type the command:
reload_schemas

Save your gamesys. The filename is your choice.

If your mission currently uses Dark.gam (it'll say that in the white bar at the bottom of the screen), type the command:
set_gamesys XXX.gam
where XXX is the filename.
Save your mission - and NEVER get the .mis and .gam files mixed up.
(or just use a .cow file, remembering to split them up correctly for release/testing in the real game)

If you think the sound is too loud, you can edit Candle.sch and change volume from -1 to -10 or -50 and so on. Only negative numbers are used.

If you edit the schema, remeber to use the reload_schemas command again, and then save the gamesys/cow file.

2)j)
To allow the frobbery to happen, add the property Engine Features > FrobInfo. Set WorldAction to 'Script'.


2)k)
For the sake of completeness, you can allow Water arrows to put the flame out:
Add 'Act/React > Receptrons' with the following values:
Object			WallCandle (if that's the name you gave the archetype)
Stimulus		WaterStim
No Min			True
No Max			True
Effect			Frob Object
Target Object	Me

If necessary, do the same as above the "KOGas" stimulus.
Some players will kick themselves if they use up precious arrows on these candles and find out much later that they can just frob the damn things.

Fire will already relight these, as this was set in the design note parameter: NVRelayTrapOn="FireStimStimulus".
If you *don't* want fire to relight them, change the parameter to: NVRelayTrapOn="null"
(it might make more sense for a fire arrow to destroy the candle and only a lit flare to relight it, but I'll leave that to you)

2)l)
Finally, you need to link the flame to the candle:
(do this from the properties window of WallCandle/HandCandle)
Add 'Links > ParticleAttachment' and in the Link box set the following:
Flavour		Select the "~" to make it a reverse link then choose ParticleAttachment
From		WallCandle
To			CandleFlameYellow


Double click on the Link to bring back the Links window, then set the Link Data to:
Type		Vhot
Vhot #		1
Joint		N/A
Submodel	0


2)m)
I think that's it

R Soul
