Jump to content

Home

Two scripts


Vox Kalam

Recommended Posts

Looking for scripts to change the appearance of an NPC in mid conversation, and one to go to the Party Selection Screen after a conversation ends.

 

Change appearance:

 

// 850
// ChangeObjectAppearance
// oObjectToChange = Object to change appearance of
// nAppearance = appearance to change to (from appearance.2da)
void ChangeObjectAppearance( object oObjectToChange, int nAppearance );

 

Party Select:

 

void main()
{
  DelayCommand(0.5,ShowPartySelectionGUI());
}

 

The first script only works in K2.

Link to comment
Share on other sites

void main()

{

// 850

// ChangeObjectAppearance

// oObjectToChange = "Menik"

// nAppearance = appearance to change to ("Creature_Rakghoul")

}

Didn't really work...

 

That script doesn't contain any code inside the main function since all the lines are commented out, so it won't do anything. :)

 

Also, you'll need to get the creature object you want to change the appearance of, and you set what appearance to change to by specifying a line number in appearance.2da. Like:

 

void main() {
   ChangeObjectAppearance(GetObjectByTag("Menik"), 79);
}

Link to comment
Share on other sites

Like this?

 

No, like I posted above. :) Your script still has all lines commented out, thus it does nothing. Lines starting with // are code comments, which are only there to make the script more readable by people. Everything following // on a line gets stripped out when the script is compiled.

Link to comment
Share on other sites

void main()

{

 

object oNPC=GetObjectByTag("p_kreia");

AssignCommand (oNPC,ActionDoCommand(DestroyObject(oNPC)));

 

ActionDoCommand(SetCommandable(FALSE,oNPC));

 

DelayCommand(1.0,ShowPartySelectionGUI("", 1, 0xFFFFFFFF, 0));

}

And this? (sorry)

Link to comment
Share on other sites

And this? (sorry)

 

What are you trying to do? If I interpret it correctly you want to remove Kreia from the area and show the party selection screen, where Bao-Dur is a required party member and the player can choose the second one?

 

If so, this should work better:

void main() {
   // Remove "Kreia" from party and from the area.
   RemoveNPCFromPartyToBase(NPC_KREIA);

   // Show party selection screen, where BaoDur is a required party member.
   DelayCommand(1.0, ShowPartySelectionGUI("", NPC_BAO_DUR));
}

 

Unless you have made a custom "kreia" the tag you used was wrong, it should be kreia instead of p_kreia. If you want to remove a party member from the area you should use RemoveNPCFromPartyToBase() instead of

Destroyobject(). (If she isn't a party member though you'll need to use Destroyobject().) You don't need to assign either function though since neither is an action, you can just run them directly.

 

The line...

ActionDoCommand(SetCommandable(FALSE,oNPC));

...didn't do anything meaningful since you are trying to make an object you have just destroyed non-commandable. Also, depending on what runs the script using ActionDoCommand() might not work. It will work for things that have an action queue (characters, placeables etc) but will not work if it's the area running the script.

 

It's easier to tell what might be wrong with a script if you tell what it is intended to do, and in what situation it's used (dialog, event script, force power etc). :)

Link to comment
Share on other sites

Whoops. I'm trying to make a non-party member Kreia disappear and the party selection screen appear right after, in which ATTON can NOT be selected.

 

This will hopefully work. :)

 

void main() {
   // Remove "Kreia" NPC from the area
   DestroyObject(GetObjectByTag("Kreia"));

   // Disable Atton as a player party choice
   SetNPCSelectability(NPC_ATTON, FALSE);

   // Show party selection screen
   NoClicksFor(1.0);
   DelayCommand(1.0, ShowPartySelectionGUI());
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...