I want to force the main PC out of Detect Mode. This script, while detecting the mode is on, does not stop it. Anyone know how to do it? The same line of code works for Stealth if I test with that instead (without the condition check).
if (GetDetectMode(oMainPC) == 1)
SendMessageToPC(oMainPC, " <<< STOP DETECTION >>> ");
AssignCommand(oMainPC, SetActionMode(oMainPC, ACTION_MODE_DETECT, FALSE));
You can’t stop it for elves, and maybe somme other race.
That’s what the GetDetectMode does I believe. It checks if the activation is “passive”, and so ignores any attempt to disable it, because it cannot. In my test, I am using a dwarf whose activation is manual and I cannot seem to be able to turn the activation off. The GetDetectMode recognises it as an active activation that can be turned off, but I simply cannot do it for some reason. It just appears to ignore the code.
i don’t think i managed to turn it off either …
int ACTION_MODE_DETECT = 0;
int ACTION_MODE_STEALTH = 1;
int ACTION_MODE_PARRY = 2;
int ACTION_MODE_POWER_ATTACK = 3;
int ACTION_MODE_IMPROVED_POWER_ATTACK = 4;
int ACTION_MODE_COUNTERSPELL = 5;
int ACTION_MODE_FLURRY_OF_BLOWS = 6;
int ACTION_MODE_RAPID_SHOT = 7;
int ACTION_MODE_COMBAT_EXPERTISE = 8;
int ACTION_MODE_IMPROVED_COMBAT_EXPERTISE = 9;
int ACTION_MODE_DEFENSIVE_CAST = 10;
int ACTION_MODE_DIRTY_FIGHTING = 11;
int ACTION_MODE_HELLFIRE_BLAST = 25;
int ACTION_MODE_HELLFIRE_SHIELD = 26;
// Clears bad action-modes that hurt the overland map.
void ClearBadActionModes(object oTarget)
//SendMessageToPC(GetFirstPC(FALSE), "\nClearBadActionModes() " + GetName(oTarget));
if (GetActionMode(oTarget, ACTION_MODE_DETECT)
&& !GetHasFeat(FEAT_KEEN_SENSE, oTarget))
SetActionMode(oTarget, ACTION_MODE_DETECT, FALSE); // delayed 0.1s - wtf
} // kL_NOTE: Cannot deactivate Detect for whatever reason.
if (GetActionMode(oTarget, ACTION_MODE_STEALTH))
SetActionMode(oTarget, ACTION_MODE_STEALTH, FALSE);
if (GetActionMode(oTarget, ACTION_MODE_TRACKING)
&& !GetHasFeat(FEAT_SWIFT_TRACKER, oTarget))
SetActionMode(oTarget, ACTION_MODE_TRACKING, FALSE); // kL_add.
} // kL_NOTE: Cannot deactivate Tracking for whatever reason.
if (GetActionMode(oTarget, ACTION_MODE_HELLFIRE_BLAST))
SetActionMode(oTarget, ACTION_MODE_HELLFIRE_BLAST, FALSE);
if (GetActionMode(oTarget, ACTION_MODE_HELLFIRE_SHIELD))
SetActionMode(oTarget, ACTION_MODE_HELLFIRE_SHIELD, FALSE);
Goodness me, I thought it was going to be so easy as well …
If you never found an answer, that makes me shudder … I may try/look again a little later then, after I sort out this other issue I am working on, which I don’t think I am having much success with either … but I won’t waste much time on it if you had no joy.
note that I couldn’t turn off Tracking either – and that both Tracking and Detect have feats that (if found) disallow turning them off … something borky methinks :\