newbiemodder Posted June 1, 2010 Share Posted June 1, 2010 I have this script: void ST_GoAway(float x, float y, int bRunAway=TRUE); void main() { if (!GetLocalBoolean(OBJECT_SELF, 38) && (GetEnteringObject() == GetFirstPC())) { SetLocalBoolean(OBJECT_SELF, 38, TRUE); DestroyObject(GetObjectByTag("plc_elevbtn")); DestroyObject(GetObjectByTag("Jawa01")); RemoveAvailableNPC(6); AddAvailableNPCByTemplate(6, "p_kreia"); SetNPCSelectability(6, FALSE); AssignCommand(GetObjectByTag("Ex-partymember tag"), ST_GoAway(25.00, 60.47)); } } void ST_GoAway(float x, float y, int bRunAway=TRUE) { location lExit=Location(Vector(x, y, 0.0), 0.0); SetCommandable(TRUE); ClearAllActions(); ActionForceMoveToLocation(lExit, bRunAway); ActionDoCommand(DestroyObject(OBJECT_SELF)); SetCommandable(FALSE); } What I want to happen is for my temporary party member(replacing kreia) to leave the party, run to a point, and fadeaway, and return kreia to the party selection gui. The run and disappear part of the script I got from the tutorials/scripting section. Everything seems to work fine, the ex-party member runs away, kreia appears again on the party selection gui, but the ex-party member does not fade-away as he is supposed to. Can't figure out why. Link to comment Share on other sites More sharing options...
DarthStoney Posted June 2, 2010 Share Posted June 2, 2010 Try changing this line ActionDoCommand(DestroyObject(OBJECT_SELF)); to ActionDoCommand(DestroyObject(GetObjectByTag("Ex-partymember tag"))); and see if that works. Link to comment Share on other sites More sharing options...
newbiemodder Posted June 2, 2010 Author Share Posted June 2, 2010 DS, it didn't work. Is it the logic of the script or is it because the npc was a party member and can't be destroyed. I don't know. What about the RemoveFromParty() command? Do I need to add that in the party section of the script? Link to comment Share on other sites More sharing options...
DarthStoney Posted June 2, 2010 Share Posted June 2, 2010 Try this ,you may want to add a "DelayCommand" to sub1(); void sub1(); void sub1() { object oTemp = GetObjectByTag("Ex-partymember tag"); float x=25.00f; float y=60.47f; float z=0.0f; int bRun=TRUE; vector myvec = Vector(x,y,z); location myexit = Location(myvec,0.0f); ClearAllActions(); ActionDoCommand(SetCommandable(TRUE,oTemp)); AssignCommand (oTemp,ActionForceMoveToLocation(myexit,bRun)); AssignCommand (oTemp,ActionDoCommand(DestroyObject(oTemp))); ActionDoCommand(SetCommandable(FALSE,oTemp)); } void main() { if (!GetLocalBoolean(OBJECT_SELF, 38) && (GetEnteringObject() == GetFirstPC())) { SetLocalBoolean(OBJECT_SELF, 38, TRUE); DestroyObject(GetObjectByTag("plc_elevbtn")); DestroyObject(GetObjectByTag("Jawa01")); RemoveAvailableNPC(6); AddAvailableNPCByTemplate(6, "p_kreia"); SetNPCSelectability(6, FALSE); sub1(); } } Link to comment Share on other sites More sharing options...
newbiemodder Posted June 2, 2010 Author Share Posted June 2, 2010 I'll give it a try....... EDIT: Didn't work...the npc didn't move, nor did the part selection gui change.... Link to comment Share on other sites More sharing options...
DarthStoney Posted June 2, 2010 Share Posted June 2, 2010 you did change "Ex-partymember tag" to match the npc tag correct? also did you try DelayCommand(0.5, sub1()); Are you running this script off of a dialog? if you are it may be better to make it two seprate scripts. Link to comment Share on other sites More sharing options...
newbiemodder Posted June 2, 2010 Author Share Posted June 2, 2010 I changed the tag. I'll try the delay. Yes, it is coming out of a dialog. Maybe I'll try to break it up then EDIT: got it to work. Broke it up to three scripts just to be sure. Used the generic, a_leaveparty, to remove party member, then script to reinstate kreia, and then run script from tutorials. Thanks for help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.