class WeaponFSMSource
WeaponFSM › HFSMBase
All members, including inherited
weapon finite state machine
Constants 3
private static const int MAX_SYNCHRONIZE_ATTEMPTS = 12private static const int RESET_SYNCHRONIZE_THRESHOLD = 3600000ms
Members 4
private int m_SynchronizeAttemptsprivate int m_LastSynchronizeTimeprotected int m_NextStateId = 0counter for InternalID: each state in a fsm is assigned an unique number
protected ref array<WeaponStateBase> m_UniqueStates = new array<WeaponStateBase>unique list of states in this machine (automation of save/load)
Show 1 more
, SetInternalID()Methods 24
protected void SetInternalID(WeaponStateBase state)Show 2 more
, m_NextStateId, and m_UniqueStatesoverride void AddTransition(FSMTransition<WeaponStateBase, WeaponEventBase, WeaponActionBase, WeaponGuardBase> t)adds transition into transition table As a side effect registers the state(s) into m_UniqueStates
Show 1 more
, FSMTransition.m_srcStateShow 41 more
, ChamberMultiBullet.ChamberMultiBullet(), Crossbow_Base.InitStateMachine(), DoubleBarrel_Base.InitStateMachine(), Flaregun.InitStateMachine(), LoopedChambering.LoopedChambering(), LoopedChamberingCombineChamberInternalMagazine.LoopedChamberingCombineChamberInternalMagazine(), LoopedChamberingEjectLast.LoopedChamberingEjectLast(), Magnum_Base.InitStateMachine(), Mp133Shotgun_Base.InitStateMachine(), OpenBolt_Base.InitStateMachine(), Pistol_Base.InitStateMachine(), Repeater_Base.InitStateMachine(), Rifle_Base.InitStateMachine(), RifleBoltFree_Base.InitStateMachine(), RifleBoltLock_Base.InitStateMachine(), RifleChambering.RifleChambering(), RifleEjectCasing.RifleEjectCasing(), RifleReChambering.RifleReChambering(), RifleSingleShot_Base.InitStateMachine(), RifleSingleShotManual_Base.InitStateMachine(), SingleShotPistol_Base.InitStateMachine(), SKS_Base.InitStateMachine(), WeaponAttachMagazine.WeaponAttachMagazine(), WeaponAttachMagazineOpenBoltCharged.WeaponAttachMagazineOpenBoltCharged(), WeaponChambering.WeaponChambering(), WeaponCharging.WeaponCharging(), WeaponChargingInnerMag.WeaponChargingInnerMag(), WeaponChargingMultiple.WeaponChargingMultiple(), WeaponChargingStretch.WeaponChargingStretch(), WeaponDetachingMag.WeaponDetachingMag(), WeaponDetachingMagOpenBolt.WeaponDetachingMagOpenBolt(), WeaponEjectBullet.WeaponEjectBullet(), WeaponFireAndChamberNext.WeaponFireAndChamberNext(), WeaponFireAndChamberNextFromInnerMag.WeaponFireAndChamberNextFromInnerMag(), WeaponFireLast.WeaponFireLast(), WeaponMagnumChambering.WeaponMagnumChambering(), WeaponRechamber.WeaponRechamber(), WeaponReplacingMagAndChamberNext.WeaponReplacingMagAndChamberNext(), WeaponReplacingMagAndChamberNextOpenBoltCharged.WeaponReplacingMagAndChamberNextOpenBoltCharged(), WeaponStateBase.AddTransition(), and WeaponUnjamming.WeaponUnjamming()override protected ProcessEventResult ProcessLocalTransition(FSMTransition<WeaponStateBase, WeaponEventBase, WeaponActionBase, WeaponGuardBase> t, WeaponEventBase e)Show 15 more
, LogManager.IsInventoryHFSMLogEnable(), OnEntry(), OnStateChanged(), OnSubMachineChanged(), Class.ToString(), ToString(), ToString(), ToString(), ToString(), ValidateAndRepair(), FSMTransition.m_action, FSMTransition.m_dstState, FSMTransition.m_guard, FSMTransition.m_srcState, and HFSMBase.m_Stateoverride protected ProcessEventResult ProcessAbortTransition(FSMTransition<WeaponStateBase, WeaponEventBase, WeaponActionBase, WeaponGuardBase> t, WeaponEventBase e)Show 14 more
, GetParentState(), LogManager.IsInventoryHFSMLogEnable(), OnEntry(), Class.ToString(), ToString(), ToString(), ToString(), ToString(), ValidateAndRepair(), FSMTransition.m_action, FSMTransition.m_dstState, FSMTransition.m_guard, FSMTransition.m_srcState, and HFSMBase.m_Stateoverride WeaponStateBase ProcessAbortEvent(WeaponEventBase e, out ProcessEventResult result)Show 17 more
, GetFSM(), HFSMBase.GetOwnerState(), WeaponStateBase.GetParentState(), HasFSM(), LogManager.IsInventoryHFSMLogEnable(), OnAbort(), OnEntry(), ProcessAbortEvent(), ProcessAbortTransition(), typename.ToString(), ToString(), ToString(), Class.Type(), Class.Type(), ValidateAndRepair(), HFSMBase.m_State, and HFSMBase.m_Transitionsoverride ProcessEventResult ProcessEvent(WeaponEventBase e)Show 21 more
, fsmDebugPrint(), fsmDebugSpam(), array.Get(), HFSMBase.GetOwnerState(), GetParentState(), GetParentState(), HasFSM(), LogManager.IsInventoryHFSMLogEnable(), LogManager.IsWeaponLogEnable(), HFSMBase.LocalTransition(), OnExit(), HFSMBase.ProcessCompletionTransitions(), ProcessEvent(), typename.ToString(), ToString(), ToString(), Class.Type(), Class.Type(), HFSMBase.m_HasCompletions, HFSMBase.m_State, and HFSMBase.m_TransitionsWeaponStateBase FindStateForInternalID(int id)retrieve base state that matches given internal id
- in
id - the id stored in database during save
WeaponStableState FindStableStateForID(int id)load from database - reverse lookup for state from saved id
- in
id - the id stored in database during save
Show 3 more
, WeaponStableState.GetCurrentStateID(), FSMTransition.m_srcState, and HFSMBase.m_Transitionsprotected bool LoadAndSetCurrentFSMState(ParamsReadContext ctx, int version)Show 5 more
, Serializer.Read(), HFSMBase.Start(), HFSMBase.Terminate(), wpnDebugPrint(), and HFSMBase.m_Statebool LoadCurrentFSMState(ParamsReadContext ctx, int version)load current state of fsm
Show 3 more
, LoadCurrentFSMState(), wpnDebugSpam(), and HFSMBase.m_Statebool LoadCurrentUnstableFSMState(ParamsWriteContext ctx, int version)Show 6 more
, GetInternalStateID(), LogManager.IsWeaponLogEnable(), LoadAndSetCurrentFSMState(), LoadCurrentFSMState(), wpnDebugSpam(), and m_UniqueStatesbool SaveCurrentFSMState(ParamsWriteContext ctx)save current state of fsm
bool SaveCurrentUnstableFSMState(ParamsWriteContext ctx)Show 9 more
, HFSMBase.GetCurrentState(), GetInternalStateID(), WeaponStateBase.GetInternalStateID(), LogManager.IsWeaponLogEnable(), SaveCurrentFSMState(), wpnDebugPrint(), wpnDebugSpam(), Serializer.Write(), and m_UniqueStatesvoid ValidateAndRepair()validate the state of the gun and repair if mismatch
Show 1 more
, ProcessLocalTransition()protected bool Internal_ValidateAndRepair()validate the state of the gun and repair if mismatch
Returns: bool whether it performed repairing or not
Show 12 more
, WeaponStableState.HasMagazine(), WeaponStableState.IsChamberFiredOut(), Weapon.IsChamberFiredOut(), WeaponStableState.IsChamberFull(), Weapon.IsChamberFull(), Weapon.IsChamberFullEx(), WeaponStableState.IsJammed(), Weapon_Base.IsJammed(), WeaponStableState.IsRepairEnabled(), ValidateAndRepairHelper(), HFSMBase.m_State, and WeaponStateBase.m_weaponprotected bool ValidateAndRepairHelper(Weapon_Base weapon, string name, bool stateCondition, bool gunCondition, WeaponEventBase e1, WeaponEventBase e2, out WeaponStableState state)Show 20 more
, CGame.GetTime(), WeaponStableState.HasBullet(), WeaponStableState.HasMagazine(), CGame.IsServer(), LogManager.IsWeaponLogEnable(), OnFailThresholdBreached(), Weapon_Base.RandomizeFSMState(), HFSMBase.Start(), WeaponStableState.SyncAnimState(), Weapon.Synchronize(), Weapon_Base.SyncSelectionState(), HFSMBase.Terminate(), ValidateAndRepairStateFinder(), wpnDebugPrint(), m_LastSynchronizeTime, HFSMBase.m_State, m_SynchronizeAttempts, MAX_SYNCHRONIZE_ATTEMPTS, MIN_SYNCHRONIZE_INTERVAL, and RESET_SYNCHRONIZE_THRESHOLDprotected void OnFailThresholdBreached(Weapon weapon, string name, bool stateCondition, bool gunCondition)protected WeaponStableState ValidateAndRepairStateFinder(bool condition, WeaponEventBase e1, WeaponEventBase e2, WeaponStableState state)bool OnStoreLoad(ParamsReadContext ctx, int version)load state of fsm
Show 5 more
, Serializer.Read(), HFSMBase.Start(), HFSMBase.Terminate(), wpnDebugPrint(), and HFSMBase.m_Stateint GetCurrentStableStateID()tries to return identifier of current stable state
if the weapon is in stable state, i.e. not reloading, firing, detaching, ... than the identifier of the stable state is used directly. otherwise if the weapon is in unstable state, than the function uses abort information to determine the closest stable state that is coherent with weapon's state.
Returns: integer id that will be stored to database
int GetInternalStateID()return internal identifier of current state
void OnStoreSave(ParamsWriteContext ctx)save state of fsm
Show 2 more
, wpnDebugSpamALot(), and Serializer.Write()Deprecated, use RandomizeFSMStateEx for better results
void RandomizeFSMStateEx(array<MuzzleState> muzzleStates, bool hasMagazine, bool isJammed)With the parameters given, selects a random suitable state for the FSM of the weapon @NOTE: It is better to use Weapon_Base.RandomizeFSMState instead of calling this one @WARNING: Weapon_Base.Synchronize call might be needed, if this method is called while clients are connected