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.

Spawning items based on appearence number?

Page: 1 of 1
 SithRevan
11-28-2006, 11:10 PM
#1
Hey guys I was wondering if it would be possible to spawn a container with custom items based on a characters appearence number? If that is possible I would greatly appreciate your guys help, Thanks.
 m16965
11-29-2006, 4:13 AM
#2
hey sithrevan!

you have to do it through scripting in dialouge.
i think you can though i am not sure how.
 EnderWiggin
11-29-2006, 6:18 AM
#3
It must be possible... but I don't know what the function is to check appearance. All you have to do is check appearance, and then write a Spawn function if that appearance returns true.

Simple in theory...

Maybe D3 or Stoffe or someone will see this and help you out.

_EW_
 Lit Ridl
11-29-2006, 6:47 AM
#4
This is very possible.
There are two ways to do this, but both of them are scripting.
The first one:
void main ()
{
object oObject = GetFirstPC(); //This will return the player, you may replace it with any other objects
int nAppearance = GetAppearanceType(oObject);
int nStack = 1;
string sResRef;
if (nAppearance == 2) //2 is row number from appearance.2da, here it is T3-M4
sResRef = "ResRef_OfYourItem1";
else if (nAppearance == 4) //2 is row number from appearance.2da, here it is Bastila's one
sResRef = "ResRef_OfYourItem2";
else if (nAppearance == 24) //2 is row number from appearance.2da, here it is Duros
sResRef = "ResRef_OfYourItem3";
CreateItemOnObject(sResRef, oObject, nStack);
}
Here you just have to replace all the ResRef_OfYourItem* with the real Template ResRef of your item/items.
If you want to get some item in all other cases, mean that you haven't got appearance of Bastila/Duros/T3-M4 you will get another item.
Here is this code:
void main ()
{
object oObject = GetFirstPC(); //This will return the player, you may replace it with any other objects
int nAppearance = GetAppearanceType(oObject);
int nStack = 1;
string sResRef;
if (nAppearance == 2) //2 is row number from appearance.2da, here it is T3-M4
sResRef = "ResRef_OfYourItem1";
else if (nAppearance == 4) //2 is row number from appearance.2da, here it is Bastila's one
sResRef = "ResRef_OfYourItem2";
else if (nAppearance == 24) //2 is row number from appearance.2da, here it is Duros
sResRef = "ResRef_OfYourItem3";
else // Here is this in all other cases block...
sResRef = "ResRef_OfOtherItem"
CreateItemOnObject(sResRef, oObject, nStack);
}
Replace ResRef_OfOtherItem with item that you want to get in all other cases.
Say me, if you want to get different amount of items for different appearance.
 SithRevan
11-29-2006, 11:57 AM
#5
That is exactly what I wanted Lit Ridl, thank you very much.:thumbsup:

Edit: Hey guys I was just wondering something, can this script be used to spawn a placeable like a container in a specific spot? I still want to do it by the appearence number but I want to have it spawn a container with the item in it. IF you guys could help me agian I would really appreciate it!:D
Page: 1 of 1