Difference between revisions of "DCS command script"
From DCS World Wiki - Hoggitworld.com
m (1 revision imported) |
|||
Line 30: | Line 30: | ||
'''Optional Parameters''': | '''Optional Parameters''': | ||
|enum= N/A | |enum= N/A | ||
− | |exam= | + | |exam= The following would be used to automatically update a table with the current waypoint an AI group is on. The first segment of code is a globally accessible function that will populate and +1 the value associated with a given group. |
+ | |||
+ | local aiCurrentWaypoints = {} | ||
+ | function iterWP(gp) | ||
+ | local gName = gp:getName() | ||
+ | if not aiCurrentWaypoints[gName] then | ||
+ | aiCurrentWaypoints[gName] = 0 | ||
+ | end | ||
+ | aiCurrentWaypoints[gName] = aiCurrentWaypoints[gName] + 1 | ||
+ | end | ||
+ | |||
+ | The following would need to be added to every single waypoint as a script command for the groups you wish to update their WP status. | ||
+ | |||
+ | local gp = ... | ||
+ | iterWP(gp) | ||
|notes= | |notes= |
Revision as of 23:29, 13 December 2020