Daraan on 9/1/2014 at 22:40
I'm looking for a temporarily link type which I can use without side effects to simply transmit messages. ScriptParams, CD and Population are already used. I'm thinking about Owns and Host but I'm not sure if its save to use them.
LarryG on 9/1/2014 at 23:01
Why not use CD? Only objects CD linked will receive the message and you can control the message to be anything you want via NVRelayTrap. Or you could use tnhScript's ScriptController to send a ScriptControl message
Quote:
[h=1]ScriptController[/h] Send a <kbd>ScriptControl</kbd> message to other objects. The first message data argument is the control string, as usual. The second argument can name the object to send the <kbd>ScriptControl</kbd> to. If the object isn't given in the message argument, then it is relayed to all <kbd>ControlDevice</kbd> linked objects.
[h=2]How to Generate the Message[/h] There are two means of generating the <kbd>ScriptControl</kbd> message:
* Use a <kbd>Conversation</kbd> (or (
http://dromed.whoopdedo.org/dromed/link/aiwatchobj) AIWatchObj link data, <kbd>AlertResponse</kbd> etc)
* Action: <kbd>Script Message</kbd>
* Argument 1: <kbd>ScriptControl</kbd>
* Argument 2: Some string. Suitable strings depend on the script used by the target object.
* Argument 3: The name of the target object (if omitted, a (
http://dromed.whoopdedo.org/dromed/link/controldevice) ControlDevice link from the AI to the target object can be used.
* The <kbd>ScriptController</kbd> script should then be added to the AI.
* Put the script on a regular trap:
* Use the design note to specify <kbd>on=value</kbd>, where a suitable <kbd>value</kbd> depends on the target object.
* Link the trap with (
http://dromed.whoopdedo.org/dromed/link/controldevice) ControlDevice to the target object.
* The trap can be activated with a button, lever, or any other standard trigger.
[TABLE="class: inline]
<tbody>[TR="class: row0]
[TH="class: col0]Inherits [/TH]
[TD="class: col1 leftalign] (
http://dromed.whoopdedo.org/tnhscript/genericcontrol) GenericControl [/TD]
[/TR]
[TR="class: row1]
[TH="class: col0]Links [/TH]
[TD="class: col1 leftalign] (
http://dromed.whoopdedo.org/dromed/link/controldevice) ControlDevice[/TD]
[/TR]
</tbody>[/TABLE]
Daraan on 9/1/2014 at 23:15
I want to keep track on objects inside an OBB object (TrigOBBSpec), while it's easy to get all objects inside with Population I can't tell which object is leaving the OBB. CD and ScriptParams are fixed links while population+the 4rth are only temporarily.
My idea is to have this extra link parallel to the standard Populationlink. On PhysLeave I remove all extra links which also have a Pop-link and so one only one remaining is my leaving object which then gets special attention.
Note: This leaving object can be anything.
LarryG on 9/1/2014 at 23:42
If I understand you correctly, you are writing a new script similar to, but enhanced from TrigOBB?
Quote:
<dl><dt id="trigobb">TrigOBB</dt><dd>gen.osm 1/G/2 Trigger that activates when an <code>Avatar</code> or a <code>Creature</code> that is not dead enters the previously unpopulated bounding-box of the object. (Message <code>PhysEnter</code>.) When all the objects that had previously triggered the script leave (<code>PhysExit</code>), it deactivates. On activation, a schema is played with the <code>Event Activate</code> tag, and <code>TurnOn</code> is sent along <code>ControlDevice</code> links. When deactivated, the <code>Event Deactivate</code> schema tag is played, and <code>TurnOff</code> is sent. Objects that enter the bounding-box have the <code>M-NotifyRegion</code> meta-property added to them; it is removed when they exit. Uses <code>Population</code> links to track the objects that are in the bounding-box.
The script is supposed to listen for when an object in the bounding-box dies (<code>Obituary</code>), but it fails to do that. So when it happens, the trigger never turns off. Because objects in the player's inventory are non-physical, it won't get the <code>PhysExit</code> message if you carry the corpse out of the bounding-box.
</dd></dl>
And the source link of the <code>PhysExit</code> message doesn't self-identify? How is M-NotifyRegion removed from the right object if that is the case?
Daraan on 10/1/2014 at 00:27
I wish I could write it on my own. I asked kdau a while back ago if he could write me a OBB script with the options I need. He told me about (
http://dromed.whoopdedo.org/public_scripts/trigobbspec) TrigOBBSpec from the PublicScripts which can track any object and that he writes it on his to do list. Today I started to think about my problem again and how to solve it with that script.
Quote:
And the source link of the PhysExit message doesn't self-identify? How is M-NotifyRegion removed from the right object if that is the case?
Source of PhysExit/Enter is 0 and not the object. That makes it so hard :(
Using NVRelayTrapTDest="[source]" does nothing. Any other ideas how to get the source?
R Soul on 10/1/2014 at 00:50
What are you trying to do? I know you've already mentioned tracking objects in a bounds trigger, but can you describe it in more general terms? E.g. 'destroy the first object that leaves a specific area'.
Daraan on 10/1/2014 at 01:15
I want to apply constant velocity to all objects(including player) when they enter the bounds. So for example when a crate is thrown in I want it to move in a certain direction (with constant speed!). Via Stim I copy the Physics->Controls property / ConveyorVelocity to objects/player to get them moving. Applying the velocity is no problem but removing it when the bounds are left.
R Soul on 10/1/2014 at 02:05
You could surround the BoundsTrigger with other BoundsTriggers, with the other ones adding a different velocity property.
Daraan on 10/1/2014 at 19:09
Quote Posted by R Soul
You could surround the BoundsTrigger with other BoundsTriggers, with the other ones adding a different velocity property.
That was really an idea. I think I use this for another similar situation but for exactly this one that would be a lot of extra work because there is more that one of that kind and they are moving as well.
That is my solution. For the extra link I took ~ScriptParams:
On OBBArchtype
Scripts: TrigOBBSpec+NVRelayTrap1-4
DesignNote:
Code:
NVRelayTrapOn="Timer";NVRelayTrapTOn="[1]MyStim";NVRelayTrapOff="Null";NVRelayTrapTDest="&Population";
NVRelayTrap2On="PhysEnter";NVRelayTrap2TOn="DeleteLink";NVRelayTrap2Off="PhysExit";NVRelayTrap2TOff="DeleteLink";NVRelayTrap2TDest="&Population";
NVRelayTrap3On="PhysExit";NVRelayTrap3TOn="[-1]MyStim";NVRelayTrap3Off="PhysExit";NVRelayTrap3TOff="DeleteLink";NVRelayTrap3TDest="&~ScriptParams";
NVRelayTrap4On="PhysEnter";NVRelayTrap4TOn="LinkToMe";NVRelayTrap4Off="PhysExit";NVRelayTrap4TOn="LinkToMe";NVRelayTrap4TDest="&Population"
ScriptParams(arc) Link to my MetaProp
MetaProp
Obj which should be affected get this meta prop. In my case physical (for the moment)
Receptrons: On/Off
Scripts: NVLinkBuilder4 (Since LinkBuilder will be used anywhere else as well)
DesignNote:
Code:
NVLinkBuilder4On="LinkToMe";NVLinkBuilder4Off="DeleteLink";NVLinkBuilderLink4Type="ScriptParams";NVLinkBuilderLink4Source="[me]";NVLinkBuilderLink4Dest="[source]"
After over one year finally solved that problem :D