Stratomunchkin Posted October 23, 2011 Share Posted October 23, 2011 (edited) Hey guys, in my growing efforts on my "Primm" mod I've come up with the idea of a brahmin merchant leading a brahmin to a butcher each day. I've placed the merchant and the brahmin (enabled a Follow Package) and placed the trigger. What's left to do is the script. That's where I need your help (will be credited once the mod is released). I suppose onTriggerEnter is the way to go, as is the KillActor function? The GECK wiki notes for KillActor Actor.KillActor Killer:ref DismemberLimb:int CauseOfDeath:int with three optional qualifiers (who did it, what was torn off, how was it caused). For my purposes I don't really need the optional settings. So, once the brahmin, aptly named PrimmSlaughterBrahmin, enters the trigger, it is supposed to die.scn KillTheBrahmin Begin onTriggerEnter PrimmSlaughterBrahminPrimmSlaughterBrahmin.KillActorEndThat would have been too easy. It's wrong, as evidenced by the simple fact that I can't save it. Since PrimmSlaughterBrahmin isn't a persistent reference (am I correct that it can't be because it respawns?), do I have to set a "ref" variable in the script first? What else do I have to do? Edited October 23, 2011 by Stratomunchkin Link to comment Share on other sites More sharing options...
viennacalling Posted October 23, 2011 Share Posted October 23, 2011 You do not need a ref variable in the script. Is PrimmSlaughterBrahmin the reference editor ID name or the base object? Link to comment Share on other sites More sharing options...
Stratomunchkin Posted October 23, 2011 Author Share Posted October 23, 2011 You do not need a ref variable in the script. Is PrimmSlaughterBrahmin the reference editor ID name or the base object?Base object. It needs to be the reference editor ID, right? Link to comment Share on other sites More sharing options...
viennacalling Posted October 23, 2011 Share Posted October 23, 2011 You do not need a ref variable in the script. Is PrimmSlaughterBrahmin the reference editor ID name or the base object?Base object. It needs to be the reference editor ID, right? Yes, so you have to give the copy of PrimmSlaughterBrahmin that you added to whatever world cell a unique reference editor ID name, and use that in your script. Link to comment Share on other sites More sharing options...
Stratomunchkin Posted October 23, 2011 Author Share Posted October 23, 2011 You do not need a ref variable in the script. Is PrimmSlaughterBrahmin the reference editor ID name or the base object?Base object. It needs to be the reference editor ID, right? Yes, so you have to give the copy of PrimmSlaughterBrahmin that you added to whatever world cell a unique reference editor ID name, and use that in your script.Thanks, I can save it now. I'll report once I had a chance to actually check out ingame if it works. :) Link to comment Share on other sites More sharing options...
viennacalling Posted October 23, 2011 Share Posted October 23, 2011 After I replied I thought about it some more, and this version may/should work for any copy of PrimmSlaughterBrahmin that enters the trigger: scn KillTheBrahmin ref rTriggerCreature Begin onTriggerEnter Set rTriggerCreature to GetActionRef If (rTriggerCreature.GetIsID PrimmSlaughterBrahmin == 1) rTriggerCreature.KillActor EndIf End Link to comment Share on other sites More sharing options...
Recommended Posts