6635b6d3086cf

6635b6d308bee
1 Guest is here.
 

Topic: NVRelayTrap for Dummies Read 4185 times  

6635b6d309398ZylonBane

6635b6d309408
Since NVRelayTrap is the NVScript I use, like, 99% of the time, I thought it would be useful to create a document that condensed the NVScript documentation down to just the NVRelayTrap-relevant content. And now since I've created it, I figured I may as well share it.

My goals with this were:
- Create purely NVRelayTrap-focused documentation derived from the NVScript documentation
- Explicitly break out and and explain every parameter.
- Consistent terminology throughout.

Hopefully I haven't introduced any misinformation in the process. NV if you see this, please give it a review. Also, I had some questions come up:
- Any useful undocumented parameters?
- No equivalent of TrapFailChance for deactivation events?
- TrapFailChance int or float?
- Do Failed activation attempts count toward the max activation counts?
- Weighting scheme for weighted links could use more explanation.
- What is the default “inactive” value of the trapon/off/delay/max values?
- NVRelayTrapExclusiveDelay: Do delayed messages queue up by default?
- Will NVRelayTrapRepeat use NVRelayTrapOn/OffDelay/Max params, or just the base generic delay?

6635b6d30a972Nameless Voice

6635b6d30a9ee
- Any useful undocumented parameters?
NVRelayHaltTimerOnOn / NVRelayHaltTimerOnOff

Kills any existing timer (delayed message) when the trap is activated/deactivated.

- No equivalent of TrapFailChance for deactivation events?

The same fail chance applies to both activation and deactivation.  It can fail to send the trigger.

- TrapFailChance int or float?

Float.


- Do Failed activation attempts count toward the max activation counts?

They count towards the max trap activation count (NVRelayTrapCount), but not the max trigger activation count (NVRelayTrapTCount).

- Weighting scheme for weighted links could use more explanation.

Basically, it builds up a list of all the links, adding each link to the list the number of times specified in its weight.  It then picks a random link from that list.

- What is the default “inactive” value of the trapon/off/delay/max values?
NVRelayTrapOn="TurnOn"; NVRelayTrapOff="TurnOff"; NVRelayTrapTOn="TurnOn"; NVRelayTrapOff="TurnOff"; NVRelayTrapDelay=0; NVRelayTrapDelayMax=0; NVRelayTrapOnDelay=0; NVRelayTrapOnDelayMax=0; NVRelayTrapOffDelay=0; NVRelayTrapOffDelayMax=0

- NVRelayTrapExclusiveDelay: Do delayed messages queue up by default?

There can be multiple delayed messages waiting at the same time.  Normally, a delayed message should fire at that number of milliseconds after it was activated, regardless of other messages.

Note that I think I noticed a bug with ExclusiveDelay today - it doesn't work as expected if an object has multiple relay trap scripts on it which use delayed messages.  I suspect repeating won't work reliably either.
(e.g. values relating to timers and repeats are shared amongst all script instances, so an exclusive delay on one will kill timers on another.)

- Will NVRelayTrapRepeat use NVRelayTrapOn/OffDelay/Max params, or just the base generic delay?

It will use the most specific param specified.  The code is shared for all of this functionality, there are no separate code paths with more/less features.
« Last Edit: 30. June 2014, 02:08:08 by Nameless Voice »

6635b6d30aad9ZylonBane

6635b6d30ab3e
Woot, thanks!

Do NVRelayHaltTimerOnOn / NVRelayHaltTimerOnOff get set to anything, or do you just include them?

6635b6d30accdNameless Voice

6635b6d30ad28
The guide itself seemed fine.  I didn't see any mistakes.

6635b6d30ae85voodoo47

6635b6d30aed5
can one relaytrap send signals to multiple objects? the guide suggests this is possible, but no idea how to separate the obj ids, tried a couple of things, but only the first object has received the activation message.
« Last Edit: 23. May 2015, 21:00:23 by voodoo47 »

6635b6d30afa4ZylonBane

6635b6d30aff2
The only ways to send messages to specific multiple objects are:
- Create links to them
- Put them under the same parent archetype
- Put a unique metaproperty on them

There is, as far as I'm aware, no way to give it a list of named objects.
Acknowledged by: Nameless Voice

6635b6d30b07bvoodoo47

6635b6d30b0c6
a swarm of relay traps it is then.

6635b6d30b164ZylonBane

6635b6d30b1b2
What exactly are you trying to do?

6635b6d30b254voodoo47

6635b6d30b2a9
a destruction of an object should send a turnon signal to three other objects. no worries, working fine with three relay traps.

6635b6d30b338ZylonBane

6635b6d30b385
There can't be links to the objects?

6635b6d30b428voodoo47

6635b6d30b47f
there can be, but as mentioned, no problem with using three relay traps.

6635b6d30b539ZylonBane

6635b6d30b58b
Are these relay traps using NVScript to send a message to named instead of linked objects? That's the only situation I can think of where it would make sense to use so many objects.

6635b6d30b634voodoo47

6635b6d30b6e6
just regular objects (it's a dml fix). I could link them I suppose, but hey, if it works, don't fix it..

Your name:
This box must be left blank:

Name the AI that appears in both System Shock games:
1 Guest is here.
Turn the game console off right now.
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
6635b6d30eb4d