LarryG on 2/5/2014 at 18:46
Have you looked at the TrapDoorLock script? Maybe using an NVRelayTrap to send "TrapLock" and "TrapUnlock" to the Lockbox will work if you put TrapDoorLock on the Lockbox.
<dl><dt id="trapdoorlock">TrapDoorLock</dt><dd>miss7.osm 2 Sets or unsets the <code>Engine Features\Locked</code> property in response to <code>TrapLock</code> and <code>TrapUnlock</code>.
</dd></dl>
scarykitties on 2/5/2014 at 19:00
Quote Posted by LarryG
Have you looked at the TrapDoorLock script? Maybe using an NVRelayTrap to send "TrapLock" and "TrapUnlock" to the Lockbox will work if you put TrapDoorLock on the Lockbox.
<dl><dt id="trapdoorlock">TrapDoorLock</dt><dd>miss7.osm 2 Sets or unsets the <code>Engine Features\Locked</code> property in response to <code>TrapLock</code> and <code>TrapUnlock</code>.
</dd></dl>
Good idea, but this isn't an issue anymore. My big issue now is that you can waste all your fuses by using them on a fusebox with a fuse already in it. I need a way for it to reject them, and using the key on a locked lockbox doesn't do it. Only a "key doesn't match" response prevents the fuse from being eaten up.
LarryG on 2/5/2014 at 19:19
Well, yeah. You need to make them distinct keys unless you want to get all fancy hand have a qvar per lockbox to indicate if the there is a fuse in the box.
scarykitties on 2/5/2014 at 19:46
Quote Posted by LarryG
Well, yeah. You need to make them distinct keys unless you want to get all fancy hand have a qvar per lockbox to indicate if the there is a fuse in the box.
I need them to be interchangeable. Is there no way to prevent them from being used up except when unlocking? I think I was on to something with that KeyDst changing idea, since that would make a lock report being the incorrect ID. The only issue was that it would only allow the change once and then would stop working.
LarryG on 2/5/2014 at 22:30
You could do something to change the KeyDst when unlocked and change it back when locked ... I think you could do this with either a S&R setup or via a Genie ((
http://www.wearytaffer.com/NV/) & search for the Genie tutorial) and property sets. Me, I'd create a receptron for a KeyDstStim which changes the lockbox's KeyDst using a fnord PropertySet which has the KeyDst property set so the keys don't work (unlocked), and another receptron for the KeyDstStim (different range) which changes the lockbox's KeyDst using a fnord PropertySet which has the KeyDst property set so the keys do work (locked). Then I'd use an NVRelayTrap on the lockbox to send the KeyDstStim locked value to itself when the box is locked and the KeyDstStim unlocked value when unlocked and you don't want to accept a key. I haven't read closely what RSoul posted or what you are trying to do, but I think that would work.
scarykitties on 3/5/2014 at 00:14
Quote Posted by LarryG
You could do something to change the KeyDst when unlocked and change it back when locked ... I think you could do this with either a S&R setup or via a Genie ((
http://www.wearytaffer.com/NV/) & search for the Genie tutorial) and property sets. Me, I'd create a receptron for a KeyDstStim which changes the lockbox's KeyDst using a fnord PropertySet which has the KeyDst property set so the keys don't work (unlocked), and another receptron for the KeyDstStim (different range) which changes the lockbox's KeyDst using a fnord PropertySet which has the KeyDst property set so the keys do work (locked). Then I'd use an NVRelayTrap on the lockbox to send the KeyDstStim locked value to itself when the box is locked and the KeyDstStim unlocked value when unlocked and you don't want to accept a key. I haven't read closely what RSoul posted or what you are trying to do, but I think that would work.
That is essentially what I did: I have two template objects, LockTemplate and UnlockTemplate, which are just markers with a few properties set. When a key is detected (FuseStim of 1), it copies the properties of UnlockTemplate, which sets the KeyDst to a value that is incompatible with the fuses. So, after locking, it no longer accepts any more keys. This part works.
Then, after a TrigWorldFrob, the object stims itself with a FuseStim of 100. I made sure to limit all the unlocking stims to 90 or less so that it wouldn't interfere with these 100-value FuseStims. It SHOULD copy the normal KeyDst value back to the lockbox, but it apparently doesn't, or it does so unreliably, as you can't just keep locking and unlocking. It breaks and stops accepting fuses after using the fuses/frobbing a couple of times.
R Soul on 3/5/2014 at 19:53
I hope you don't mind discussing this after your deadline.
Quote Posted by scarykitties
How can I have the frob where the player takes the fuse back count as re-locking the fuse box? Additionally, in spite of me putting in the Abort receptron as mentioned, using a fuse on a power box that already contains a fuse will cause the fuse to be destroyed, while it should be ignored.
Right, I didn't test that bit, but now I have.
Remove the FrobInfo property from the fuse archetype (so UseAmmo doesn't happen).
Add S > Scripts and replace the copy of StdKey with NVStackTrap
Design note: NVStackTrapOff="KeyStimStimulus"
Give it a receptron for KeyStim:
No min, No max, Effect: Send to scripts
Also add Engine Features > Combine Type: fuse (to allow proper stacking)
Edit the fuse box archetype and add another Receptron for KeyStim:
Effect: Stimulate object. Target: Source, Agent: Me
Edit Effect: Stim: KeyStim, Muliply by: 1, Then add: 0
Edit the metaprop, and in the Scripts property, check the 'Don't Inherit' box. Now, after the key is used, the meta prop is added and as far as the game is concerned, the object is no longer a lockbox.
scarykitties on 4/5/2014 at 21:15
Quote Posted by R Soul
I hope you don't mind discussing this after your deadline.
Right, I didn't test that bit, but now I have.
Remove the FrobInfo property from the fuse archetype (so UseAmmo doesn't happen).
Add S > Scripts and replace the copy of StdKey with NVStackTrap
Design note: NVStackTrapOff="KeyStimStimulus"
Give it a receptron for KeyStim:
No min, No max, Effect: Send to scripts
Also add Engine Features > Combine Type: fuse (to allow proper stacking)
Edit the fuse box archetype and add another Receptron for KeyStim:
Effect: Stimulate object. Target: Source, Agent: Me
Edit Effect: Stim: KeyStim, Muliply by: 1, Then add: 0
Edit the metaprop, and in the Scripts property, check the 'Don't Inherit' box. Now, after the key is used, the meta prop is added and as far as the game is concerned, the object is no longer a lockbox.
Much better! This does what I was trying to do much more elegantly, thanks!
Just ONE last niggling thing: the fuseboxes still accept more than one fuse, but you're then able to pull more than one fuse out of the fusebox. I want them to not accept any more fuses if there is already a fuse in place. Any little tweak I can do for that?
EDIT: Nevermind, the problem's bigger than that. In addition to the issue mentioned above, the fuseboxes only send out a TurnOn/TurnOff message when a fuse is inserted. It no longer sends a TurnOn when inserted and a TurnOff when taken out but will instead alternate between TurnOn and TurnOff every time the fuse is inserted. Removing the fuse does nothing except change the model.
R Soul on 4/5/2014 at 22:05
Here is my test mission:
(
http://www.mediafire.com/download/yfj75jra22o9jfz/key.zip)
I've used HolyStim and my objects use different names. It's just occurred to me that putting 'Don't inherit' in the meta property stops TrigUnlock working. To fix it, put TrigUnlock in the metaproperty too. The test mission doesn't use TrigUnlock at all, just the fuse model system.
edit: TrigUnlock doesn't work property with the current system. I'm a bit rusty too.
edit 2:
This is closer. It implements LarryG's suggestion of changing the KeyDst property depending on whether or not the fuse is in:
(
http://www.mediafire.com/download/16x4t1qcwocg1yb/key2.zip)
scarykitties on 4/5/2014 at 22:41
Okay, going back through your earlier stuff, I think I have it all working as needed! Here's my setup:
There are four parts to the system: Powerbox, Powerkey, M-PowerOn (metaproperty), and FuseStim.
Powerbox:Receptrons:
* FuseStim, NoMin, NoMax, Send to Scripts
* FuseStim, NoMin, NoMax, Add MetaProperty, Target: Me, Agent: M-PowerOn
* FuseStim, NoMin, NoMax, Stimulate Object, Target: Source, Agent: Me, Stimulus: FuseStim, Multiply By: 0.00, Then Add: 1.00
Scripts (Don't Inherit: True):
* NVRelayTrap
Design Note:
Quote:
NVRelayTrapOn="FuseStimStimulus"
Other:
Shape -> Model Name set for "off" model
PowerKeyReceptrons:
* FuseStim, NoMin, NoMax, Send to Scripts
Sources:
* FuseStim, Propagator: Contact, Intensity: 1, Contact Type: Frob Inv -> World
Scripts (Don't Inherit: True):
* NVStackTrap
Design Note:
Quote:
NVStackTrapOff="FuseStimStimulus"
Other:
Engine Features -> Combine Type: fuse
M-PowerOnReceptrons:
* FuseStim, NoMin, NoMax, Abort
Scripts (Don't Inherit: True):
* NVItemGiver
* NVRelayTrap
* NVMetaTrap
Design Note:
Quote:
NVGiveWhat="PowerKey"; NVItemGiverOn="FrobWorldEnd"; NVRelayTrapOff="FrobWorldEnd"; NVMetaTrapOff="FrobWorldEnd"; NVMetaTrapMeta="M-PowerOn"
Other:
Other:
Shape -> Model Name set for "on" model
... And that's it. Seems to do everything I need perfectly! Let me know if you find any bugs in the set-up.