Candles
Wall-Mounted and hand-held

Sometimes torches and lanterns are just too big and bright. These candles hava 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 obj, snd and schema folders to your FM root folder.

If your .zip program preserves path names, the files should be extracted to the following
folders:
	RSWallCand.bin	fm root\obj\
	RSHandCand.bin
	trchbrak.gif	fm root\obj\txt\
	GCandel.gif		fm root\obj\txt16\
	candsnuff.wav	fm root\snd\
	Candle.sch		fm root\schema\
	CandleSnuff.nut fm root\sq_scripts\
It's worth double checking if you're not sure.


2)
Before you start, make sure you're familiar with using a custom gamesys. If you don't want to use one, the following changes will be made to individual objects instead.

Setting this up in Dromed isn't quite as simple as with most other objects, so some instructions are required:

A while ago Nameless Voice wrote a tutorial about candles, which can be found here:
http://www.wearytaffer.com/NV/index.php?main=http%3A//www.wearytaffer.com/NV/Tutorials/Candles.htm
If you choose to follow this, be sure to substitute the candle model name(s) used with the model name of my candle: RSWallCand or RSHandCand

Alternativley, follow the instructions below, which makes use of NV's custom scripts.

Either set of instructions will leave you with a candle that can be turned off by frobbing it.

The particle effect instructions in this file are similar to what's in NV's tutorial, but there are some slight differences.


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 in b) and c), the ones here are just suggestions.


2)d)
This is where I stop copying from NV's tutotial and start writing my own \o/
If you haven't already done so, download NV's latest script module:
https://www.ttlg.com/forums/showthread.php?t=134166&t=134166
The .osm file belongs in your Thief2\ folder.

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)
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		CandleSnuff
Script 2		
Script 3		
Don't Inherit	True
(to be 100% clear, scripts 2 and 3 are blank)

2)h)
(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 a folder called "schema" in your FM root folder.

Now you need to add the candle schema. Refer back to part 1) of this readme and make sure the files candsnuff.wav and Candle.sch are in the correct folders.

In Dromed load your mission and type the command:
reload_schemas
If you have custom menus, you might find that command in there as well, but either will do.

Save your gamesys. The filename is your choice, but DO NOT overwrite dark.gam or your face will be eaten by a hedgehog.

If your mission currently uses Dark.gam (it'll say that in the white bar at the bottom of the screen), or you've saved a new .gam file, 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.

If you think the sound is too loud, you can either edit the .wav file and lower the volume, or you can edit Candle.sch and change volume from -1 to -10 or -50 and so on. -1 is the maximum volume, and volumes should always be negative. Being further away from zero makes them quieter.

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

Finally, if you have a better sound, feel free to use this to replace the existing .wav file.


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


2)j)
For the sake of completeness, you should 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 the player will have access to a gas arrow, add another receptron that is identical to the one above, but choose "KOGas" for the Stimulus.

And you'll also want to fire to relight it. In fact you already did that, when to added 
NVRelayTrapOn="FireStimStimulus" in the Design Note.
If you *don't* want fire to relight it, change the parameter to: NVRelayTrapOn="null"


2)k)
Finally, you need to link the flame to the candle:
(You can stay in the properties window of WallCandle for this bit)
Add 'Links > ParticleAttachment' and in the Link box set the following:
Flavour		~ParticleAttachment
From		WallCandle
To			CandleFlameYellow

When you click on OK, you won't see any links. As long as there are no error messages, you 
needn't worry.
Get back to the properties of WallCandle, and click the Refresh button. The link should then
appear. 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)l)
I think that's it

R Soul