Command lua documents
Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command
- michaelm75au
- Posts: 12455
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Command lua documents
I am working on updating the page. Basically one function/wrapper/method at a time.
If there are any actual errors that you have noticed, please add them here.
If there are any actual errors that you have noticed, please add them here.
Michael
-
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
Re: Command lua documents
I've noticed the updates over the last week or so. My 2 cents is it's harder to read now (more scrolling involved, harder on the eyeballs to quickly scan something) but maybe I just have to get used to it, but opinions I'm sure vary. I haven't noticed any new errors, but will post if I do over time.
- michaelm75au
- Posts: 12455
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Command lua documents
Yes, there is a lot of information on that one page.
I use the side navigation to get to the section I want (eg wrappers).
And then click on the wrapper in question which should jump me to the wrapper details.
Even then some entries can have a items under it (eg unit wrapper).
I use the side navigation to get to the section I want (eg wrappers).
And then click on the wrapper in question which should jump me to the wrapper details.
Even then some entries can have a items under it (eg unit wrapper).
Michael
- michaelm75au
- Posts: 12455
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Command lua documents
I'm looking at splitting the one 'index' page into other 'pages' so it is not all one page to see if that helps. So clicking on say Functions, will bring up just the functions on the screen.
Michael
- nukkxx5058
- Posts: 3141
- Joined: Thu Feb 03, 2005 2:57 pm
- Location: France
Re: Command lua documents
Hi, I think this is not correct. Are these subtypes or categories ? Where are the subtypes (both parts say "category codes"). Are "mobile vehicles" fixed facilities ? Can't find any 2000 category. Pretty much unclear imo ...
Winner of the first edition of the Command: Modern Operations COMPLEX PBEM Tournament (IKE) (April 2022)
- michaelm75au
- Posts: 12455
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Command lua documents
That is correct, but the 'Mobile' relates to a new type of unit 'Ground' which is not in the Public builds.
I'll update the page to indicate it is 'Pro Only' at the moment.
I'll update the page to indicate it is 'Pro Only' at the moment.
Michael
- nukkxx5058
- Posts: 3141
- Joined: Thu Feb 03, 2005 2:57 pm
- Location: France
Re: Command lua documents
Ah Ok ! I see.
But otherwise it says category and subtypes. but I see just one list of codes. Are these subtypes or categories ?
And what does "description = code" means ? Shouldn't it be code = description to keep the same order ?
Generally speaking, a short explanation would be very welcomed ... as well as examples - they are often missing in the Lua doc.
I find it all rather confusing and quite hard to use the Lua documentation. Probably because I'm not a seasoned programmer.
But otherwise it says category and subtypes. but I see just one list of codes. Are these subtypes or categories ?
And what does "description = code" means ? Shouldn't it be code = description to keep the same order ?
Generally speaking, a short explanation would be very welcomed ... as well as examples - they are often missing in the Lua doc.
I find it all rather confusing and quite hard to use the Lua documentation. Probably because I'm not a seasoned programmer.
Winner of the first edition of the Command: Modern Operations COMPLEX PBEM Tournament (IKE) (April 2022)
-
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
Re: Command lua documents
This not entirely so Michael, it relates to the category code for the mobile type facility. Ie those of type facility, category 500x. The category in non-pro is picked up based on textual parsing of the unit name for those of category 5001. ie "SAM Bn ...xyz" is type: facility, sub-type 5001, category 6, something with " Mech Inf ...." will be category 11. Place a s400 and do a print(unit.category) you'll get 6 back. It's also used in filters for unitsBy(type,[category][subtype]).michaelm75au wrote: ↑Tue Mar 15, 2022 2:15 am That is correct, but the 'Mobile' relates to a new type of unit 'Ground' which is not in the Public builds.
I'll update the page to indicate it is 'Pro Only' at the moment.
Yes if you just add 000 to each it's identical to GroudUnitType so I understand why it's confusing.
What we're talking about is defined in enum MobileUnitCategory in the Facility class.
The documentation line item should remain unchanged but the data for that entry should read:
Code: Select all
0 = None
1 = Infantry
2 = Armor
3 = Artillery Gun
4 = Artillery SSM
5 = AAA
6 = SAM
7 = Engineer
8 = Supply
9 = Surveillance
10 = Recon
11 = MechInfantry
Ground Unit Category (pro only)
Code: Select all
0 None
1000 Infantry
2000 Armor
3000 Artillery Gun
4000 Artillery SSM
5000 AAA
6000 SAM
7000 Engineer
8000 Supply
9000 Surveillance
10000 Recon
11000 MechInfantry
Code: Select all
1001 Troop Carrying
1002 Open Topped
2001 Amphibious
2002 Combat Swimmer
3001 Reactive Armor
3002 Mesh Skirting
3003 Depleted Uranium Armor (1st Gen)
3004 Depleted Uranium Armor (2nd Gen)
3005 Depleted Uranium Armor (3rd Gen)
4001 Wheeled Vehicle
4002 Half-Track Vehicle
4003 Tracked Vehicle
- michaelm75au
- Posts: 12455
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Command lua documents
As I am going thru every line of the documents at the moment, I will be checking and correcting the page or code that may be incorrect.
One thing I am doing is expanding the function details; they will be more consistent in what they show.
Also I am putting in the actual parameters that are valid for the function rather than relying on the 'selector'. I have found that the 'Selector' is often too broad and doesn't indicated additional (or not valid) items.
This also helps in that you don't need to jump back and forth between the command and the selector pages. Example below
One thing I am doing is expanding the function details; they will be more consistent in what they show.
Also I am putting in the actual parameters that are valid for the function rather than relying on the 'selector'. I have found that the 'Selector' is often too broad and doesn't indicated additional (or not valid) items.
This also helps in that you don't need to jump back and forth between the command and the selector pages. Example below
Michael
-
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
Re: Command lua documents
I think that will be very helpful and welcomed by most.michaelm75au wrote: ↑Thu Mar 31, 2022 7:16 am As I am going thru every line of the documents at the moment, I will be checking and correcting the page or code that may be incorrect.
One thing I am doing is expanding the function details; they will be more consistent in what they show.
Also I am putting in the actual parameters that are valid for the function rather than relying on the 'selector'. I have found that the 'Selector' is often too broad and doesn't indicated additional (or not valid) items.
This also helps in that you don't need to jump back and forth between the command and the selector pages.lua doc
Example below
Re: Command lua documents
Here's one I ran into just tonight:
World_GetCircleFromPoint (table) -
Parameters:
latitude
longitude
numpoints
Need to add "radius" (expressed in nautical miles) to the list of parameters
local t = World_GetCircleFromPoint({latitude=45, longitude=45, numpoints=16, radius=10})
World_GetCircleFromPoint (table) -
Parameters:
latitude
longitude
numpoints
Need to add "radius" (expressed in nautical miles) to the list of parameters
local t = World_GetCircleFromPoint({latitude=45, longitude=45, numpoints=16, radius=10})
-
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
Re: Command lua documents
current:
Proposed:ReferencePointSelector
Reference point selector.
To select reference point(s), specify either
name and side, to select a reference pointname belonging toside [name AND side if possible] or
guid, if the unique ID of the reference point is known [preferred] or
area, table of reference points (name or guid)
GUID method takes precedence over name/side if both present.
...
For instance you can't use DeleteReferencePoint({guid=validguidhere}) at present in 1147.44 or prior, you need to provide the side as well.ReferencePointSelector
Reference point selector.
To select reference point(s), specify either
name and side, to select a reference point name belonging to side or
guid, if the unique ID of the reference point is known [preferred] or
area, table of reference points (name or guid) - valid for certain functions, such as GetReferencePoints().
GUID method takes precedence over name/side if both present.
In cases where side is not know by context, then both guid and side may be required, such as DeleteReferencePoint().
...
-
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
Re: Command lua documents
ScenEdit_SetMission | AAR table.
The documentation leads one to believe TankerMissionList accepts names or guids, such as
TankerMissionList= {'support mission1','support mission2'}; is valid when it is not. At present it must be the mission guid.
ie
TankerMissionList= {'ABCDEF-0000000000123','ABCDEF-0000000000124'};
The code that looks up and the array entry text is fine (it checks both name or guid successfully) and returns the mission, however the outer call also does a check upon return and it only validates/compares checks on the guid property vs the entry text. The later seems to not know the former already did the validation for it, so other then the null check the rest of the extra checks causes the issue (and probably no longer needs to be there).
So either the docs need clarity, or the code eyeballed and tweaked to work as expected and believe already desired.
The documentation leads one to believe TankerMissionList accepts names or guids, such as
TankerMissionList= {'support mission1','support mission2'}; is valid when it is not. At present it must be the mission guid.
ie
TankerMissionList= {'ABCDEF-0000000000123','ABCDEF-0000000000124'};
The code that looks up and the array entry text is fine (it checks both name or guid successfully) and returns the mission, however the outer call also does a check upon return and it only validates/compares checks on the guid property vs the entry text. The later seems to not know the former already did the validation for it, so other then the null check the rest of the extra checks causes the issue (and probably no longer needs to be there).
So either the docs need clarity, or the code eyeballed and tweaked to work as expected and believe already desired.
- michaelm75au
- Posts: 12455
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Command lua documents
I have done my first pass thru the Lua Command Doc, and corrected/expanded several items.
One big change is that the functions will bring up their own page. This will allow the functional details and examples to be expanded on for each function without impacting the overall page view like it is currently with just the one page.
http://commandlua.github.io/index2.html
I still need to review these functions as of new big 'beta' build (1243??) as there has been some changes.
So this is still a work in progress at the moment, but you can still use the new link above if you wish.
One big change is that the functions will bring up their own page. This will allow the functional details and examples to be expanded on for each function without impacting the overall page view like it is currently with just the one page.
http://commandlua.github.io/index2.html
I still need to review these functions as of new big 'beta' build (1243??) as there has been some changes.
So this is still a work in progress at the moment, but you can still use the new link above if you wish.
Michael
- michaelm75au
- Posts: 12455
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Command lua documents
I have picked this up in the last round of checks.KnightHawk75 wrote: ↑Sun May 08, 2022 10:00 am ScenEdit_SetMission | AAR table.
The documentation leads one to believe TankerMissionList accepts names or guids, such as
TankerMissionList= {'support mission1','support mission2'}; is valid when it is not. At present it must be the mission guid.
ie
TankerMissionList= {'ABCDEF-0000000000123','ABCDEF-0000000000124'};
The code that looks up and the array entry text is fine (it checks both name or guid successfully) and returns the mission, however the outer call also does a check upon return and it only validates/compares checks on the guid property vs the entry text. The later seems to not know the former already did the validation for it, so other then the null check the rest of the extra checks causes the issue (and probably no longer needs to be there).
So either the docs need clarity, or the code eyeballed and tweaked to work as expected and believe already desired.
Thanks
Michael
Re: Command lua documents
Good evening,
Got on this page: https://commandlua.github.io/assets/Fun ... sions.html
an error 404, file not found
Can be on my side but just to let you know.
best regards GJ
Got on this page: https://commandlua.github.io/assets/Fun ... sions.html
an error 404, file not found
Can be on my side but just to let you know.
best regards GJ
- michaelm75au
- Posts: 12455
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Command lua documents
Yea, it is missing from the upload. I will find and repost to docs.
Michael
-
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
Re: Command lua documents
Found another one generating 404 for Tool_LOS_Points.michaelm75au wrote: ↑Sun Jan 15, 2023 11:58 am Yea, it is missing from the upload. I will find and repost to docs.
http://commandlua.github.io/assets/Func ... oints.html
- michaelm75au
- Posts: 12455
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Command lua documents
Should be fixed. The case of the file name was different to that uploaded to github.
Michael
-
- Posts: 1850
- Joined: Thu Nov 15, 2018 7:24 pm
Re: Command lua documents
Any chance we could get UI_SelectUnitPrompt_FromSides() and _OwnSide, and Tool_UIwindow docs?
Also fyi under Wrappers, Zones, the zonemarker link goes to 404 link.
Also fyi under Wrappers, Zones, the zonemarker link goes to 404 link.