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.

Help with a script that I have no idea on how to make

Page: 1 of 1
 Dan Loto
10-22-2008, 9:46 PM
#1
Greetings.

I need a dialog script like the one on Tatooine that the Czerka lady uses to give you the appropriate amount of credits depending on how many gaffi sticks you bring her, but instead of gaffi sticks I want it to be Gamorrean axes.

Their resref is g_w_waraxe001 and their tag is G_W_WARAXE001. The reward per axe would be 50 credits. I've already made a working conditional to check if you have at least one axe in your inventory, but I have no clue on how to do the rest.

This is for KotOR 1.

Thank you for your time :)
 Canderis
10-22-2008, 10:57 PM
#2
you could do a thing like making a script that makes you be able to say how meny axes you have then use the add money script to give yourself the appropiat ammount. Tell me if im not clear.
 Dan Loto
10-22-2008, 11:01 PM
#3
That's basically what I need but I have no idea how to make it. :(

EDIT: I got it to work with the following code...but is there a shorter way to do it? I guess it doesn't really matter though.

void main() {
object oPC = GetFirstPC();
object oItem = GetItemPossessedBy(GetFirstPC(), "G_W_WARAXE001");


if (GetNumStackedItems(oItem) == 1) GiveGoldToCreature(GetFirstPC(), 100);
if (GetNumStackedItems(oItem) == 2) GiveGoldToCreature(GetFirstPC(), 200);
if (GetNumStackedItems(oItem) == 3) GiveGoldToCreature(GetFirstPC(), 300);
if (GetNumStackedItems(oItem) == 4) GiveGoldToCreature(GetFirstPC(), 400);
if (GetNumStackedItems(oItem) == 5) GiveGoldToCreature(GetFirstPC(), 500);
if (GetNumStackedItems(oItem) == 6) GiveGoldToCreature(GetFirstPC(), 600);
if (GetNumStackedItems(oItem) == 7) GiveGoldToCreature(GetFirstPC(), 700);
if (GetNumStackedItems(oItem) == 8) GiveGoldToCreature(GetFirstPC(), 800);
if (GetNumStackedItems(oItem) == 9) GiveGoldToCreature(GetFirstPC(), 900);
if (GetNumStackedItems(oItem) == 10) GiveGoldToCreature(GetFirstPC(), 1000);
if (GetNumStackedItems(oItem) == 11) GiveGoldToCreature(GetFirstPC(), 1100);
if (GetNumStackedItems(oItem) == 12) GiveGoldToCreature(GetFirstPC(), 1200);
if (GetNumStackedItems(oItem) == 13) GiveGoldToCreature(GetFirstPC(), 1300);
if (GetNumStackedItems(oItem) == 14) GiveGoldToCreature(GetFirstPC(), 1400);
if (GetNumStackedItems(oItem) == 15) GiveGoldToCreature(GetFirstPC(), 1500);
if (GetNumStackedItems(oItem) == 16) GiveGoldToCreature(GetFirstPC(), 1600);
if (GetNumStackedItems(oItem) == 17) GiveGoldToCreature(GetFirstPC(), 1700);
if (GetNumStackedItems(oItem) == 18) GiveGoldToCreature(GetFirstPC(), 1800);
if (GetNumStackedItems(oItem) == 19) GiveGoldToCreature(GetFirstPC(), 1900);
if (GetNumStackedItems(oItem) == 20) GiveGoldToCreature(GetFirstPC(), 2000);
if (GetNumStackedItems(oItem) == 21) GiveGoldToCreature(GetFirstPC(), 2100);
if (GetNumStackedItems(oItem) == 22) GiveGoldToCreature(GetFirstPC(), 2200);
if (GetNumStackedItems(oItem) == 23) GiveGoldToCreature(GetFirstPC(), 2300);
if (GetNumStackedItems(oItem) == 24) GiveGoldToCreature(GetFirstPC(), 2400);
if (GetNumStackedItems(oItem) == 25) GiveGoldToCreature(GetFirstPC(), 2500);
if (GetNumStackedItems(oItem) == 26) GiveGoldToCreature(GetFirstPC(), 2600);
if (GetNumStackedItems(oItem) == 27) GiveGoldToCreature(GetFirstPC(), 2700);
if (GetNumStackedItems(oItem) == 28) GiveGoldToCreature(GetFirstPC(), 2800);
if (GetNumStackedItems(oItem) == 29) GiveGoldToCreature(GetFirstPC(), 2900);
if (GetNumStackedItems(oItem) == 30) GiveGoldToCreature(GetFirstPC(), 3000);
if (GetNumStackedItems(oItem) == 31) GiveGoldToCreature(GetFirstPC(), 3100);
if (GetNumStackedItems(oItem) == 32) GiveGoldToCreature(GetFirstPC(), 3200);
if (GetNumStackedItems(oItem) == 33) GiveGoldToCreature(GetFirstPC(), 3300);
if (GetNumStackedItems(oItem) == 34) GiveGoldToCreature(GetFirstPC(), 3400);
if (GetNumStackedItems(oItem) == 35) GiveGoldToCreature(GetFirstPC(), 3500);
if (GetNumStackedItems(oItem) == 36) GiveGoldToCreature(GetFirstPC(), 3600);
if (GetNumStackedItems(oItem) == 37) GiveGoldToCreature(GetFirstPC(), 3700);
if (GetNumStackedItems(oItem) == 38) GiveGoldToCreature(GetFirstPC(), 3800);
if (GetNumStackedItems(oItem) == 39) GiveGoldToCreature(GetFirstPC(), 3900);
if (GetNumStackedItems(oItem) == 40) GiveGoldToCreature(GetFirstPC(), 4000);
if (GetNumStackedItems(oItem) == 41) GiveGoldToCreature(GetFirstPC(), 4100);
if (GetNumStackedItems(oItem) == 42) GiveGoldToCreature(GetFirstPC(), 4200);
if (GetNumStackedItems(oItem) == 43) GiveGoldToCreature(GetFirstPC(), 4300);
if (GetNumStackedItems(oItem) == 44) GiveGoldToCreature(GetFirstPC(), 4400);
if (GetNumStackedItems(oItem) == 45) GiveGoldToCreature(GetFirstPC(), 4500);
ActionTakeItem(oItem,oPC);
 Istorian
10-24-2008, 4:27 AM
#4
You could try the "while" statement. Like:

while(GetNumStackedItems(oItem) > 1) {
GiveGoldToCreature(GetFirstPC(), 100);
ActionTakeItem(oItem,oPC);
}

or you could adjust it the way you like it...it's just a simple idea...

|I|
Page: 1 of 1