• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

HIVE

Malhorne
Malhorne
Ah so it might be interesting, but I prefer Lua anyway so I chose my side already.

Oh don't worry I know how template meta programming works especially this training by a C++ committee guy x)

However the huge problem of template metaprogramming is the lack of tools to debug it since it's resolved at compile time.
D
Deleted member 219079
I was thinking, if TS gets transpiled to Lua, shouldn't I use Lua to get maximum performance? Maybe with some textmacro preprocessor and WC3 object generator...

Which is why you should use constexpr whenever possible, instead of TMP. Boost.Hana does assertions (e.g. satisfies concept 'Nomadic'?) to validate the parameters, but that of course leaves a lot of ways to do things wrong.
Malhorne
Malhorne
Lua is cool man, easy to learn, lack some syntaxic sugary stuff but I like it overall.
I should get back the object generator it was quite interesting but never got too deep in it. Was it relevant in 1.26? I don't completely remember tbh.

I totally agree that you should use constexpr whenever it is possible, however that does not prevent the fact that if you do a lot of template metaprogramming shit will surely happens haha
D
Deleted member 219079
I've no idea. But isn't JassHelper's Lua object generation pretty old? I'd think it's a thing in 1.26. And guess what language also does object generation? :D https://wurstlang.org/manual.html#object-editing-natives

If you're interested in epitome of TMP, look at work of Louis Dionne, Boost.Hana developer who's nowadays working for Apple. My favorite is this: https://github.com/ldionne/dyno
Polymorphism without inheritance and with VALUE SEMANTICS! So you're not forced to pass instances of polymorphic classes with pointers.
Malhorne
Malhorne
I used to do it a bit so I think it existed in 1.26. I just need to refresh my memory and see if it works in my workflow. If it does I'll probably do most of the stuff with object generation because sometimes it is painful to do mass dummy spells.
Yes but does Wurst generates Lua object generation or does it by itself?

That looks interesting I keep the link and I might read it for culture :)
D
Deleted member 219079
I dunno, but it's pretty trivial to do it by oneself. I've made an object generator in C++ as well.
Malhorne
Malhorne
Oh okay so it must be doing it by itself.
To be honest I never fooled around other stuff than the .j inside the mpq archives haha
D
Deleted member 219079
Yeah.
I noticed Linux is supported by this Lua map builder: https://github.com/ElusiveMori/ceres-wc3
Or at least is mentioned ("Runs on Windows and Linux"). So maybe it indeed is possible to get the current patch working on Linux?
Malhorne
Malhorne
It's weird, it's like a 2019 repository, but isn't the Lua support supposed to be official?
Early 2019 it was possible to run it. And here they are not doing anything for you just explaining what the script needs to be fooled to run as if it was Windows XD

To be honest I stopped my researches as soon as I had a modding workflow even it is a 1.26 installation because I basically wanted to have some fun. I'll continue a bit later with posts on r/warcraft and r/linuxgaming and lutris forums.
D
Deleted member 219079
Well, it's meant to externalize scripting, so you can use, say, VS Code (this you can't do with the official WE). I just set up a Ceres project myself. I'm too big a boomer to use that TS template; it's a mass of temp files and dependency files, whereas Ceres is just one executable you can put to PATH.
Malhorne
Malhorne
What do you mean by externalize scripting? I already exported all of my vJASS scripts outside of the normal WE because it is the old ones that does not support vJASS.
What's Ceres?
D
Deleted member 219079
Ceres is the project I linked in my previous comment. It's like you do 'jasshelper.exe common.j Blizzard.j war3map.j map.w3x ' for JH to use external map script (war3map.j), but for Lua!
Malhorne
Malhorne
Oh sorry I did not catch the name. I currently do better because each trigger in my map contains
//! import vjass "FILE/PATH/FILE.j"
And then JH finds the file, imports them and then parse them. So I can have my own directory structure independently of W3 Editor.
D
Deleted member 219079
That's what I've done with my vJASS projects too. And with Ceres it looks for ./src/main.lua and injects it into ./maps/map.w3x/war3map.lua.

I just learned that Lua has iterators, whoa! So much in such a tiny language. However, I really miss specifying types, especially for function parameters and return values. It's a way of engaging in a contract of 'you give me two ints and I'll give you a string, okay?'. Now if the types aren't documented anywhere, how do I know what to pass? No worries, the compiler will catch it.. oh wait! It just fails in-game! >.<
Malhorne
Malhorne
So you have to put everything inside one file or you can still split in multiple files?

Yeah Lua is a very cool boi!
Ahah you're a deep lover of static typed languages x)
I don't mind dynamically typed languages as long as you don't do spaghetti code.
And nobody prevents you from doing a good comment string before the function explaining the parameters and return types.
D
Deleted member 219079
There's import function: require('dir.dir.file') looks for './lib/dir/dir/file.lua' and './src/dir/dir/file.lua', where src has project-specific files and lib dependencies.

Yeah, documentation is key. And a good editor can deduce types for your variables if you follow some documentation standard, e.g. VS Code's IntelliSense will parse JSDoc notation and deduce your JS variable types that way.

I've been reading all day about Lua, I'm reading this online book: https://www.lua.org/pil/contents.html
It's written for Lua 5.0 but they promise it's remained relevant. I'll have written something concrete very soon. :)
D
Malhorne
Malhorne
Oh shit I thought I had answered the previous message.

Concerning Lua, the 5.1 is the most renowned because of it's amazing just in time compiler, I guess the 5.0 is very close to the 5.1. I like this language because it is easy to pick up but you also have some very strange stuff for complex use cases.
Definitely agree with the require stuff. It is just the way you presented it made it sound like there were only file (because at the end there's only one jass script which is run by the JASS VM). Maybe they switch this one file behaviour in latest patches I don't know.

SO THAT WAS THE FUCKING VIDEO INTRODUCTION. Because I did everything he mentioned in Linux, even managing to have a perfectly smooth battle net (which is kind of useless for the purpose).
I shall try it again when I've got some time, thanks for the link!
D
Deleted member 219079
Ah sorry, I should've been more clear about Ceres...

Yeah, its features have amazed me. I've embedded Lua once or twice into my C++ projects. I never paid attention to its features, I just noticed it was much smaller than Python. I guess that made me consider Lua a tiny language less featured than Python. I deemed it a petty parvenu that's only used because it's so lightweight in comparison to feature-rich Python.

I didn't know about Lutris, with whom you can get Overwatch, WoW, Witcher 3 and many other titles to work. It truly entices me to try Linux again. However, call me a brute, but I have hard time finding bad stuff about W10. Visual Studio is nonpareil for C++ programming, and I have a complex setup where 2 of my monitors use discrete graphics card and one, plugged into motherboard directly, uses Intel Graphics. Windows Update installed drivers and assigned displays for these monitors automatically!
Malhorne
Malhorne
Yeah it's very small, fast and have enough features to be embedded. Very interesting but sadly way too overlooked. It is also becoming a meme because of the Lua JiT shitstorm ^^'

I mean you could get these without Lutris. Lutris is providing a way to manage with a more user friendly way the different wine prefixes/versions/configurations. Also it enables the sharing of these configurations through JSON and grew as a community. It basically succeeded where PlayOnLinux failed imo.
And tbh I never had a tiny problem playing WoW on a Linux computer, even on my toaster of a computer lol (the life of a GM/RL on Linux, fun memories).

I plainly hate Windows and all of these GAFAM companies so you got my point :p
I can get monitors and applications running on Intel Integrated GPU or Nvidia GPU. Took me some time to make it work because Nvidia is not amazing with Linux (although it's getting better).
Top