Hi Im pretty new to scripting and was wundering if there is a way to save a PC's ability scores, and appearance when they enter the module so that i can call upon these variables in my other scripts, they have to be somehow stored by character so that it dosnt get mixed up with other players characters. any help will be greatly appreciated thanks.
Noob scripting
Débuté par
zethrenx99
, déc. 22 2012 09:09
#1
Posté 22 décembre 2012 - 09:09
#2
Posté 22 décembre 2012 - 09:35
The functions would be
GetAbilityScore
GetAppearanceType
Both of these functions will return integers and they can be saved as local variables
GetAbilityScore
GetAppearanceType
Both of these functions will return integers and they can be saved as local variables
#3
Posté 27 décembre 2012 - 08:39
// name the script
/*
Description:
This will grab the ability scores and appearence of an object that enters
the trigger it's set on (may also work OnClientEnter, but not 100% on that)
Stores as LocalInt on object with the following names:
nSTR, nDEX, nCON, nINT, nWIS, nCHA, nAppearance
Use GetLocalInt(oPC,"nSTR") in scripts to grab the strenght, etc.
*/
//Darin LaSota on 12/27/2012
//your name here
void main()
{
object oPC = GetEnteringObject();
if(GetLocalInt(oPC,"nSTR")==0) //this makes sure we only run once, if you don't want this, kill this loop
{
//replace FALSE with TRUE if you don't want the modified version
int nSTR = GetAbilityScore(oPC, ABILITY_STRENGTH,FALSE) ;
int nDEX = GetAbilityScore(oPC, ABILITY_DEXTERITY, FALSE) ;
int nCON = GetAbilityScore(oPC, ABILITY_CONSTITUTION, FALSE) ;
int nINT = GetAbilityScore(oPC, ABILITY_INTELLIGENCE, FALSE) ;
int nWIS = GetAbilityScore(oPC, ABILITY_STRENGTH, FALSE) ;
int nCHA= GetAbilityScore(oPC, ABILITY_CHARISMA, FALSE) ;
int nAppearance = GetAppearanceType(oPC);
//now to save them
SetLocalInt(oPC,"nSTR",nSTR);
SetLocalInt(oPC,"nDEX",nDEX);
SetLocalInt(oPC,"nCON",nCON);
SetLocalInt(oPC,"nINT",nINT);
SetLocalInt(oPC,"nWIS",nWIS);
SetLocalInt(oPC,"nCHA",nCHA);
SetLocalInt(oPC,"nSTR",nSTR);
SetLocalInt(oPC,"nAppearance",nAppearance);
}
}
/*
Description:
This will grab the ability scores and appearence of an object that enters
the trigger it's set on (may also work OnClientEnter, but not 100% on that)
Stores as LocalInt on object with the following names:
nSTR, nDEX, nCON, nINT, nWIS, nCHA, nAppearance
Use GetLocalInt(oPC,"nSTR") in scripts to grab the strenght, etc.
*/
//Darin LaSota on 12/27/2012
//your name here
void main()
{
object oPC = GetEnteringObject();
if(GetLocalInt(oPC,"nSTR")==0) //this makes sure we only run once, if you don't want this, kill this loop
{
//replace FALSE with TRUE if you don't want the modified version
int nSTR = GetAbilityScore(oPC, ABILITY_STRENGTH,FALSE) ;
int nDEX = GetAbilityScore(oPC, ABILITY_DEXTERITY, FALSE) ;
int nCON = GetAbilityScore(oPC, ABILITY_CONSTITUTION, FALSE) ;
int nINT = GetAbilityScore(oPC, ABILITY_INTELLIGENCE, FALSE) ;
int nWIS = GetAbilityScore(oPC, ABILITY_STRENGTH, FALSE) ;
int nCHA= GetAbilityScore(oPC, ABILITY_CHARISMA, FALSE) ;
int nAppearance = GetAppearanceType(oPC);
//now to save them
SetLocalInt(oPC,"nSTR",nSTR);
SetLocalInt(oPC,"nDEX",nDEX);
SetLocalInt(oPC,"nCON",nCON);
SetLocalInt(oPC,"nINT",nINT);
SetLocalInt(oPC,"nWIS",nWIS);
SetLocalInt(oPC,"nCHA",nCHA);
SetLocalInt(oPC,"nSTR",nSTR);
SetLocalInt(oPC,"nAppearance",nAppearance);
}
}





Retour en haut






