What I'd like to do is set a variable on the NPC and have this variable get picked up by the script.
This is an example of the current script I'm using for a persuade skill check.
#include "nw_i0_tool"
/////////////////////
int StartingConditional()
{
object oPC=GetPCSpeaker();
int iSkill=GetSkillRank(SKILL_PERSUADE, oPC);
int iRoll=d20(1);
int iTotal=iSkill+iRoll;
// Perform silent skill checks
if(!(iTotal>=15))
return FALSE;
RewardPartyXP(15, oPC, FALSE);
DelayCommand(3.0, FloatingTextStringOnCreature("You use a skill. . .", oPC));
return TRUE;
}
So where the number "15" is on if(!(iTotal>=15)) replace that with the variable name from the NPC, which would have the number stored for such checks. An example -
BLUFF int 15
PERSUADE int 17
INTIMIDATE int 12
So this is what I came up with but I receive an error - COMPARISON TEST HAS INVALID OPERANDS on the following line -
if(!(iTotal>=sPersuade))
#include "nw_i0_tool"
/////////////////////
int StartingConditional()
{
object oPC=GetPCSpeaker();
string sBluff = GetLocalString(OBJECT_SELF, "skillBluff");
string sPersuade = GetLocalString(OBJECT_SELF, "skillPersuade");
string sIntimidate = GetLocalString(OBJECT_SELF, "skillIntimidate");
int iSkill=GetSkillRank(SKILL_PERSUADE, oPC);
int iRoll=d20(1);
int iTotal=iSkill+iRoll;
// Perform silent skill checks
if(!(iTotal>=sPersuade))
return FALSE;
RewardPartyXP(15, oPC, FALSE);
DelayCommand(3.0, FloatingTextStringOnCreature("You use a skill. . .", oPC));
return TRUE;
}
I'm guessing that I have to get the INT rather than the STRING?
So ...
string sPersuade = GetLocalString(OBJECT_SELF, "skillPersuade");
would become ...
int iPersuade = GetLocalInt(OBJECT_SELF, "skillPersuade");
and change ...
if(!(iTotal>=sPersuade))
to ...
if(!(iTotal>=iPersuade))
??
FP!
Modifié par Fester Pot, 17 juin 2011 - 01:35 .





Retour en haut







