Hi all. Is it possible to copy the gc_check_stats and modify it to give a result with params like "4" "<14". As it is now returns true if the value is equal or exceeds the second number, which is the stat. But there is no <>! etc.
gc_check_stats question, or actually any ginc_var_ops info
#1
Posté 21 mars 2014 - 06:35
#2
Posté 21 mars 2014 - 06:54
Well I thought you could pass various logic checks in as part of the value string, but you could always use logic like this:
gc_check_stats( 4, 14 ) && ! gc_check_stats( 4, 15 )
It's true if the first is true and the second is false. You can do that with the conversation logic buttons as well.
#3
Posté 21 mars 2014 - 08:21
Yeah, the "conversation logic button" is all you need. Just check the NOT box in front of the script. NOT >= 14 is the same thing as <14.
#4
Posté 21 mars 2014 - 09:36
#5
Posté 22 mars 2014 - 09:50
Hi andysks,
Here you go ... lb_check_stats:
NB: I have only done one quick test, so let me know if it works OK for you.
In case it is not obvious, you define the ability to check as a number (unchanged), but the value as a string using the normal ">" symbols etc.
// LANCE BOTELLE adaption of gc_check_stats to run like gc_local_int (i.e. Using strings.)
#include "ginc_var_ops"
//#include "ginc_param_const"
int StartingConditional(int nStat, string sCheck)
{
object oPC = GetPCSpeaker();
int nNewStat;
switch ( nStat )
{
case 0: // Strength
nNewStat = ABILITY_STRENGTH;
break;
case 1: // Dexterity
nNewStat = ABILITY_DEXTERITY;
break;
case 2: // Constitution
nNewStat = ABILITY_CONSTITUTION;
break;
case 3: // Intelligence
nNewStat = ABILITY_INTELLIGENCE;
break;
case 4: // Wisdom
nNewStat = ABILITY_WISDOM;
break;
case 5: // Charisma
nNewStat = ABILITY_CHARISMA;
break;
}
int nValue = GetAbilityScore(oPC,nNewStat);
int iRet = CompareInts(nValue, sCheck);
return (iRet);
}
#6
Posté 23 mars 2014 - 02:16
Thanks Lance. It was actually more like a question if it's possible and stuff and not a script request, but of course I will use it. It should work, I don't see why not. Thanks a lot for the unexpected reply and ready script you gave
.
#7
Posté 23 mars 2014 - 04:10
int StartingConditional(int nStat, int nDC)
{
object oPC = GetPCSpeaker();
int nNewStat;
switch ( nStat )
{
case 0: // Strength
nNewStat = ABILITY_STRENGTH;
break;
case 1: // Dexterity
nNewStat = ABILITY_DEXTERITY;
break;
case 2: // Constitution
nNewStat = ABILITY_CONSTITUTION;
break;
case 3: // Intelligence
nNewStat = ABILITY_INTELLIGENCE;
break;
case 4: // Wisdom
nNewStat = ABILITY_WISDOM;
break;
case 5: // Charisma
nNewStat = ABILITY_CHARISMA;
break;
}
string sStat;
if (nStat == 0)
sStat = "STR";
else if (nStat == 1)
sStat = "DEX";
else if (nStat == 2)
sStat = "CON";
else if (nStat == 3)
sStat = "INT";
else if (nStat == 4)
sStat = "WIS";
else if (nStat == 5)
sStat = "CHA";
int nMod = GetAbilityModifier(nNewStat, oPC);
int nd20 = d20();
int nRoll = nd20 + nMod;
if (nRoll >= nDC )
{
SendMessageToPC(oPC, "Stat Check: " + sStat + ": *Success* on a " + IntToString(nd20) + "+" + IntToString(nMod) + "=" + IntToString(nRoll) + " vs DC : " + IntToString( nDC ));
return TRUE;
}
SendMessageToPC(oPC, "Stat Check: " + sStat + ": *Failure* on a " + IntToString(nd20) + "+" + IntToString(nMod) + "=" + IntToString(nRoll) + " vs DC : " + IntToString( nDC ));
return FALSE;
}
I put this together for my tomb of horrors conversion, since so many of the tricks and traps were stat tests
#8
Posté 23 mars 2014 - 05:20





Retour en haut






