42 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine");
48 m_oldMagazine.GetInventory().GetCurrentInventoryLocation(oldSrc);
55 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot remove old mag from wpn");
67 if (!super.SaveCurrentFSMState(ctx))
72 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_oldMagazine for weapon=" +
m_weapon);
79 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" +
m_weapon);
88 if (!super.LoadCurrentFSMState(ctx, version))
93 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_oldMagazine for weapon=" +
m_weapon);
99 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" +
m_weapon);
123 Magazine m_newMagazine;
148 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine, error - cannot remove new mag from LHand");
173 if (!super.SaveCurrentFSMState(ctx))
178 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" +
m_weapon);
184 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" +
m_weapon);
193 if (!super.LoadCurrentFSMState(ctx, version))
198 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" +
m_weapon);
203 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" SwapOldAndNewMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" +
m_weapon);
216 Magazine m_newMagazine;
238 if (
m_newMagazine.GetInventory().GetCurrentInventoryLocation(il))
253 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine, error - cannot get curr location");
256 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine, error - no magazines configured for replace (m_new=NULL)");
269 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponDetachingMag_Store, error - cannot abort detaching of magazine");
290 if (!super.SaveCurrentFSMState(ctx))
295 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" +
m_weapon);
301 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" +
m_weapon);
309 if (!super.LoadCurrentFSMState(ctx, version))
314 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" +
m_weapon);
319 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" AttachNewMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" +
m_weapon);
348 ref WeaponChamberFromAttMag_W4T
m_chamber;
349 ref WeaponCharging_CK
m_onCK;
410 WeaponEventSwapMagazine se;
413 int mi =
m_weapon.GetCurrentMuzzle();
423 if (!
m_newMagazine.GetInventory().GetCurrentInventoryLocation(newSrc))
427 if (!
m_oldMagazine.GetInventory().GetCurrentInventoryLocation(oldSrc))
441 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" RemoveNewMagazineFromInventory, error - cannot new remove mag from inv");
460 Magazine mag = Magazine.Cast(leftHandItem);
480 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine - exit");
486 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
493 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot remove old mag from wpn - exit");
507 Magazine mag = Magazine.Cast(leftHandItem);
527 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot drop magazine from left hand after not found inventory space for old magazine - abort");
533 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
540 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine, error - cannot remove old mag from wpn - abort");
547 if (!super.SaveCurrentFSMState(ctx))
552 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" +
m_weapon);
558 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_oldMagazine for weapon=" +
m_weapon);
564 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.SaveCurrentFSMState: cannot write m_newDst for weapon=" +
m_weapon);
573 if (!super.LoadCurrentFSMState(ctx, version))
578 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" +
m_weapon);
583 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_oldMagazine for weapon=" +
m_weapon);
590 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" DetachOldMagazine.LoadCurrentFSMState: cannot read m_newDst for weapon=" +
m_weapon);
610 ref WeaponDetachingMag_StoreRemoveChamberBullet
m_detach;
614 ref WeaponChamberFromAttMagOpenbolt_W4T
m_chamber;
615 ref WeaponChargingOpenBolt_CK
m_onCK;
674 WeaponEventSwapMagazine se;
677 int mi =
m_weapon.GetCurrentMuzzle();
687 if (!
m_newMagazine.GetInventory().GetCurrentInventoryLocation(newSrc))
691 if (!
m_oldMagazine.GetInventory().GetCurrentInventoryLocation(oldSrc))
705 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged, error - cannot new remove mag from inv");
724 Magazine mag = Magazine.Cast(leftHandItem);
744 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged, error - cannot drop magazine from left hand after not found inventory space for old magazine - exit");
750 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
757 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged, error - cannot remove old mag from wpn - exit");
771 Magazine mag = Magazine.Cast(leftHandItem);
791 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged, error - cannot drop magazine from left hand after not found inventory space for old magazine - abort");
797 mag.GetInventory().GetCurrentInventoryLocation(oldSrc);
804 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged, error - cannot remove old mag from wpn - abort");
811 if (!super.SaveCurrentFSMState(ctx))
816 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged.SaveCurrentFSMState: cannot write m_newMagazine for weapon=" +
m_weapon);
822 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged.SaveCurrentFSMState: cannot write m_oldMagazine for weapon=" +
m_weapon);
828 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged.SaveCurrentFSMState: cannot write m_newDst for weapon=" +
m_weapon);
837 if (!super.LoadCurrentFSMState(ctx, version))
842 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged.LoadCurrentFSMState: cannot read m_newMagazine for weapon=" +
m_weapon);
847 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged.LoadCurrentFSMState: cannot read m_oldMagazine for weapon=" +
m_weapon);
854 Error(
"[wpnfsm] " +
Object.GetDebugName(
m_weapon) +
" WeaponReplacingMagAndChamberNextOpenBoltCharged.LoadCurrentFSMState: cannot read m_newDst for weapon=" +
m_weapon);
void wpnDebugPrint(string s)
attach mag in LH into weapon
Super root of all classes in Enforce script.
detaches old magazine from weapon and stores it in left hand (LH)
script counterpart to engine's class Inventory
static proto native bool LocationSyncMoveEntity(notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
proto native void SetItem(notnull EntityAI item)
proto native bool IsValid()
verify current set inventory location
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
static string DumpToStringNullSafe(InventoryLocation loc)
provides access to slot configuration
static bool IsWeaponLogEnable()
hides old magazine, but keep it in LH
proto bool Write(void value_out)
proto bool Read(void value_in)
old magazine to inventory, new to left hand
signalize mechanism manipulation
weapon finite state machine
replace current magazine with new one
replace current magazine with new one for weapon charged with open position bolt
simple class starting animation action specified by m_action and m_actionType
represent weapon state base
void WeaponStartAction(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
specific action sub-type
ref DetachOldMagazine m_detach
ref InventoryLocation m_newDst
magazine that will be detached
ref WeaponEjectCasing m_eject
ref WeaponStateBase m_start
source of the cartridge
void WeaponReplacingMagAndChamberNextOpenBoltCharged(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
override void OnEntry(WeaponEventBase e)
void DetachOldMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
ref WeaponCharging_CK m_onCK
void WeaponReplacingMagAndChamberNext(Weapon_Base w=NULL, WeaponStateBase parent=NULL, WeaponActions action=WeaponActions.NONE, int actionType=-1)
ref WeaponFSM m_fsm
hierarchical parent state of this state (or null)
override void OnAbort(WeaponEventBase e)
void WeaponStateBase(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
internal state id used for load/restore
void WeaponEjectCasing(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
override void OnExit(WeaponEventBase e)
override bool LoadCurrentFSMState(ParamsReadContext ctx, int version)
int m_actionType
action to be played
Magazine m_newMagazine
magazine that will be detached
ref SwapOldAndNewMagazine m_swapMags
ref AttachNewMagazine m_attach
ref WeaponChambering_Cartridge m_chamber
ref OldMagazineHide m_hideOld
void AttachNewMagazine(Weapon_Base w=NULL, WeaponStateBase parent=NULL)
override bool IsWaitingForActionFinish()
override bool SaveCurrentFSMState(ParamsWriteContext ctx)
void DayZPlayerUtils()
cannot be instantiated
Serializer ParamsReadContext
Serializer ParamsWriteContext
void Error(string err)
Messagebox with error message.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
void WeaponGuardHasAmmo(Weapon_Base w=NULL)
FindInventoryLocationType
flags for searching locations in inventory
bool OptionalLocationReadFromContext(out InventoryLocation loc, notnull ParamsReadContext ctx)
InventoryLocationType
types of Inventory Location
bool OptionalLocationWriteToContext(InventoryLocation loc, notnull ParamsWriteContext ctx)
enum FSMTransition WeaponTransition
ref WeaponStateBase m_start
class WeaponEndAction extends WeaponStartAction m_action