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.

Party members in default clothes

Page: 1 of 1
 Terravant
02-20-2007, 9:09 PM
#1
I have a module that I load up which has only a few of the party members in it. The thing is they are wearing their default clothing in it. I want them to be wearing what they had on last. I'm guessing I have to somehow store that information from the previous module as a global variable and then have a script call it in the new module. Can someone tell me what those scripts would look like?
 stoffe
02-20-2007, 9:31 PM
#2
I have a module that I load up which has only a few of the party members in it. The thing is they are wearing their default clothing in it. I want them to be wearing what they had on last. I'm guessing I have to somehow store that information from the previous module as a global variable and then have a script call it in the new module. Can someone tell me what those scripts would look like?

Are these NPC variants of the party members, or are they in the active player party? How do you currently spawn in those NPCs? Do you spawn them as new instances from their UTC templates, or do you spawn them in from the party table? If you spawn them from the party table they should be equipped with whatever the player has given them.
 Terravant
02-20-2007, 10:37 PM
#3
I guess I'm spawning new instances from their UTC templates. Here's an example of what I did to spawn Atton:

{
object oAtton = GetObjectByTag("Atton", 0);
if ((!GetIsObjectValid(oAtton))) {
return;
}
 stoffe
02-20-2007, 11:26 PM
#4
I guess I'm spawning new instances from their UTC templates. Here's an example of what I did to spawn Atton:


Hmm, that script doesn't spawn anything, it just retrieves an object reference to an existing object in the area. Anyway, try spawning them from the party table instead, like:



void main() {
// ST: Set the x, y, z coordinates and facing angle (0-359) here.
location lSpawnLoc = Location(Vector(0.0, 0.0, 0.0), 0.0);
object oAtton = SpawnAvailableNPC(NPC_ATTON, lSpawnLoc);

// ST: do whatever should be done here...
}


This would fetch the party member from the party table, meaning they will wear anything they are equipped with, and have the correct light/darkside disposition and appearance.
 Terravant
02-21-2007, 9:42 PM
#5
Ok thanks. Before I was using some script I had stolen from the game which apparently I had no understanding of...
 Ulic and Cay
02-28-2007, 8:08 PM
#6
Hey stoffe, Terravant was actually trying to figure out the answer to this question: in the final Peragus module (107PER) Atton's .utc template is included in the .git and that is how he is spawned for his few quick lines. I would like to change this so he spawns form the party table, however, I've been unable to do so. I'm working from "a_106per_cut.ncs" which looks like this to begin with:



// Globals
int intGLOB_1 = 25;

void main() {
if (GetLoadFromSaveGame()) {
return;
}
if ((GetEnteringObject() == GetFirstPC())) {
object oAtton = GetObjectByTag("Atton", 0);
if ((!GetIsObjectValid(oAtton))) {
return;
}
else {
object oConsole = GetObjectByTag("console", 0);
vector struct2 = GetPositionFromLocation(GetLocation(oConsole));
AssignCommand(oAtton, SetFacingPoint(struct2));
SetLockOrientationInDialog(oAtton, 1);
}
if ((GetGlobalNumber("107PER_MG_FINISHED") == 0)) {
AssignCommand(oAtton, ActionStartConversation(GetFirstPC(), "106PERcut", 0, 0, 1, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0));
SetGlobalNumber("107PER_MG_LEFT", intGLOB_1);
SetGlobalNumber("107PER_MG_DEAD", 0);
SetGlobalNumber("107PER_MG_EBON", 0);
}
else {
if ((GetGlobalNumber("107PER_MG_FINISHED") == 1)) {
SetGlobalFadeOut(0.0, 0.0, 0.0, 0.0, 0.0);
SetFadeUntilScript();
SetInputClass(0);
object object8 = SpawnAvailableNPC(6, GetLocation(GetObjectByTag("WP_gspawn_kreia", 0)));
if ((!GetIsObjectValid(object8))) {
AurPostString("107PER: AWD-OEI: Kreia didn't spawn.", 5, 9, 30.0);
return;
}
object oPC = GetFirstPC();
AssignCommand(oAtton, ClearAllActions());
AssignCommand(object8, ClearAllActions());
AssignCommand(oPC, ClearAllActions());
DelayCommand(1.0, SetGlobalFadeIn(0.0, 1.0, 0.0, 0.0, 0.0));
DelayCommand(1.0, AssignCommand(oAtton, ActionStartConversation(oPC, "turend", 0, 0, 1, "", "", "", "", "", "", 0, 0xFFFFFFFF, 0xFFFFFFFF, 0)));
}
}
}
}



I just changed the beginning to read like this:



void main() {
if (GetLoadFromSaveGame()) {
return;
}
if ((GetEnteringObject() == GetFirstPC())) {
location lSpawnLoc = Location(Vector(113.317810058594, 69.4724807739258, 2.05227851867676), 0.0);
object oAtton = SpawnAvailableNPC(0, lSpawnLoc);
if ((!GetIsObjectValid(oAtton))) {
return;
}
else {
object oConsole = GetObjectByTag("console", 0);
vector struct2 = GetPositionFromLocation(GetLocation(oConsole));
AssignCommand(oAtton, SetFacingPoint(struct2));
SetLockOrientationInDialog(oAtton, 1);
}



I then deleted the .utc Atton from the .git. However, this results in no Atton being spawned at all. Can you help me out here? Sorry that Terravant's question was so confusing. He was just trying to help me out but didn't really know what I was trying to do.
 stoffe
03-01-2007, 10:53 AM
#7
Hey stoffe, Terravant was actually trying to figure out the answer to this question: in the final Peragus module (107PER) Atton's .utc template is included in the .git and that is how he is spawned for his few quick lines. I would like to change this so he spawns form the party table, however, I've been unable to do so. I'm working from "a_106per_cut.ncs" which looks like this to begin with:


Hmm, from what I can see of that script the problem should rather be that you end up with two copies of Atton instead of none at all (since it's an OnEnter script for an area that is made to be made to trigger twice). :)

Is this from the scene in the Ebon Hawk cockpit before and after the hangar turret game?

The below variant of the script should prevent multiple spawns, but as for why you get none at all that's more odd. What happens when you try it, does the scene abort entirely, or is Atton just not there? Does the script fire at all?

Have you verified that the coordinates are valid and in a part of the area that is walkable? The only way I can think of that the Spawn function would fail would be either if Atton had not joined the player's group, or if it couldn't spawn him at the specified location since a character couldn't be placed there.

I added a debug line to the script below. If the script does run, but is unable to spawn in Atton, a message should be added to the Feedback log (accessable from the Journal screen).


void main() {
if (GetLoadFromSaveGame()) {
return;
}

if ((GetEnteringObject() == GetFirstPC())) {
object oAtton = GetObjectByTag("Atton");
if ((!GetIsObjectValid(oAtton))) {
location lSpawnLoc = Location(Vector(113.31, 69.47, 2.05), 0.0);
oAtton = SpawnAvailableNPC(NPC_ATTON, lSpawnLoc);
if ((!GetIsObjectValid(oAtton)))
DelayCommand(1.0, SendMessageToPC(GetFirstPC(), "DEBUG: ATTON COULD NOT BE SPAWNED!!!"));
return;
}

object oConsole = GetObjectByTag("console");
vector vPos = GetPositionFromLocation(GetLocation(oConsole));
AssignCommand(oAtton, SetFacingPoint(vPos));
SetLockOrientationInDialog(oAtton, TRUE);

if ((GetGlobalNumber("107PER_MG_FINISHED") == FALSE)) {
AssignCommand(oAtton, ActionStartConversation(GetFirstPC(), "106PERcut", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE));
SetGlobalNumber("107PER_MG_LEFT", 25);
SetGlobalNumber("107PER_MG_DEAD", 0);
SetGlobalNumber("107PER_MG_EBON", 0);
}
else if ((GetGlobalNumber("107PER_MG_FINISHED") == TRUE)) {
SetGlobalFadeOut();
SetFadeUntilScript();
SetInputClass(0);

object oKreia = SpawnAvailableNPC(NPC_KREIA, GetLocation(GetObjectByTag("WP_gspawn_kreia")));
if ((!GetIsObjectValid(oKreia))) {
AurPostString("107PER: AWD-OEI: Kreia didn't spawn.", 5, 9, 30.0);
return;
}

object oPC = GetFirstPC();
AssignCommand(oAtton, ClearAllActions());
AssignCommand(oKreia, ClearAllActions());
AssignCommand(oPC, ClearAllActions());
DelayCommand(1.0, SetGlobalFadeIn(0.0, 1.0));
DelayCommand(1.0, AssignCommand(oAtton, ActionStartConversation(oPC, "turend", FALSE, CONVERSATION_TYPE_CINEMATIC, TRUE)));
}
}
}
 Ulic and Cay
03-01-2007, 12:26 PM
#8
You're right this is the cockpit scene played before and after the hangar turret minigame.
Apparently that part of the script isn't firing or I'm spawning Atton in completely the wrong location because I didn't get your handy debug message. The thing is I know that the rest of this script fires because on prior attempts I have messed it up so badly that the template Atton is standing up rather than sitting down or the minigame simply skips.
Here's what happens currently when I play that part. The scene plays out fine, short dialog and all, its just that my NPC Atton isn't there. It's a shot of an empty chair (if I don't delete the .utc Atton from the .git he appears there fine though regardless of the changes I've made to this script).
I could be wrong about the coordinates (this Ebon Hawk scene is a special module of Peragus, 107PER, that you never actually get to walk around in, therefore I can't use the "whereami" armband) but the x, y, and z positions I was using are where the template Atton was appearing, I grabbed them from the .git.
Thanks for pointing out that I would have spawned Atton twice though I've never worked with an OnEnter script before.
Page: 1 of 1