gasti89 Posted June 15, 2012 Share Posted June 15, 2012 It seems like dead bodies doesn't count as "akActionRef". I have a trigger wich should detect when you throw a dead body (from a quest alias) inside it. Setting his reference as akActionRef doesn't work. If i use this Actor myActor = myAlias.GetActorRef() if akActionRef == myActor.IsDead() the trigger works ONLY if both you and the dead body fall into it :O Can someone clarify this? :P Link to comment Share on other sites More sharing options...
GomuGomu64 Posted June 15, 2012 Share Posted June 15, 2012 Have ya tried setting the properties in the script right? Have you made sure your propety is an Actor property? Or maybe an ObjectReference property? Link to comment Share on other sites More sharing options...
gasti89 Posted June 15, 2012 Author Share Posted June 15, 2012 (edited) I've tried with the actor we talk about set as ReferenceAlias property, ObjectReference property and Actor Property. Nothing works, except if i put the script part above, wich means if i have it not set as Actor i have to call the "Actor myActor = myAlias/myReference.GetActorRef()" It just seems that when an actor dies he isn't treated as an ObjectReference anymore. Edited June 15, 2012 by gasti89 Link to comment Share on other sites More sharing options...
gasti89 Posted June 15, 2012 Author Share Posted June 15, 2012 Just to make things clear, the script compiles. It's just that it doesn't work ingame ;) Do you think that having the trigger look for an ActorBase will work? Even if i don't know how to make the trigger look for an actorbase instead of a ObjectReference Link to comment Share on other sites More sharing options...
GomuGomu64 Posted June 15, 2012 Share Posted June 15, 2012 Actorbase is the base object of the actor (The thing you see in the Object Window is the ActorBase, what you see in the render window is an Actor Reference). What I am seeing, as that it is triggered by the player somehow, but not the dead NPC. Perhaps you could try looking at one of the trap scripts to get it working on any NPC? Link to comment Share on other sites More sharing options...
gasti89 Posted June 15, 2012 Author Share Posted June 15, 2012 I know how triggers work. The fact is that a normal trigger script works on a alive NPC, but the trigger simply doesn't work if the same NPC enters it while dead (so if you throw his corpse in it). I'm thinking that when a NPC dies he stops being an ObjectReference or an Actor. That's why i'm thought about using ActorBase as the Trigger. Link to comment Share on other sites More sharing options...
gasti89 Posted June 16, 2012 Author Share Posted June 16, 2012 It doesn't work even using ActorBase. Putting a condition IsDead() == 1 makes the trigger not work if the actor is alive, but it doesn't work if it's dead too -.- Link to comment Share on other sites More sharing options...
gasti89 Posted June 16, 2012 Author Share Posted June 16, 2012 Ok, i also tried GetTriggerObjectCount(), just to know if the trigger actually knows that the corpse is there...nothing! When i enter the trigger with the corpse already inside, the message returns only 1 object (me). So why the hell a trigger box doesn't know that it has a dead bosy inside? Link to comment Share on other sites More sharing options...
steve40 Posted June 18, 2012 Share Posted June 18, 2012 (edited) It seems like dead bodies doesn't count as "akActionRef". I have a trigger wich should detect when you throw a dead body (from a quest alias) inside it. Setting his reference as akActionRef doesn't work. If i use this Actor myActor = myAlias.GetActorRef() if akActionRef == myActor.IsDead() the trigger works ONLY if both you and the dead body fall into it :O Can someone clarify this? :P Gasti, akActionRef would normally be the actor reference entering the trigger [Event OnTriggerEnter(ObjectReference akActionRef)] However, "myActor.IsDead()" simply queries whether the actor is dead or not by returning either TRUE or FALSE. So comparing akActionRef to TRUE or FALSE (like you did above ^^) does not make sense. You want to try something like this: Event OnTriggerEnter(ObjectReference akActionRef) Actor myActor = myAlias.GetActorRef() If (akActionRef as Actor).IsDead() && akActionRef == myActor Debug.MessageBox("My dead actor entered the trigger.") ElseIf (akActionRef as Actor).IsDead() Debug.MessageBox("A dead actor entered the trigger, but he was not my alias.") Else Debug.MessageBox("A living actor entered the trigger.") EndIf EndEvent Edit: D'oh :facepalm: Edited June 18, 2012 by steve40 Link to comment Share on other sites More sharing options...
gasti89 Posted June 18, 2012 Author Share Posted June 18, 2012 (edited) That script won't compile cause IsDead() is an Actor Function. I already tried with if (akActionRef as Actor).IsDead() it compiles but simply doesn't work. Another thing i tried is setting a OnTriggerLeave event. I've put the actor inside the trigger and set the script to pop a message on leave. The weird thing is that as soon as i kill the Actor, the script fires like he was leaving the trigger! Edited June 18, 2012 by gasti89 Link to comment Share on other sites More sharing options...
Recommended Posts