Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

IntelliSense for CMO via VSCode Sumneko and Emmy

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> IntelliSense for CMO via VSCode Sumneko and Emmy Page: [1]
Login
Message << Older Topic   Newer Topic >>
IntelliSense for CMO via VSCode Sumneko and Emmy - 8/30/2021 7:26:27 PM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
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)

Configuring your workspace to use the CMO_1147 workspace library files.


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)]





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.



Attachment (1)

< Message edited by KnightHawk75 -- 9/5/2021 11:13:13 AM >
Post #: 1
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 8/30/2021 8:19:50 PM   
BDukes

 

Posts: 1695
Joined: 12/27/2017
Status: offline
Well done. Will check it out

Mike

_____________________________

Don't call it a comeback...

(in reply to KnightHawk75)
Post #: 2
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 9/5/2021 12:23:04 AM   
BDukes

 

Posts: 1695
Joined: 12/27/2017
Status: offline
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

_____________________________

Don't call it a comeback...

(in reply to BDukes)
Post #: 3
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 9/5/2021 5:08:51 AM   
Kushan04


Posts: 683
Joined: 6/29/2005
Status: offline
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.

_____________________________


(in reply to BDukes)
Post #: 4
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 9/5/2021 11:11:06 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline

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.

(in reply to Kushan04)
Post #: 5
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 9/6/2021 5:13:54 PM   
Dimitris

 

Posts: 13282
Joined: 7/31/2005
Status: offline
This is SUPER helpful, thanks a lot!

_____________________________


(in reply to KnightHawk75)
Post #: 6
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 9/6/2021 10:54:59 PM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline

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).


(in reply to Dimitris)
Post #: 7
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 9/13/2021 12:49:21 AM   
Struan76


Posts: 36
Joined: 9/3/2019
Status: offline
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.

(in reply to KnightHawk75)
Post #: 8
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 9/13/2021 7:47:06 AM   
Parel803

 

Posts: 579
Joined: 10/10/2019
From: Netherlands
Status: offline
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

(in reply to Struan76)
Post #: 9
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 9/21/2021 12:05:49 AM   
jkgarner

 

Posts: 174
Joined: 4/30/2020
Status: offline
Most excellent!
Thank you Knight Hawkings!

(in reply to Parel803)
Post #: 10
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 11/14/2021 3:57:21 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
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.

Attachment (1)

< Message edited by KnightHawk75 -- 11/14/2021 4:23:22 AM >

(in reply to KnightHawk75)
Post #: 11
RE: IntelliSense for CMO via VSCode Sumneko and Emmy - 12/17/2021 7:59:38 PM   
BDukes

 

Posts: 1695
Joined: 12/27/2017
Status: offline
Can somebody pin this post to the top? Nice tool

_____________________________

Don't call it a comeback...

(in reply to KnightHawk75)
Post #: 12
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> IntelliSense for CMO via VSCode Sumneko and Emmy Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.391