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.

Scripts for giving/taking credits and skill detection

Page: 1 of 1
 Xavier2
11-23-2004, 2:36 PM
#1
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, 2:42 PM
#2
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, 3:48 PM
#3
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, 3:58 PM
#4
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, 4:21 PM
#5
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;)
Page: 1 of 1