Sperry on 30/5/2020 at 14:26
I'd like to know how torches can be lit by radius. There are several effects I'd like to achieve, if there exists examples or tutorials I'd be very grateful to anyone able to help.
The first effect I'd like to create:
Torches in a room light up themselves according to how close they are from the player (ex: torches light up if they are in a radius of <10 dromed units of the player.
A variant of this effect would be:
Torches in a room light up and extinguish themself according to how close or how far they are from the player (ex: torches light up they are in a radius of <10 dromed units of the player, and extinguish if they are in a radius of >10 dromed units.
The second effect I'd like to create:
If the player lights one torch with a flare, other torches light up in a chain, from closes to farthest, until all the unlit torches in the level are active.
This must have been done before, but I'm having trouble finding in which missions. Advice and guidance from S&R experts would be greatly appreciated!
Nameless Voice on 30/5/2020 at 15:42
You can use the NVSpikePitRoom script from The Temple of the Tides.
Place it on a room containing the torches, ControlDevice-link it to each torch, and set the distance at which they should turn on via the design note NVProximity=6.00
It goes on a room type because it's only active while the player is in that room, to reduce performance impact of checking the distances constantly.
nicked on 30/5/2020 at 16:20
For the first effect:
1. Add a custom stim (e.g. GarrettProximityStim).
2. Edit Garrett archetype. Add Act/React: Source - Stimulus: GarrettProximityStim, Propagator: Radius, Intensity: 100; Edit Shape - Radius: 30, No Flags, Linear Disperson; Edit Life Cycle - Flags: No Max Firings, Period: 100, 0 for the other fields.
3. Now edit your torch and add Act/React: Receptrons - Stimulus: GarrettProximityStim, Min Intensity: 70, No Max Intensity; Effect: Stimulate Object, Target: Me, Agent: Source; Edit Effect - Stimulus: FireStim, Multiply by 1, Add 100
4. Add another Receptron to the torch - Stimulus: GarrettProximityStim, No Min Intensity, Max Intensity: 70; Effect: Stimulate Object, Target: Me, Agent: Source; Edit Effect - Stimulus: WaterStim, Multiply by 1, Add 100
5. Set torch AnimLight property to Minimum Brightness so it starts off.
Adjust the value of 70 on both receptrons to try different distances. With 70 you'll need to be quite close to the torch to light it.
Yandros on 1/6/2020 at 15:26
I did this in the haunted crypt in The Drymian Codex using a S&R setup similar to what nicked described, except I might have just sent TurnOn/TurnOff messages instead of FireStim and WaterStim. Also the trigger/source was an invisible AI rather than the player. The AI was invisible so the changing torches was a visual clue to the player as to where the AI was. But the concept is the same.
nicked on 1/6/2020 at 18:59
For the second problem, I don't know if there's a realistic way to make it dynamic. I don't think you could have the player be able to light *any* torch, and it dynamically work out which ones to light next, not without about a bazillion links anyway.
If the first torch is always the same one, this setup becomes much easier. Torches respond to TurnOn, so you can just CD them. If you want a nice slowly-spreading effect, just add a relay in-between e.g.:
Torch1 -CD-> NVRelayTrap1 (with Editor>Design Note: NVRelayTrapDelay=1000) -CD-> Torch2 -CD-> NVRelayTrap2 etc. etc...
nicked on 1/6/2020 at 19:01
Oh actually you probably could do it dynamically with another custom stim on the torches, with a big enough radius to affect nearby torches.
vfig on 1/6/2020 at 22:15
Just be careful about torches that turn on and off too often: they start climbing up the walls!
john9818a on 2/6/2020 at 04:13
I thought that the torch climbing issue was fixed.
Psych0sis on 2/6/2020 at 06:34
Perhaps, but this is sperry we're talking about, and he still uses olddark :joke: