[Mod Question] Are there any mods for reference points management? (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios



Message


exsonic01 -> [Mod Question] Are there any mods for reference points management? (3/4/2021 5:16:21 PM)

I'm curious, are there any mods for the following:

1) Batch renaming of selected or all reference points from GUI
2) Copy and paste of selected, group of, or all reference points and/or waypoints from GUI
3) Rotation/translation of selected, group of, or all reference points and/or waypoints by mouse dragging from GUI

for the easy & quick management of RPs and WPs for both scenario design and gameplay.

Or, are there any ways to achieve these via CMO Lua console without GUI?

Regarding #1, I know there are some Linux/Unix commands or shell scripts with a for-loop for batch renaming, for example. But I don't know anything about Lua so I'm not sure if Lua can achieve batch renaming of RPs and WPs of interest.
Maybe I can open Lua, copy and paste contents to txt file, batch rename from Linux environment, and copy and paste back. But this will be bothering me if I need to open a Linux console to write a new script every time I wish to rename a bunch of reference points. So I wish to have an option of batch renaming inside the CMO.

Regarding #2, I guess this might be feasible from Lua, by copy and paste a group of reference points or waypoint of interest including coordinates. But I didn't try Lua so I'm not sure if this is OK.

Regarding #3, I think the best option would be the mouse-dragging from GUI because it is quick, intuitive, and simple. But if such an option is not possible, maybe Lua can help?
I think this may be possible by writing a converting function of 2D (latitude and longitude) coordinates of a group of RPs and WPs of interest, to rotate them A degree in CW/CCW direction, and translate them B nautical mile/km/mile in X & Y direction. If there is a way to create a small window of such a coordinate converter for a selected group of RPs or WPs and appear them in the CMO screen, that will be great. But I don't know if Lua can achieve this as I have no idea in Lua scripting with CMO.

I could write a shell script from Linux to covert them and copy and paste results to Lua. But this will be really bothering and time-consuming to do such actions every time I wish to move/rotate a group of RPs and WPs, this will break concentration and immersion. So I think it will be better to finish these actions inside the CMO.




musurca -> RE: [Mod Question] Are there any mods for reference points management? (3/4/2021 6:51:36 PM)

I wrote a debug library that adds some utility functions to the Special Actions menu while you're developing a scenario, one of which being the ability to copy RPs and paste them onto another side. It would be pretty easy to use that as a starting point for your own debug actions to rotate/translate those RPs.

Github link: https://github.com/musurca/cmo_debug




KnightHawk75 -> RE: [Mod Question] Are there any mods for reference points management? (3/5/2021 1:46:42 AM)

1,2,3 from gui. Not really. The problem there is unlike ScenEdit_SelectedUnits() there is no ScenEdit_SelectedReferencePoints() to grab all currently selected RP's.

re: 1 - You can however script that depending on what your needs are. IE - You can get list\table of ref point for each side though off the side wrapper and if they have a naming pattern you could mass rename from there matching your pattern and renaming each to your new pattern. On the creation side you can probably pick up thing or two from this basic one that creates spaced rp's between two existing points. http://www.matrixgames.com/forums/fb.asp?m=4821040

re:2 Ctrl-Z however will copy the guid,name,lat and lon of all currently selected RP's to clipboard
So yeah if you wanted to rename all of the above to "Blue_Rally-1...50" you could easily ctrl-z copy and paste into the Lua console something like this:
local copypasta={
--start ctrl-z-copy-paste
{name='Blue_RP-1', guid='4FH7PU-0HM6VDREODQFU', latitude='19.146222739293', longitude='110.17985528057'},
{name='Blue_RP-2', guid='4FH7PU-0HM6VDREODQFV', latitude='19.147822739293', longitude='110.17985528057'},
{name='Blue_RP-3', guid='4FH7PU-0HM6VDREODQG0', latitude='19.147822739293', longitude='110.18145528057'},
{name='Blue_RP-4', guid='4FH7PU-0HM6VDREODQG1', latitude='19.146222739293', longitude='110.18145528057'}
--end ctrl-z-copy-paste
} 
local counter = 0;
for key,entry in ipairs(copypasta) do
    counter = counter + 1
    ScenEdit_SetReferencePoint({side="Blue",guid=entry.guid,newname="Blue_Rally-" .. counter})
end
Waypoints are little different in that they are contained in the course table of each unit wrapper, and yes they can be changed, and or re-arranged as you may desire, in most cases, can provide you with more detail as needed.

For #3, Yes you can script the changing of the lat\lon's, relativity flags,etc, either to shift or rearrange them manually or relative to some other object. For instance if you wanted to create a rotating hurricane exclusion zone that moves a bit and rotates a bit say every 1min, you could script that, the tools via Lua and Command api and Events exist to so it. You can't create any windows though other than a basic text inputbox or message popup, not sure exactly what you meant by that. If you can script in any language Lua I found to be easy to pick up after learning a few of it's nuances. If you can't get something to work the way you want or can't figure out how to do or approach a particular thing after some trials post in the Lua Legion subsection and folks will happily try and point you in the right direction.

http://commandlua.github.io/
https://www.lua.org/manual/5.3/manual.html




exsonic01 -> RE: [Mod Question] Are there any mods for reference points management? (3/5/2021 4:59:14 AM)

Thank you guys, I will see if I can play with Lua. These days I'm busy with my works and learning C# & Harmony patching for another game. But I always wished to touch Lua as I really enjoyed CMO. The only thing I need is enough time for gaming and playing with the scripts XD.

quote:

You can't create any windows though other than a basic text input box or message popup, not sure exactly what you meant by that.

About creating a new window, this is about simplicity. I was just thinking of ways to achieve these ideas without opening Lua console and scripting.

In the middle of a 'big'-sized game, sometimes things become so complicated, that opening Lua console and scripting something might create a burden to some players. So, I was curious if the modder can create a mod to rotate/translate of selected group of RPs (or WPs) by creating a new "converter" window to show the process of converting without opening a Lua console. So that players can easily and quickly select a target group of RPs (or WPs) and type in the input value for rotation/translation.

But, oh well, if such options are not possible, then I better create my own function from the CMO-Lua environment.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.078125