Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
I recently decided to switch to an actual editor for my code, instead of just using Xed on individual text files. The Editor I chose was VSCodium. There are a number of advantages here, but there's a slight problem.
Consider the following:
JASS:
//===========================================================================
function CountUnitsInGroup takes group g returns integer
// If the user wants the group destroyed, remember that fact and clear
// the flag, in case it is used again in the callback.
local boolean wantDestroy = bj_wantDestroyGroup
set bj_wantDestroyGroup = false
set bj_groupCountUnits = 0
call ForGroup(g, function CountUnitsInGroupEnum)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(g)
endif
return bj_groupCountUnits
endfunction
That is a snippit from blizzard.j downloaded here.
Now, it is simply valid to, in Lua, call
JASS:
myVar = CountUnitsInGroup(myGroup)
and it will just work in-game.
However, the signature of
JASS:
function CountUnitsInGroup takes group g returns integer
Is not considered valid by the Lua language server.
So, I vibe-coded a script to re-write all JASS functions and natives like
JASS:
native CreateForce takes nothing returns force
as Lua, and then manually fixed a few things that it was still complaining about, and decided to upload them here.
I also manually added
JASS:
function FourCC(thing) return thing end
because apparently the FourCC() function doesn't exist in the .j files for some reason.
What these files do is when you add them to a Lua project in VSCodium (it probably works in VSCode, too), they make stop erroring on JASS functions, which WC3 recognizes, but the Lua server doesn't.
This is NOT a complete re-writing of all JASS functions in Lua. All if does is make VSCodium's linter recognize them because they're now valid, defined functions.
Also, disclaimer to anyone who wants to use VSCodium, I don't know a good way to export a VSCodium project into the actual Trigger Editor outside of copy-pasta'ing each text file, but having VSCodium's linter has still increased my sanity by like 50% in the first 4 hours of using it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.