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.

Script need help

Page: 1 of 1
 sekan
06-14-2007, 9:10 AM
#1
I need help with some scripting on k1. I'm very new on kotor modding and my english is not very good so i dont understand so mutch.


void main()
{
AdjustAlignment( GetFirstPC(),ALIGNMENT_LIGHT_SIDE, 2);
object oItem=CreateItemOnObject ( "tat18_dragonprl", GetFirstPC());
TakeGoldFromCreature( GetFirstPC(),2000);
}


I know there is something wrong with TakeGoldFromCreature but i dont know what's wrong.
 Master Zionosis
06-14-2007, 9:32 AM
#2
Give this a go, its a little rough but it does the job:

void main()
{
object me = GetFirstPC();
AdjustAlignment( GetFirstPC(),ALIGNMENT_LIGHT_SIDE, 2);
object oItem=CreateItemOnObject ( "tat18_dragonprl", GetFirstPC());
TakeGoldFromCreature(2000, me, TRUE);
}

Post if you have more problems :)
 stoffe
06-14-2007, 9:50 AM
#3
I know there is something wrong with TakeGoldFromCreature but i dont know what's wrong.

The problem is the order of the parameters you specified to it. The TakeGoldFromCreature() function takes two required parameters and one optional parameter. First you specify the amount of credits to take, second you specify the object to take the credits from. The third optional parameter lets you decide if the credits is added to the inventory of the object running the script (if it has one), or if it's just destroyed. If the parameter is left out it defaults to FALSE, i.e. the credits will be added to the inventory of the script owner.

The function prototypes for all the standard NWScript functions are listed inside the nwscript.nss file (found inside scripts.bif, you can look in this file to determine what parameters you need to specify for a particular function.
 sekan
06-14-2007, 10:45 AM
#4
Thanks it works now
Page: 1 of 1