Is there a better way?
tgx
Member Posts: 40
So, let's say I have these kinds of scripts:
has_con_10
has_con_12
has_con_14
has_con_16
I call them mostly in conversations, and each of them is as basic as you can get, returning true or false.
Is there a way to pass parameters to scripts? Or are we limited to this kind of arrangement?
has_con_10
has_con_12
has_con_14
has_con_16
I call them mostly in conversations, and each of them is as basic as you can get, returning true or false.
Is there a way to pass parameters to scripts? Or are we limited to this kind of arrangement?
0
Comments
int StartingConditional()
{
object oPC=GetPCSpeaker();
int iDC = GetLocalInt(OBJECT_SELF, "iCon");
int iPCcon = GetAbilityScore(oPC, ABILITY_CONSTITUTION, TRUE);
if(!(iPCcon>=iDC))
return FALSE;
return TRUE;
}
Then you can give each unique npc that you want the pc to run a check against its own value but ofc you would still need multiple scripts for other abilityes like strength, dexterity etc.
Another way is just to get the constitution of the NPC with OBJECT_SELF during a conversation and avoid creating variables.
int iDC = GetAbilityScore(OBJECT_SELF, ABILITY_CONSTITUTION, TRUE);
It is all in the toolset just open the script editor and look for the command and it will give you information on how to use it. Voila!
// Get the ability score of type nAbility for a creature (otherwise 0)
// - oCreature: the creature whose ability score we wish to find out
// - nAbilityType: ABILITY_*
// - nBaseAbilityScore: if set to true will return the base ability score without
// bonuses (e.g. ability bonuses granted from equipped items).
// Return value on error: 0