TimBob12 Posted June 20, 2010 Share Posted June 20, 2010 Hi there, I am quite new here and to the modding scene and am working on my first proper mod. I have a script that spawns a rodian in the Tatooine Cantina. I have set up a dialog and an option to make him hostile. When I kill him he dies. But when I leave the cantina and re-enter his remains are still there and there is a new rodian. Is there a way to fix this? Here is my on_enter script void main() { object oEntering = GetEnteringObject(); object oPC=GetFirstPC(); if (GetIsPC(oEntering)) { //check if the object is already there to avoid multiple objects if (!GetIsObjectValid(GetObjectByTag("rodian"))) { //Note that the script uses OBJECT_TYPE_CREATURE instead of OBJECT_TYPE_PLACEABLE - that's the only difference with the container: CreateObject(OBJECT_TYPE_CREATURE, "rodian", Location(Vector(6.32,-6.96,-0.18), 180.0)); } } ExecuteScript("k_ptat17af_enter_old", OBJECT_SELF); } Here is my hostile script void main() { object oNPC=GetObjectByTag("rodian"); ChangeToStandardFaction(oNPC, 1); } Thanks in advance. TimBob12 Link to comment Share on other sites More sharing options...
LDR Posted June 20, 2010 Share Posted June 20, 2010 Hello, and welcome to the forums! Now, about your problem, I don't think it's a problem with the scripts. Open up the rodian's utc file in kotor tool. Is it checked as 'Permanent Death' (In 'Advanced' part of the utc file)? If so, then he'll keep respawning no matter how many times he is killed. Just uncheck it. Hope this helps! Link to comment Share on other sites More sharing options...
TimBob12 Posted June 20, 2010 Author Share Posted June 20, 2010 I tried that but he still respawns. I also unchecked the box saying No Interrupt but I can't click through the conversation. Dunno why it's happening. Thanks anyway. Link to comment Share on other sites More sharing options...
LDR Posted June 20, 2010 Share Posted June 20, 2010 If it isn't checked as 'Permanent Death' , then I think it might have something to do with the on enter script, but I might be wrong. Link to comment Share on other sites More sharing options...
newbiemodder Posted June 20, 2010 Share Posted June 20, 2010 The problem is that you have it on the OnEnter so everytime you enter it will spawn the npc, etc...you need to establish a local so it fires only once...try this void main() { // ST: Check if it's the player entering the trigger, and that it hasn't already fired if (!GetLocalBoolean(OBJECT_SELF, 40) && (GetEnteringObject() == GetFirstPC())) { // ST: Make sure the trigger only fires once. SetLocalBoolean(OBJECT_SELF, 40, TRUE); CreateObject(OBJECT_TYPE_CREATURE, "rodian", Location(Vector(6.32,-6.96,-0.18), 180.0)); } } ExecuteScript("k_ptat17af_enter_old", OBJECT_SELF); } see how this works. Link to comment Share on other sites More sharing options...
TimBob12 Posted June 21, 2010 Author Share Posted June 21, 2010 Hey thanks a lot, it worked. Thanks again. TimBob12 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.