IntelliSense for CMO via VSCode Sumneko and Emmy (Full Version)

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



Message


KnightHawk75 -> IntelliSense for CMO via VSCode Sumneko and Emmy (8/30/2021 7:26:27 PM)

So I've been working on this for myself but but figured I'd share it since it's in a ~usable state, for myself anyway.

I've implemented nearly the entire CMO Lua documentation in a EmmyLua/sumneko workspace library that can be used with VSCode if you have sumneko's Lua language extension installed (a few easy clicks and a restart of VSCode).

VSCode: https://code.visualstudio.com/Download (free)
Finding sumneko's plugin for install and configuration after install and restarting VSCode (free)
[img]https://i.postimg.cc/tY7fx2Cy/find-Install-Extention-Lua-sumneko.jpg[/img]
Configuring your workspace to use the CMO_1147 workspace library files.
[img]https://i.postimg.cc/zLcBjdYN/Configure-Library-Path-Lua-sumneko.jpg[/img]

Example of what this buys you with a little usage of Emmy Lua comment 'type' tagging. If nothing else it's been handy as hell to not have to leave VSCode to look something up. The CMO__Constants are really just for hints and quick lookup reminders (though there is nothing preventing you from actually using them and loading them into a scene if you wanted too, though I may rework some of them. Also saves one from having to exclude all the built-in CMO functions to be ignored by the undefined-globa-diagnostics.

All functions are in there (unless I forgot one due to eyes glazing over) including some deprecated ones so that it could still be used for CMANO maybe too I think, though flagged a bunch depreciated. Additionally some less than documented ones are in there, along with fields here and there that have never made it into the docs. That said more or less it's the same as the website, with some corrections, and probably now a few of my own goofs.

Now onto the pics to give you idea of how it looks when in use. [click thumbnails for full image (and maybe a second time if better res is needed)]
[img]https://i.postimg.cc/cg3sc0c7/Emmy8.jpg[/img][img]https://i.postimg.cc/Y4ZrghQq/Emmy9.jpg[/img][img]https://i.postimg.cc/8fVTK9y2/Emmy7.jpg[/img][img]https://i.postimg.cc/75LwWgVZ/Emmy1.jpg[/img][img]https://i.postimg.cc/yDrs4kQX/Emmy2.jpg[/img]
[img]https://i.postimg.cc/0rpkM5jP/Emmy3.jpg[/img][img]https://i.postimg.cc/gnsGsM37/Emmy4.jpg[/img][img]https://i.postimg.cc/jLtszVnN/Emmy5.jpg[/img][img]https://i.postimg.cc/T5qfZ0Fp/Emmy6.jpg[/img][img]https://i.postimg.cc/ZCSqVB2W/Emmy10.jpg[/img]
[img]https://i.postimg.cc/7b763Msv/Emmy11.jpg[/img][img]https://i.postimg.cc/Js7zWw1m/Emmy12.jpg[/img][img]https://i.postimg.cc/hf1tw4Rp/Emmy13.jpg[/img][img]https://i.postimg.cc/D4VzV8zY/Emmy14.jpg[/img][img]https://i.postimg.cc/jD8dx85f/Emmy15.jpg[/img]
[img]https://i.postimg.cc/2L4SCrbj/Emmy16.jpg[/img][img]https://i.postimg.cc/Ny5G519z/Emmy17.jpg[/img][img]https://i.postimg.cc/Z04yfM1P/Goto-Type-Def1.jpg[/img][img]https://i.postimg.cc/2LkbV149/Goto-Type-Def2.jpg[/img]

Now I don't really use it the way it's demo'd there (I use it more for hints to jog memory), nor is any of that code remotely logical I was just typing random stuff to provoke the IntelliSense. I still have more to do over time, such as circle back to dbquery, implement each specific event trigger and action type separately for more convenience, not to mention lord knows how many spelling mistaking and display formatting that needs more tweaking. But don't expect too much more or things to work like other languages might I'm surprised I got working decently at all tbh give limitations of emmy and lua types in general.


In the attached zip there are two folders:
\CMO_1147 - The content in here represents the emmy-sumneko library.
\CMO_TestWorkspace - A sample VSCode workspace that you should just be able to open and then re-configure the Lua workspace user library setting to point to the path where ever you unzipped \CMO_1147 too.

If any of you actually try it out and have questions or actually find it useful let me know.





BDukes -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (8/30/2021 8:19:50 PM)

Well done. Will check it out[:)]

Mike




BDukes -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (9/5/2021 12:23:04 AM)

Installed tonight.

Very helpful. I've scratched the surface but it's already saved me a buttload of time not having to look something up.. Enjoy Sainthood!

Mike




Kushan04 -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (9/5/2021 5:08:51 AM)

Got it setup tonight as well and merged my existing lua workspaces into it.

Thank you for this. Only scratched the surface as well but I can already tell this is going to save me a lot of time.




KnightHawk75 -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (9/5/2021 11:11:06 AM)


quote:

ORIGINAL: Kushan04

Got it setup tonight as well and merged my existing lua workspaces into it.

Thank you for this. Only scratched the surface as well but I can already tell this is going to save me a lot of time.


Glad to hear it.




Dimitris -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (9/6/2021 5:13:54 PM)

This is SUPER helpful, thanks a lot!




KnightHawk75 -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (9/6/2021 10:54:59 PM)


quote:

ORIGINAL: Dimitris

This is SUPER helpful, thanks a lot!

You're welcome. Thanks for the feedback.
I'll try and keep it up to date and improve it over time (where possible).





Struan76 -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (9/13/2021 12:49:21 AM)

This is really nice, I just got around to setting it up today. Thanks for being so generous in sharing your code and your time.




Parel803 -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (9/13/2021 7:47:06 AM)

KnightHawk, thank you, looks great. No doubt I'll gonna have quetions later on :-)
For now it looks for me to be used as reference.
best regards Gert-Jan




jkgarner -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (9/21/2021 12:05:49 AM)

Most excellent!
Thank you Knight Hawkings!
[&o][&o][&o][&o][&o][&o]




KnightHawk75 -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (11/14/2021 3:57:21 AM)

Sumneko CMO Library Updated for CMO 1.04 - build 1147.35

I have tested this with Sumneko 2.4.0 and vscode 1.59.1, 2.4.7 I think is current sumneko extention build and it should work fine, but I wanted to bang out this update first before touching\updating my vscode and extentions environment to the latest.

Attachment: CMO_1147_35-posted_11-13-2021.zip (~63k) - distribution includes latest and basically same sample workspace as original.

To update one only needs copy the contents of CMO_1147 over the existing old files, actually really only need copy CMO_1147\library\CMO_FuncsAndClasses.lua over where ever you put your install as it's all that's really changed.

Idk if there is an equivalent recent pro release that these updates apply to as well but I'm assuming most of these are either there already or will be very shortly, but here is the changelog(also included in the zip):

11-13-2021 (change in CMO Builds 1147.31 through 1147.35)
----
Unit Wrapper/Object:
+airbornetime_v property (thank you thank you thank you!)
~airbornetime property tweaked comment. (removed notice about lack of _v version)
+readytime_v property (thank you thank you thank you!)
~readytime property tweaked comment. (removed notice about lack of _v version)
+crew property
+jammed property (This is gonna be sooo useful!)
+jammer property (This also makes life sooo much easier for certain things)
+groundspeed property
+pitch property
~filterOnComponent() method - updated for optional dbid second param. (handy)
+angleOnBowToUnit() method
+getUnitMagazine() method (handy)
  ^ Added related CMO__DeviceMagazine class and properties.
  Added setExactWeaponQuantity() method to CMO__DeviceMagazine class.
  Added related CMO__TableOfDeviceWeaponLoads alias for table of <number,DeviceWeaponLoaded>
  Added related CMO__DeviceWeaponLoaded class and properties (for .weapons table entries as it's different from regular CMO__WeaponLoaded table as it's missing wpn_type).
+getUnitMountMagazine() method (handy)

CMO__Loadout Wrapper/Object:
+setExactWeaponQuantity() method (boy will these make life easier)

Scenario Wrapper/Object:
+fields property
+ContentTag property (included but I purposely didn't go into detail)
+GameMode property byte (don't know what values represent yet have to playtest)
+GameStatus property byte (don't know what values represent yet have to playtest)
+ResetLossExp() method
+ResetScore() method

Contact Wrapper/Object:
+ lastDetections property table (so stoked this exists now!!!!!)
+ CMO__ContactDetection class containing properties for each lastDetection table entry (though little unclear what the values for special_mode are just yet as haven't had chance to play around much yet).
+ CMO__TableOfContactDetections alias representing table of <number,CMO__ContactDetection>

Other:
+Added CMO__DeviceMount definition (wasn't really necessary atm but maybe in future)
~tweaked a few field types for CMO__WeaponLoaded (couple of things were marked as strings when they were ints/numbers)
~minor text\descriptions tweaked in a few other places.
~updated build numbers and release info in the header of CMO_FuncAndClasses.lua
~changelog added to distribution.
----


If at least one of you could update and verify that thing seems to be working with this release and just post that when you have time, that would be helpful. Then I'll update the top post with the attachment from this post so there aren't too many different versions floating around over time (then again maybe it's useful having at least the last 2 around? [&:]). Much thanks to the dev team for all the recent additions, most of them I know were fulfilling specific user requests.




BDukes -> RE: IntelliSense for CMO via VSCode Sumneko and Emmy (12/17/2021 7:59:38 PM)

Can somebody pin this post to the top? Nice tool[:)]




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.71875