nicked on 21/5/2014 at 19:43
I'm sure this should be easy, but I'm a little rusty on scripts and links and suchlike.
What I want to achieve is a number of oil lanterns that start dark, but can be lit by the player.
I can do this fine with an AnimLight with a simple frob, but what I want is for the player to have to use a tinderbox or some matches or something.
I'm guessing I may need to do it as some kind of lock and key setup, but the practicalities are eluding me.
ZylonBane on 21/5/2014 at 20:52
Tinderbox arrows! :thumb:
LarryG on 21/5/2014 at 21:41
I think that your tinderbox should be a source for a special stim and your lamp should have a receptron for that stim. Maybe make a sparking gizmo that you frob in inventory for your tinderbox. When you frob it you generate the stim. I've done something similar for other purposes using NVRelayTrap ...
What I did was on the inventory object:
* Editor>DesignNote: NVRelayTrapOn="Contained"; NVRelayTrapTOn="[5.00]RedStoneStim"; NVRelayTrapTDest="Player"; NVRelayTrapOff="FrobInvEnd"; NVRelayTrapTOff="[5.00]RedStoneStim"; NVRelayTrap2On="InvSelect"; NVRelayTrap2Off="InvDeSelect"; NVRelayTrap2TOn="[5.00]RedStoneStim"; NVRelayTrap2TOff="[15.00]RedStoneStim"; NVRelayTrap2TDest="Player"; NVRelayTrap3On="InvFocus"; NVRelayTrap3Off="InvDeFocus"; NVRelayTrap3TOn="[5.00]RedStoneStim"; NVRelayTrap3TOff="[15.00]RedStoneStim"; NVRelayTrap3TDest="Player";
* Scripts: NVRelayTrap; NVRelayTrap2; NVRelayTrap3;
* Engine Features>FrobInfo:{Move; Script, FocusScript, Deselect; [None]}
On the Garrett avatar:
* Editor>DesignNote: NVRelayTrapOn="RedStoneStimStimulus"; NVRelayTrapOff="Null"; NVRelayTrapRepeat=20; NVRelayTrapDelay=500; NVRelayTrapExclusiveDelay=1; NVRelayTrapTDest="<15.00:physical"; NVRelayTrapTOn="[25.00]RedStoneStim"
* Scripts: NVRelayTrap;
I believe I did it this way because I needed to send the stim to the player for other reasons, so I made Garrett the source of the stim to the world. You could probably make the tinderbox directly stim the world.
Also, I wanted the stim to happen whenever the object was selected in inventory and again when frobbed in inventory. You probably can simplify this to only send the stim on frobbing, or only when used as a tool by playing with the frobinfo and the messages you choose to use. Tool use would be most appropriate for you maybe. Just remember that for the FrobToolEnd message to be sent when used as a tool, some other frobbable world object needs to have the focus.
You could use FireStim instead of a custom stim. That way anything with a receprton for FireStim could be ignited (or harmed) by the tinderbox. You could even make it fail randomly using the appropriate parms for NVRelayTrap.
Oh! and you could also generate a spark effect in front of Garrett with a little bit of work ... this is sounding cool, I may have to make my own ...
Daraan on 22/5/2014 at 08:35
I made myself a bit rare here....
a while ago I made a setup for relighting torches via a key item.
here is my Tutorial:
Torch Relighter
---------------
This is a methode I invented to relight/turn on the torches in my map without using flares or arrows(not even stims).
The whole trick is that I have a special object - a lighter - which I will turn into a key.
Enough talk here is how to do it:
1) Your Lighter
Choose the object(s) you want to use as lighter and give to it the
EngineFeatures -KeySrc Property
Now choose an unused LockID and remember it. (Look for a Lock-Tutorial to learn more)
2) The Burnable Stuff
As example I want all Extinguishable(-1450) objects to be able to be lightened again.
2.1)So add in Extinguishable(-1450)
* EngineFeatures -KeyDst
* and give it the same LockID like in KeySrc
2.2) Add S - Scripts - NVRelayTrap
2.3) Add Editor - DesignNote:
NVRelayTrapOn="NowLocked";NVRelayTrapOff="NowUnlocked";NVRelayTrapTOff="TurnOn";NVRelayTrapTDest="[me]"
2.4)Note: I don't know on which objects you use this but this methode needs:
EngineFeatures - FrobInfo: Default or Script
('Default' is standard for extinguishable)
---
Other ways to use this system
You can also build something to extinguish fires just swap
NVRelayTrapOn="NowLocked";NVRelayTrapOff="NowUnlocked";NVRelayTrapTOff="TurnOn";
to
NVRelayTrapOff="NowLocked";NVRelayTrapOn="NowUnlocked";NVRelayTrapTOn="TurnOff"
Note: With this setup you can only have a lighter OR an extinguisher.
It is possible to have both items but it needs a bit more work.
nicked on 22/5/2014 at 19:21
I got all twisted round trying to use NVRelayTrap, so I started again and bodged it around a bit and did it this way:
Tinderbox Object
Frob Info: Move; [None]; Script, FocusScript
Act/React - Source - FireStim - Propagator Contact - Intensity 1.00 - Shape>Contact Types = Frob Inv -> World.
Lamp Object
Frob Info: Script; [None]; [None]
Scripts: AnimLight
AnimLight - Mode -minimum Brightness, Max Brightness = 125
Tweq Jointstates - On, Reverse
Act/React Receptron - No Max, Effect Frob Object - Target A Button.
Button Object
Links - ControlDevice -> Lamp
Uses an extra object, but I've plenty to spare, and there's not many lightable lamps in the mission, so I can live with it for the ease of setup.
Nameless Voice on 22/5/2014 at 20:29
You can light that lamp (instead of melting it) with a fire arrow.
You can save an object by using NVRelayTrap set to trigger on a stim, and the Send to Scripts receptron.