summaryrefslogtreecommitdiffstats
path: root/Server/AI/Orders/AI_WPAdd.sqf
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:04 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-11 19:55:04 +0300
commitb06990293397d4b6d0374097f09d1cc5679216e3 (patch)
tree5719922562e317a8083250c178f24376b6692569 /Server/AI/Orders/AI_WPAdd.sqf
downloada2wf_saralite-b06990293397d4b6d0374097f09d1cc5679216e3.tar.gz
a2wf_saralite-b06990293397d4b6d0374097f09d1cc5679216e3.tar.bz2
a2wf_saralite-b06990293397d4b6d0374097f09d1cc5679216e3.zip
init
Diffstat (limited to '')
-rw-r--r--Server/AI/Orders/AI_WPAdd.sqf39
1 files changed, 39 insertions, 0 deletions
diff --git a/Server/AI/Orders/AI_WPAdd.sqf b/Server/AI/Orders/AI_WPAdd.sqf
new file mode 100644
index 0000000..ad04518
--- /dev/null
+++ b/Server/AI/Orders/AI_WPAdd.sqf
@@ -0,0 +1,39 @@
+/*
+ Author: Benny
+ Name: AI_WPAdd.sqf
+ Parameters:
+ 0 - Team
+ 1 - Clear (Remove WPs)
+ 2 - Waypoints (given in an Array)
+ Description:
+ This file is used to give a detailed WP system.
+ Exemple:
+ [_team, true, [[getPos _camp, 'MOVE', 10, 20, "", []],[[1560,2560,0], 'SAD', 50, 70, "", ["canComplete", "this sidechat 'lets roll'"]]...]] Call AddWP;
+*/
+
+Private ['_clear','_completionRadius','_position','_radius','_scripted','_statements','_team','_type','_waypoint','_waypoints','_WPCount'];
+_team = _this select 0;
+_clear = _this select 1;
+_waypoints = _this select 2;
+
+if (_clear) then {_team Call AIWPRemove};
+
+{
+ _position = _x select 0;
+ _type = _x select 1;
+ _radius = _x select 2;
+ _completionRadius = _x select 3;
+ _scripted = _x select 4;
+ _statements = _x select 5;
+ if (typeName _position == 'OBJECT') then {_position = getPos _position};
+
+ _WPCount = count (waypoints _team);
+
+ _team addWaypoint [_position,_radius];
+ [_team, _WPCount] setWaypointType _type;
+ [_team, _WPCount] setWaypointCompletionRadius _completionRadius;
+ if (_type == 'SCRIPTED') then {[_team, _WPCount] setWaypointScript _scripted};
+ if (count _statements > 0) then {[_team, _WPCount] setWaypointStatements [_statements select 0, _statements select 1]};
+
+ if (_WPCount == 0) then {_team setCurrentWaypoint [_team, _WPCount]};
+} forEach _waypoints; \ No newline at end of file