Jump to content

zombie_agent.fsm client rpt error.


lordgeorge

Recommended Posts

Hey guys i posted a few days back regarding the error found on the client side rpt.

The error only pops up once the player handles damage from a zed.

I rooted the issue down to the zombie_agent.fsm

 

RPT

Error in expression <hen {
_losCheck = 0;
_cantSee = [_agent,_target] call dayz_losCheck;
};
>
  Error position: <_target] call dayz_losCheck;
};
>
  Error Undefined variable in expression: _target
Error in expression < = alive _agent;
_targetPos = getPosATL _target;



_agent moveTo _targetPos;
_a>
  Error position: <_target;



_agent moveTo _targetPos;
_a>
  Error Undefined variable in expression: _target
Error in expression <hen {
_losCheck = 0;
_cantSee = [_agent,_target] call dayz_losCheck;
};
>
  Error position: <_target] call dayz_losCheck;
};
>
  Error Undefined variable in expression: _target
Error in expression < = alive _agent;
_targetPos = getPosATL _target;



_agent moveTo _targetPos;
_a>
  Error position: <_target;



_agent moveTo _targetPos;
_a>
  Error Undefined variable in expression: _target
Error in expression < = alive _agent;
_targetPos = getPosATL _target;



_agent moveTo _targetPos;
_a>
  Error position: <_target;



_agent moveTo _targetPos;
_a>
  Error Undefined variable in expression: _target

The following is the zombie agent.fsm that is not modified or on the mission file. from line 495 on zombie_agent.fsm

      name = "Chase";
      init = /*%FSM<STATEINIT""">*/"_timeN = time;" \n
       "_isAlive = alive _agent;" \n
       "if (time - _entityTime > 20) then {" \n
       " _isSomeone = ({(isPlayer _x) and (alive _x) and (_agent distance _x < 200)} count playableUnits) > 0;" \n
       " _entityTime = time;" \n
       "};" \n
       "" \n
       "if (speed _agent < 0.1) then {_countr = _countr + 1} else {_countr = 0};" \n
       "" \n
       "_targetPos = getPosATL _target;" \n
       "" \n
       "//Move to target" \n
       "_agent moveTo _targetPos;" \n
       "_agent forceSpeed _runSpeed;" \n
       "" \n
       "if (isPlayer _target) then {" \n
       " if (_losCheck == 5) then {" \n
       " _losCheck = 0;" \n
       " _cantSee = [_agent,_target] call dayz_losCheck;" \n
       " };" \n
       "} else {" \n
       " if (_agent distance _target < 3) then {" \n
       " _cantSee = true;" \n
       " };" \n
       "};" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;

Any help would be great, this isnt causing any major issues but the rpt does get spammed.

 

Cheers

Link to comment
Share on other sites

  • 6 months later...

Lordgeorge,

I was about to open a topic about that and found yours :)

The "correct" way to see a FSM file is using FSM editor that comes with BI Tools, but i believe you can add two lines using any txt editor to fix the RPT error:

      name = "Chase";
      init = /*%FSM<STATEINIT""">*/"_timeN = time;" \n
       "_isAlive = alive _agent;" \n
       "if (time - _entityTime > 20) then {" \n
       " _isSomeone = ({(isPlayer _x) and (alive _x) and (_agent distance _x < 200)} count playableUnits) > 0;" \n
       " _entityTime = time;" \n
       "};" \n
       "" \n
       "if (speed _agent < 0.1) then {_countr = _countr + 1} else {_countr = 0};" \n
       "" \n
       "if !(isNil ""_target"") then {;" \n
       " _targetPos = getPosATL _target;" \n
       "" \n
       "//Move to target" \n
       " _agent moveTo _targetPos;" \n
       " _agent forceSpeed _runSpeed;" \n
       "" \n
       " if (isPlayer _target) then {" \n
       "  if (_losCheck == 5) then {" \n
       "  _losCheck = 0;" \n
       "  _cantSee = [_agent,_target] call dayz_losCheck;" \n
       "  };" \n
       " } else {" \n
       "  if (_agent distance _target < 3) then {" \n
       "  _cantSee = true;" \n
       "  };" \n
       " };" \n
       "};" \n
       ""/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
The new lines are:

1) before " _targetPos = getPosATL _target;" \n:

"if !(isNil ""_target"") then {;" \n
2) before ""/*%FSM</STATEINIT""">*/;:

"};" \n
Since you sayd this happens when zombie hits the player, _target is suposed to be not null, i believe. But i not investigated this.

Then you need a custom compile\wild_spawnZombies.sqf and compile\zombie_generate.sqf and change the FSM call on it to your modified FSM file.

I believe it's that, and i'm not sure if it worth.

Link to comment
Share on other sites

I also believe you will need the two sqf files as custom.

The FSM, on those files, is called that way:

 

_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
The only way is change "\z\AddOns\dayz_code\system\zombie_agent.fsm", and there is nothing you can do before to change that.
Link to comment
Share on other sites

I also believe you will need the two sqf files as custom.

The FSM, on those files, is called that way:

 

_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
The only way is change "\z\AddOns\dayz_code\system\zombie_agent.fsm", and there is nothing you can do before to change that.

 

Yeah i did think so, i can understand why as the fsm only runs on request so every time you cause zeds to spawn it would overlap the old file.

Meh :P

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...