DeanosBeano, this will help?
class CfgVehicles {
class USMC_Soldier;
class MyUnit : USMC_Soldier {
displayName = "-- MyUnit --";
class HeritableEventHandlersFiles {
class MyUnit { // This class should be named exactly the same as a your vehicle class
firedNear = "/addonname/firedNearEH.sqf";
};
};
};
};
Script "/addonname/firedNearEH.sqf"
#define __fsmRunned "MY_MOD_PREFIX:MY_MODULE_PREFIX::FSM_COWARD_IS_RUNNING"
_unit = _this select 0;
if (isNil (_unit getVariable __fsmRunned)) then {
// !!! if "SUPER_AI" mode is active, then all units have the skill == 1
if (morale _unit < 0 && skill _unit < .5) then {
_unit setVariable [__fsmRunned, 1];
_this execFSM "dbo\scripts\ScaredHigh.fsm";
};
};
Full example of config:
class CfgVehicles {
class USMC_Soldier;
class HEH_Unit_diag_log : USMC_Soldier {
displayName = "-- HEH_Unit_diag_log";
class HeritableEventHandlers {
class HEH_Unit_diag_log { // This class should be named exactly the same as a your vehicle class
animChanged = "diag_log ['animChanged', _this select 0]";
animDone = "diag_log ['animDone', _this select 0]";
animStateChanged = "diag_log ['animStateChanged', _this select 0]";
dammaged = "diag_log ['dammaged', _this select 0]";
engine = "diag_log ['engine', _this select 0]";
fired = "diag_log ['fired', _this select 0]";
firedNear = "diag_log ['firedNear', _this select 0]";
fuel = "diag_log ['fuel', _this select 0]";
gear = "diag_log ['gear', _this select 0]";
getIn = "diag_log ['getIn', _this select 0]";
getOut = "diag_log ['getOut', _this select 0]";
handleDamage = "diag_log ['handleDamage', _this select 0]";
handleHeal = "diag_log ['handleHeal', _this select 0]";
hit = "diag_log ['hit', _this select 0]";
incomingMissile = "diag_log ['incomingMissile', _this select 0]";
init = "diag_log ['init', _this select 0]";
killed = "diag_log ['killed', _this select 0]";
landedStopped = "diag_log ['landedStopped', _this select 0]";
landedTouchDown = "diag_log ['landedTouchDown', _this select 0]";
};
};
};
};