Code: Select all
GetIsSkillSuccessful(oPC, SKILL_ESCAPE_ARTIST, iDifficulty, FALSE);
Code: Select all
GetIsSkillSuccessful(oPC, 35, iDifficulty, FALSE);
Gods of code, I humbly beseech an answer.
Teric
Code: Select all
GetIsSkillSuccessful(oPC, SKILL_ESCAPE_ARTIST, iDifficulty, FALSE);
Code: Select all
GetIsSkillSuccessful(oPC, 35, iDifficulty, FALSE);
Code: Select all
if(blah)
integer i=35;
else
integer i=32;
end
GetIsSkillSuccessful(oPC, i, iDifficulty, FALSE);
Yes, because for testing purposes I stopped passing it any variable from the trigger and just put the number of the skill directly in the script. Just tested it again and putting "8" in the script works - one of the OC skills.Zelknolf wrote:Are you certain that it's getting that 35?
Code: Select all
GetIsSkillSuccessful(oPC, 8, iDifficulty, FALSE)
Code: Select all
Skill 0 is AE; we've burnt it at the stake, because it's AE. Though I also haven't tried to roll it on the ACR, because it's AE. So yeah, code block would be handy.Ronan wrote:I would think GetIsSkillSuccessful would still function where nSkill = 0, though I have not tested it. Teric, could you paste your entire code within ablock?Code: Select all
Code: Select all
#include "acr_i"
void main()
{
object oPC = GetEnteringObject();
int iSkill = GetLocalInt(OBJECT_SELF, "SJC_SKILLNUMBER");
string sFeedback = GetLocalString(OBJECT_SELF, "SJC_FLAVOURTEXT");
int iDifficulty = GetLocalInt(OBJECT_SELF, "SJC_SKILL_DC");
string sTag = GetTag(OBJECT_SELF);
if (!GetIsPC(oPC)) return;
if (GetLocalInt(oPC, "SKILLTRIGGERDONE" + sTag) == 1) return;
SetLocalInt(oPC, "SKILLTRIGGERDONE" + sTag, 1);
if (GetIsSkillSuccessful(oPC, iSkill, iDifficulty, FALSE))
{
FloatingTextStringOnCreature(sFeedback, oPC, TRUE, 5.0f);
}
}
Code: Select all
#include "acr_i"
#include "acr_notifications_i"
void main()
{
object oPC = GetEnteringObject();
int iSkill = GetLocalInt(OBJECT_SELF, "SJC_SKILLNUMBER");
string sFeedback = GetLocalString(OBJECT_SELF, "SJC_FLAVOURTEXT");
int iDifficulty = GetLocalInt(OBJECT_SELF, "SJC_SKILL_DC");
string sTag = GetTag(OBJECT_SELF);
if (!GetIsPC(oPC)) return;
if (GetLocalInt(OBJECT_SELF, "SKILLDONE" + IntToString(ACR_GetCharacterID(oPC))) == 1) return;
SetLocalInt(OBJECT_SELF, "SKILLDONE" + IntToString(ACR_GetCharacterID(oPC)), 1);
if (GetIsSkillSuccessful(oPC, iSkill, iDifficulty, FALSE))
{
string sAbbreviation = "You've found something!";
NotifyPlayer( oPC, NOTIFY_TYPE_INFO, sAbbreviation, sFeedback, NOTIFY_WINDOW_MESSAGE_BOX, "", "", "OK", "");
}
}
The method of saving on the PC object or the trigger or the area wasn't the problem, really-- the systems were looking for something that would be garaunteed to be unique, and area or trigger tags rely on human configuration to achieve uniqueness (and humans aren't very good at that); however, PC IDs are garaunteed unique by a computer (and computers are quite good at that).t-ice wrote:Well, this is sort of repeating what Zelk said, and what I did instructed by Zelk, but Amn's "hunting areas" use skill rolls similarly upon entering. The script runs as the OnClicked script on the trigger that leads to the area (on the other side, that is). Local variables are saved on the area object, though I suppose the trigger itself would be just as well, but using locals on the PC is rather to be avoided if possible?