Hi TR,
Thanks for looking … Script sections below …
Basically, in the past, if I update a CAMPAIGN SCRIPT, it works in any saved game that has the newer script applied. However, this monster HB addition does not update between script updates …
i.e. The original version did not have the Global “TESTMODE” check in it and so the heartbeat started regardless. As I was having all sorts of problems (which may be due to this actual fact), I decided to add the additional GLOBAL check to prevent/reset the pseudo heartbeat when I reloaded the game to test any changes. However, the old hearbeat just kept running, even though TESTMODE was 0 (zer0) … and I also tested if it was TRUE too.
OK, here is the function called … EDIT: fixed logic for first check.
EDIT: Some functions are just some of my own and 1582 is my appearance for the ankheg.
EDIT: To duplicate the issue, just add these scripts without the GlobalInt “TESTMODE” section in place and save the game once the heartbeat is running. Then alter the scripts with the new GlobalInt “TESTMODE” in, and reload the game. Normally, if these are CAMPAIGN scripts (which they are), it usually applies the changes without any issues, but this time around it ignores my changes.
EDIT: You will need to add your own debug feedback.
EDIT: My “guess” is that somehow, once a PSEUDO heartbeat is running, it becomes “locked” to any external changes.
//////////////////////////////////////////////////////////////////////////////////////////////
// SPEED UP DETECTION CHECKS (IF UNDERGROUND FIND NEW TARGET AND BURROW UP ATTACK)
//////////////////////////////////////////////////////////////////////////////////////////////
void FastHeartCheck();
void FastHeartCheck()
{
if(GetIsDead(OBJECT_SELF) || GetGlobalInt("TESTMODE") == 0){return;}
else
{
SetLocalInt(OBJECT_SELF, "FASTRUNNING", 1);
object oNearTarget = GetNearestLiveEnemy(OBJECT_SELF, 1, 0);
if(oNearTarget == OBJECT_INVALID)
{
if(GetLocalInt(OBJECT_SELF, "UNDERGROUND") == 0)
{
DelayCommand(2.0, BurrowDown(OBJECT_INVALID));
DelayCommand(2.0, DeleteLocalInt(OBJECT_SELF, "FASTRUNNING"));
return;
}
}
if(GetLocalInt(OBJECT_SELF, "UNDERGROUND") == 1 && !GetIsInCombat(OBJECT_SELF)
&& GetLocalInt(OBJECT_SELF, "BURROWING") == 0)
{
BurrowUpAttack();
}
DelayCommand(2.0, FastHeartCheck());
}
}
And here is the creature HB that calls it:-
if(GetGlobalInt("TESTMODE") == 0 && GetAppearanceType(OBJECT_SELF) == 1582)
{
DeleteLocalInt(OBJECT_SELF, "FASTRUNNING");
}
else if(GetLocalInt(OBJECT_SELF, "UNDERGROUND") == 1)
{
if(GetLocalInt(OBJECT_SELF, "FASTRUNNING") == 0){FastHeartCheck();}
return;
}