Debug actions for creating scenarios

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
musurca
Posts: 168
Joined: Wed Jul 15, 2020 10:06 pm
Contact:

Debug actions for creating scenarios

Post by musurca »

Hi-- while creating a larger scenario, I found myself spending a lot of time on various repetitive tasks in the Lua Script Console, so I decided to automate them to save some time. Posting it in case it's useful to anyone else.

Download it here

This debug framework creates a number of special actions that will persist between saves. You can:

- Label a geographic coordinate by placing a reference point at a latitude/longitude. You can paste in coordinates in various formats and they should (nearly always) be parsed correctly. "49°58′33″N 006°41′50″E," "49 58N 6 42E", "49, 6" are just a few options that should work.

- Disable AI processing for selected groups of units. This will set both AI_EvaluateTargets_enabled and AI_DeterminePrimaryTarget_enabled to false. (Great for large groups of facilities.)

- Set fuel percentages for selected groups of units. You can either set an exact percentage or a random percentage between a minimum and maximum.

- Set heading and speed for selected groups of units.

Installation is easy: you just open the debug_min.lua file, paste the contents into the Lua Script Console, then click RUN. It will attach the debug components to your scenario and they will stick around after you save the scenario.

When you want to get rid of the debug actions before release, just click the action marked [REMOVE DEBUG FRAMEWORK] and they'll be removed.

I also put the unminified source code on GitHub in case anyone wants to extend it by adding new actions.


Image
Image
Parel803
Posts: 962
Joined: Thu Oct 10, 2019 3:39 pm
Location: Netherlands

RE: Debug actions for creating scenarios

Post by Parel803 »

looks great,
thank you. Gonna try it when time permits.

with regards GJ
Post Reply

Return to “Lua Legion”