Jump to content

Home

More script trouble - tsl


Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...