A moving emitter that gets turned off in one room and turned on in another - by sNeaksieGarrett
sNeaksieGarrett on 31/5/2013 at 16:47
Is that possible? I have an steampuffspout linked to an AI with a contains link and am trying to figure out how to make it so that when he walks inside a building the emitter gets turned off (or destroyed?) and then when he exits the building it turns on again. AIWatchObj/Conversations don't have a "modify property of object" type or some such, so I'm not sure how to go about it.
I actually tried setting this up with an AIWatchObj linking to a boundstrigger which was linked to a destroytrap, which then linked to the spout object. Whenever the guard walked into the room, it destroyed the spout, but that's just going inside. I'd then need to figure out how to recreate the emitter and have it attached to the guard again.:erm: Either that, or just somehow set a EmitterState Off/On message to the spout when exiting/entering a certain room. (?)
Also, my apologies if this has somehow been discussed in the past, I tried doing a search but finding anything like this is too hard so I just decided to make a new thread. If anyone has a relevant thread they could link me to I'd be grateful.
R Soul on 31/5/2013 at 17:56
If you give the steampuffspout the script TweqOnOff you can link a BoundsTrigger to an Inverter to the steampuffspout to turn it off, and another BoundsTrigger directly to the steampuffspout to turn it on.
BoundsTriggers will be activated/deactivated by any AI, or the player, so it's not the best solution unless you can be certain no one else can go through the BoundsTrigger.
It's going to be a bit more complex if it's, say, any AI entering any building. I'm happy to look into it further, but only if that's what you're trying to do.
sNeaksieGarrett on 31/5/2013 at 18:27
Yeah, I thought of that but I wasn't sure how else to handle it. I was hoping there might be some way to force a boundstrigger to ignore the player walking trough it, but not the AI.
I only need it for one specific area, AFAIK. TweqOnOff it is, thanks! Could I maybe set up a different marker object that only the AI would trigger?
sNeaksieGarrett on 1/6/2013 at 00:33
I don't understand how to use the new script. I created a marker object and put TrigOBBSpec on it via S>Scripts, added the M-NotifyRegion script, and then CD'd the marker to the spout. Doesn't seem to work. I'm sure I'm not doing this properly. I did also load script.osm and version.osm. The dromesday book mentions ScriptParams links, but I don't understand how those work. What is an "arc" ? I don't see that in the Links drop down.
LarryG on 1/6/2013 at 00:56
And putting TrigRoomObject on the emitter doesn't work? Route link from the emitter to the rooms and cd link from the rooms to the emitter ... or did I misunderstand what you want to do?
Quote:
TrigRoomObject
gen.osm 2
Sends TurnOn to ControlDevice linked objects when this object enters a specific room (message ObjRoomTransit). Sends TurnOff when leaving the room. The room to trigger on is specified with Route links from the object. Any room object that inherits from one of the linked rooms will trigger the script. Moving between two different rooms that both have a Route link from the object will do nothing. Even non-physical objects receive ObjRoomTransit messages, so objects in inventory will also trigger.
sNeaksieGarrett on 1/6/2013 at 02:32
I can't get that to work either, but in any case, what I wanted was for the emitter to turn on when the AI leaves the building, and to turn off when entering the building.
The part you quoted mentions that you only want one route link from the object to the room, but even doing that doesn't work. After I set the link, do I need to do any calculations or anything? I did the links on existing room brushes.
I don't know if this matters, but do I need to add Emit on the instanced copy of the emitter object? 'cause the spout object I'm using has an Emit property within the hierarchy, but as an instanced object in the level it does not. Actually, nevermind, that shouldn't matter because I was able to turn off the emitter via a boundstrigger and a relay trap CD'd to the emitter.
LarryG on 1/6/2013 at 06:38
Quote Posted by sNeaksieGarrett
I can't get that to work either, but in any case, what I wanted was for the emitter to turn on when the AI
leaves the building, and to turn off when
entering the building.
So Route link the emitter object the AI contains to all the room brushes outside of the building. That will get the TurnOn Sent when the AI exits the building and TurnOff when it enters. I suggest you have the CD links to a relay trap. That way you can see what's going on. I would put SPY or NVSpy on everything involved while running tests to see what messages get sent by whom.
AI > Contains > emitter object (with TrigRoomObject) > Route > Outside Room Brushes > CD > RelayTrap > CD > to whatever you want turned on/off
sNeaksieGarrett on 1/6/2013 at 15:18
Tested again, I'm guessing it's breaking because the AI is already in the "turnOn room?" He starts outside, and then goes inside if he hears Garrett making noise.
NVSpy reported these from MONO:
NVSPY: "ObjectRoomExit" on Trader'sBank<149> from <0>
NVSPY: "ObjectRoomEnter" on Trader'sBank<149> from <0>
NVSPY: "ObjectRoomEnter" on Baron's_Way<1018> from <0>
NVSPY: "ObjectRoomExit" on Baron's_Way<1018> from <0>
NVSPY: "ObjRoomTransit" on BreathSpout<2423> from <0>
What the hell? Why is it reporting 0? :weird: There's some other ones like "DarkGameModeChange," "EndScript," and "Sim" coming from the room brushes, the spout and the relay trap. Perhaps it's not working because one of those room brushes is inherited? Should I be making a new room brush outside so it's a completely new room brush? I should just tell you I'm editing LOTP and I'm using an archer outside of some guy's office building with a vault who has a breath emitter attached to him. Maybe I need to just start from scratch for this setup.
LarryG on 1/6/2013 at 18:05
I wouldn't think that's the problem. The fact that you are getting the "ObjRoomTransit" on BreathSpout (which I assume is the emitter and is contained by the AI) is GOOD. And you have the script TrigRoomObject on BreathSpout too, right?
Trader'sBank is the concrete room brush for just the building? And Baron's_Way is the concrete room brush for the just the outside? And you have a Route link from BreathSpout to Baron's_Way? And since the the AI starts in Baron's_Way, you start the BreathSpout on, because the first message it should get will be TurnOff (It is when the object enters or leaves Baron's_Way that the TurnOn/Offs are sent), and you have a CD link from the the BreathSpout to the relay trap and then back to BreathSpout to turn it on/off. Right?
So what messages does the relay trap get?
Maybe the AI needs to start in the Trader'sBank and walk out at the star of the mission, but I wouldn't think so.
Try a SIMPLER demo mission and see what happens. Just two rooms with an AI patrolling between them ....