summaryrefslogtreecommitdiffstats
path: root/Client/FSM/updatetownmarkers.fsm
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:38:09 +0300
commita3a91d4f45b22fd487ecbc954ad979be5d03efdd (patch)
treea554ab159a347dcd6c00ca1c7c26c1ec3ac0a6bd /Client/FSM/updatetownmarkers.fsm
downloada2wf_chernarus-main.tar.gz
a2wf_chernarus-main.tar.bz2
a2wf_chernarus-main.zip
Diffstat (limited to '')
-rw-r--r--Client/FSM/updatetownmarkers.fsm112
1 files changed, 112 insertions, 0 deletions
diff --git a/Client/FSM/updatetownmarkers.fsm b/Client/FSM/updatetownmarkers.fsm
new file mode 100644
index 0000000..ac92ea9
--- /dev/null
+++ b/Client/FSM/updatetownmarkers.fsm
@@ -0,0 +1,112 @@
+/*%FSM<COMPILE "F:\ArmA2\FSM Editor Personal Edition\scriptedFSM.cfg, updatetownmarkers">*/
+/*%FSM<HEAD>*/
+/*
+item0[] = {"Init",0,250,64.620567,-141.323822,154.620590,-91.323967,0.000000,"Init"};
+item1[] = {"Check_Towns",2,250,-65.773369,-55.204887,24.226547,-5.204931,0.000000,"Check Towns"};
+item2[] = {"End",1,250,-218.006683,15.304325,-128.006653,65.304314,0.000000,"End"};
+item3[] = {"Loop",4,4314,65.605347,-56.267605,155.605377,-6.267574,0.000000,"Loop"};
+item4[] = {"Gameover",4,218,-216.668854,-56.267559,-126.668869,-6.267574,0.000000,"Gameover"};
+link0[] = {0,3};
+link1[] = {1,3};
+link2[] = {1,4};
+link3[] = {3,1};
+link4[] = {4,2};
+globals[] = {0.000000,0,0,0,0,640,480,1,30,6316128,1,-395.307037,395.306915,93.428192,-337.575409,744,519,1};
+window[] = {0,-1,-1,-1,-1,721,66,1398,87,1,762};
+*//*%FSM</HEAD>*/
+class FSM
+{
+ fsmName = "updatetownmarkers";
+ class States
+ {
+ /*%FSM<STATE "Init">*/
+ class Init
+ {
+ name = "Init";
+ init = /*%FSM<STATEINIT""">*/"_lastUpdate = time;" \n
+ "_lastSV = [];" \n
+ "" \n
+ "_tcarm = 'WFBE_TOWNCAPTUREASSISTRANGEMODIFIER' Call GetNamespace;"/*%FSM</STATEINIT""">*/;
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
+ class Links
+ {
+ /*%FSM<LINK "Loop">*/
+ class Loop
+ {
+ priority = 0.000000;
+ to="Check_Towns";
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
+ condition=/*%FSM<CONDITION""">*/"time - _lastUpdate > 5 && !gameOver"/*%FSM</CONDITION""">*/;
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
+ };
+ /*%FSM</LINK>*/
+ };
+ };
+ /*%FSM</STATE>*/
+ /*%FSM<STATE "Check_Towns">*/
+ class Check_Towns
+ {
+ name = "Check_Towns";
+ init = /*%FSM<STATEINIT""">*/"_count = 0;" \n
+ "_units = (Units Group player) Call GetLiveUnits;" \n
+ "while {_count < totalTowns} do {" \n
+ " _location = towns Select _count;" \n
+ " _locationName = _location getVariable ""name"";" \n
+ " _maxSV = _location getVariable ""maxSupplyValue"";" \n
+ " _range = (_location getVariable ""range"") * _tcarm;" \n
+ " _sideID = _location getVariable ""sideID"";" \n
+ " _SV = _location getVariable ""supplyValue"";" \n
+ " _visible = false;" \n
+ " if (_sideID == sideID) then {_visible = true} else {{if (_x Distance _location < _range) then {_visible = true}} ForEach _units};" \n
+ " _marker = Format[""%1Depot"",Str _location];" \n
+ " if (_visible) then {_marker SetMarkerTextLocal Format["" SV: %1/%2"",_SV,_maxSV]} else {_marker SetMarkerTextLocal """"};" \n
+ " _lastSV set [_count,_SV];" \n
+ " _count = _count + 1;" \n
+ "};" \n
+ "" \n
+ "_lastUpdate = time;"/*%FSM</STATEINIT""">*/;
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
+ class Links
+ {
+ /*%FSM<LINK "Gameover">*/
+ class Gameover
+ {
+ priority = 0.000000;
+ to="End";
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
+ condition=/*%FSM<CONDITION""">*/"gameOver"/*%FSM</CONDITION""">*/;
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
+ };
+ /*%FSM</LINK>*/
+ /*%FSM<LINK "Loop">*/
+ class Loop
+ {
+ priority = 0.000000;
+ to="Check_Towns";
+ precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
+ condition=/*%FSM<CONDITION""">*/"time - _lastUpdate > 5 && !gameOver"/*%FSM</CONDITION""">*/;
+ action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
+ };
+ /*%FSM</LINK>*/
+ };
+ };
+ /*%FSM</STATE>*/
+ /*%FSM<STATE "End">*/
+ class End
+ {
+ name = "End";
+ init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
+ precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
+ class Links
+ {
+ };
+ };
+ /*%FSM</STATE>*/
+ };
+ initState="Init";
+ finalStates[] =
+ {
+ "End"
+ };
+};
+/*%FSM</COMPILE>*/ \ No newline at end of file