Page 1 of 1

Debug actions for creating scenarios

Posted: Wed Feb 10, 2021 4:01 am
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

RE: Debug actions for creating scenarios

Posted: Wed Feb 10, 2021 7:50 am
by Parel803
looks great,
thank you. Gonna try it when time permits.

with regards GJ