Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

More script trouble - tsl

Page: 1 of 1
 newbiemodder
06-01-2010, 7:51 PM
#1
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.
 DarthStoney
06-01-2010, 9:40 PM
#2
Try changing this line ActionDoCommand(DestroyObject(OBJECT_SELF)); to ActionDoCommand(DestroyObject(GetObjectByTag("Ex-partymember tag")));
and see if that works.
 newbiemodder
06-02-2010, 9:25 AM
#3
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?
 DarthStoney
06-02-2010, 11:44 AM
#4
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();

}
}
 newbiemodder
06-02-2010, 12:19 PM
#5
I'll give it a try.......

EDIT: Didn't work...the npc didn't move, nor did the part selection gui change....
 DarthStoney
06-02-2010, 1:54 PM
#6
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.
 newbiemodder
06-02-2010, 3:24 PM
#7
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.
Page: 1 of 1