PDA

View Full Version : Scripts for giving/taking credits and skill detection


Xavier2
11-23-2004, 03:36 PM
I was able to find in KT scripts.bif the scripts to take credits from you but none to give credits. Which ones are those? Or at least their code?

Also i have found the scripts that detect the charisma level, but non to detect skill points. Like computer use.

Anyone knows the code for that?

tk102
11-23-2004, 03:42 PM
The GiveGoldToCreature function is what you're looking for...

void main() {
//easiest 100 credits you'll ever see...
GiveGoldToCreature(GetFirstPC(),100);
}

And the GetSkillRank

int StartingConditional() {
//TRUE if main pc has more than 5 ranks in computer use
return (GetSkillRank(SKILL_COMPUTER_USE,GetFirstPC())>5);
}

Other defined skill constants (as you can see in the nwscript.nss file)

int SKILL_COMPUTER_USE = 0;
int SKILL_DEMOLITIONS = 1;
int SKILL_STEALTH = 2;
int SKILL_AWARENESS = 3;
int SKILL_PERSUADE = 4;
int SKILL_REPAIR = 5;
int SKILL_SECURITY = 6;
int SKILL_TREAT_INJURY = 7;
int SKILL_MAX_SKILLS = 8;

Xavier2
11-23-2004, 04:48 PM
Originally posted by tk102
The GiveGoldToCreature function is what you're looking for...

void main() {
//easiest 100 credits you'll ever see...
GiveGoldToCreature(GetFirstPC(),100);
}
Thanks tk102. But i actually need the code to make the creature give the gold to you.;) Looking at your code is it safe to assume it should be the same but with a "GetGoldsomething" function? Then what is the correct spelling for his?

Darth333
11-23-2004, 04:58 PM
Originally posted by Xavier2
Thanks tk102. But i actually need the code to make the creature give the gold to you.;) Looking at your code is it safe to assume it should be the same but with a "GetGoldsomething" function? Then what is the correct spelling for his?

err..the script that tk102 gave you will give credits to your PC (after all it says "GiveGoldTo" ;) )

If you want to take credits from the PC it would be:

void main() {
object oPC = GetPCSpeaker();
//set to TRUE if you don't want the "gold" to go to the inventory
//of the npc taking the gold from the PC
TakeGoldFromCreature(100, oPC, FALSE);
}

Xavier2
11-23-2004, 05:21 PM
Originally posted by Darth333
err..the script that tk102 gave you will give credits to your PC (after all it says "GiveGoldTo" ;) )

If you want to take credits from the PC it would be:

void main() {
object oPC = GetPCSpeaker();
//set to TRUE if you don't want the "gold" to go to the inventory
//of the npc taking the gold from the PC
TakeGoldFromCreature(100, oPC, FALSE);
}

:headbump Absolutelly right. It is pretty clear in the sub-text. I guess that's what few hours of sleep do to a man:nutz3:

Thanks Darth333;)