Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Improve arty combat support #42

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6a85750
Rewrite fnc_unpackMortar part 1/x
marceldev89 Jul 3, 2016
faa5773
Rename _cfg to something a bit more descriptive
marceldev89 Jul 3, 2016
c50155d
Handle timeouts in fnc_unpackMortar
marceldev89 Jul 14, 2016
b6029a9
Redo fnc_packMortar
marceldev89 Jul 17, 2016
617c505
Create (sup_)Artillery class with CBA statemachine
marceldev89 Jul 30, 2016
de788dd
Fix typo :smiley:
marceldev89 Jul 30, 2016
18010ca
Change file/function case
marceldev89 Aug 2, 2016
10a2530
Replace hashSet with setVariable
marceldev89 Aug 2, 2016
00501ba
Update ArtilleryStateMachine (onState => onStateEntered)
marceldev89 Aug 6, 2016
03e38b4
Spawn arty units using the artillery class
marceldev89 Aug 6, 2016
291f558
Basic integration of sup_artillery with NEO_radio
marceldev89 Aug 14, 2016
d9a9eaf
Add support for "full" and "semi" rate of fire
marceldev89 Aug 16, 2016
43dbfce
Move bits from fnc_combatSupport to fnc_artillery
marceldev89 Sep 24, 2016
cc09e94
Add "rounds" property to fnc_artillery
marceldev89 Sep 24, 2016
37bbf2c
Cleanup
marceldev89 Sep 24, 2016
3a1941f
Pack/unpack mortars
marceldev89 Oct 21, 2016
a7c849c
Cleanup obsolete code from fnc_combatSupport
marceldev89 Oct 22, 2016
3c34bea
Fix NEO_radio issue with mortar teams
marceldev89 Oct 22, 2016
d9bb1ea
Really fix NEO_radio issue with mortar teams
marceldev89 Oct 22, 2016
f2980da
Create proper mortar teams
marceldev89 Oct 22, 2016
6d7f170
Get rid of the event "methods"
marceldev89 Nov 17, 2016
6d65a20
Extract spawn method to separate script
marceldev89 Nov 17, 2016
80f031f
Extract fired event handler to script
marceldev89 Nov 17, 2016
4532cc2
Cleanup
marceldev89 Nov 17, 2016
e783c44
Reorder class methods for readability(?)
marceldev89 Nov 17, 2016
6679c93
Separate getters and setters
marceldev89 Nov 17, 2016
cc98238
Don't initialize arty module if not synced to CS module
marceldev89 Nov 19, 2016
ed7dc3b
Relocate arty asset when not in range
marceldev89 Nov 20, 2016
6e5a339
Fix RTB behaviour
marceldev89 Nov 20, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions addons/sup_artillery/ArtilleryStateMachine.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
class ArtilleryStateMachine {
list = "ALIVE_sup_artillery_stateMachine_list";

class Idle {
onState = "";
onStateEntered = "";
onStateLeaving = "";

class HasFireMission {
targetState = "Active";
condition = "[_this, 'hasFireMission'] call ALIVE_fnc_artillery";
onTransition = "";
};
};

class Active {
onState = "";
onStateEntered = "[_this, 'activate'] call ALIVE_fnc_artillery";
onStateLeaving = "";

class InRange {
targetState = "Execute";
condition = "[_this, 'inRange'] call ALIVE_fnc_artillery";
onTransition = "";
};

class NotInRange {
targetState = "Pack";
condition = "!([_this, 'inRange'] call ALIVE_fnc_artillery)";
onTransition = "";
};
};

class Pack {
onState = "";
onStateEntered = "[_this, 'pack'] call ALIVE_fnc_artillery";
onStateLeaving = "";

class Packed {
targetState = "Move";
condition = "[_this, 'hasPacked'] call ALIVE_fnc_artillery";
onTransition = "";
};
};

class Move {
onState = "";
onStateEntered = "[_this, 'move'] call ALIVE_fnc_artillery";
onStateLeaving = "";

class InPosition {
targetState = "Unpack";
condition = "[_this, 'inPosition'] call ALIVE_fnc_artillery";
onTransition = "";
};

class Abort {
targetState = "ReturnToBase";
condition = "!([_this, 'hasFireMission'] call ALIVE_fnc_artillery)";
onTransition = "";
};
};

class Unpack {
onState = "";
onStateEntered = "[_this, 'unpack'] call ALIVE_fnc_artillery";
onStateLeaving = "";

class Unpacked {
targetState = "Execute";
condition = "[_this, 'hasUnpacked'] call ALIVE_fnc_artillery";
onTransition = "";
};
};

class Execute {
onState = "";
onStateEntered = "[_this, 'execute'] call ALIVE_fnc_artillery";
onStateLeaving = "";

class Fire {
targetState = "Fire";
condition = "[_this, 'canFireRound'] call ALIVE_fnc_artillery";
onTransition = "";
};

class Abort {
targetState = "ReturnToBase";
condition = "!([_this, 'hasFireMission'] call ALIVE_fnc_artillery)";
onTransition = "";
};
};

class Fire {
onState = "";
onStateEntered = "[_this, 'fire'] call ALIVE_fnc_artillery";
onStateLeaving = "";

class FireMissionComplete {
targetState = "ReturnToBase";
condition = "[_this, 'isFireMissionComplete'] call ALIVE_fnc_artillery";
onTransition = "";
};

class Fired {
targetState = "FireDelay";
condition = "[_this, 'isFireMissionDelayed'] call ALIVE_fnc_artillery";
onTransition = "";
};
};

class FireDelay {
onState = "";
onStateEntered = "";
onStateLeaving = "";

class FireMissionComplete {
targetState = "ReturnToBase";
condition = "[_this, 'isFireMissionComplete'] call ALIVE_fnc_artillery";
onTransition = "";
};

class Continue {
targetState = "Fire";
condition = "[_this, 'canFireRound'] call ALIVE_fnc_artillery";
onTransition = "";
};
};

class ReturnToBase {
onState = "";
onStateEntered = "[_this, 'returnToBase'] call ALIVE_fnc_artillery";
onStateLeaving = "";

class AtBase {
targetState = "Idle";
condition = "[_this, 'inPosition'] call ALIVE_fnc_artillery";
onTransition = "";
};
};
};
37 changes: 26 additions & 11 deletions addons/sup_artillery/CfgFunctions.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
class cfgFunctions {
class PREFIX {
class COMPONENT {
class ARTILLERY {
description = "The main class";
file = "\x\alive\addons\sup_artillery\fnc_artillery.sqf";
class PREFIX {
class COMPONENT {
class ARTILLERY {
description = "The main class";
file = "\x\alive\addons\sup_artillery\fnc_artillery.sqf";
RECOMPILE;
};
class artilleryInit {
description = "The module initialisation function";
file = "\x\alive\addons\sup_artillery\fnc_artilleryInit.sqf";
};
class artilleryInit {
description = "The module initialisation function";
file = "\x\alive\addons\sup_artillery\fnc_artilleryInit.sqf";
RECOMPILE;
};
};
};
class artillerySpawn {
description = "Spawns artillery assets";
file = "\x\alive\addons\sup_artillery\fnc_artillerySpawn.sqf";
RECOMPILE;
};
class artilleryFiredEH {
description = "Handles artillery fired events";
file = "\x\alive\addons\sup_artillery\fnc_artilleryFiredEH.sqf";
RECOMPILE;
};
class artilleryGetRange {
description = "Gets range of artillery asset";
file = "\x\alive\addons\sup_artillery\fnc_artilleryGetRange.sqf";
RECOMPILE;
};
};
};
};
4 changes: 2 additions & 2 deletions addons/sup_artillery/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class CfgVehicles {
{
scope = 2;
displayName = "$STR_ALIVE_ARTILLERY";
function = "ALIVE_fnc_ARTILLERYInit";
function = "ALIVE_fnc_artilleryInit";
author = MODULE_AUTHOR;
functionPriority = 161;
isGlobal = 2;
Expand Down Expand Up @@ -97,4 +97,4 @@ class CfgVehicles {
};
};
};
};
};
2 changes: 2 additions & 0 deletions addons/sup_artillery/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
#include <CfgPatches.hpp>
#include <CfgVehicles.hpp>
#include <CfgFunctions.hpp>

#include <ArtilleryStateMachine.hpp>
57 changes: 0 additions & 57 deletions addons/sup_artillery/fnc_ARTILLERY.sqf

This file was deleted.

Loading