Should fix some outstanding issuesĬleaned up internal macros to use the templating systemĪbility to add the metadata to a function to attempt to automatically add a hook for it. Overhauled some macro generation, panels are now properly defined. Must be static.ĭocumentation is now copied from parents if not defined yourself. Properties now should work for gamemode/entities. If you like lua because of it's dynamic typing, there's not much point in using haxe. If this is the case, please file an issue! Anything that helps this library be more accessible and easier to use is appreciated.
![gmod lua wiki gmod lua wiki](https://i.imgur.com/qCxVDuU.png)
There will be edge cases where incorrect lua is generated, or what you're trying to do hasn't been properly mapped into this library. If your're making something small, or maybe even medium sized and you already know and love lua, then there's not much point in learning haxe.
Gmod lua wiki code#
If your code is performance critical and is not a large project, you're better of just using lua directly instead.
Gmod lua wiki full#
There's no getting away from it, the code that is made using Haxe -> lua is going to be larger (see -dce full for mitigations), and less efficient than handwritten lua code.
![gmod lua wiki gmod lua wiki](https://static.wikia.nocookie.net/gmod/images/d/db/GmodSMenu.png)
However, Haxe -> lua is not free of flaws, and certainly does not fit every use case. Haxe compiles to C#, and as such it should be totally possible to create an addon that compiles to both S&Box and gmod! This won't solve the issue of library compatability between the two games, it is likely you would have to make your own layer between the two APIs, however, you can be assured that the bulk of your logic is not locked to one platform. Less context switching requiredĪs a bonus, you can also utilise great haxe libraries that are cross platform compatabile!Īlso, it seems S&Box is going to have C# as it's scripting language. This means you can create projects that talk to gmod lua in one consistent language + syntax. This enables gmodhaxe to copy your build on save, meaning you can develop a lua addon from your documents folder instead of delving into the depths of your gmod installation each timeĬlass syntax is free, and always the same instead of being DIY
![gmod lua wiki gmod lua wiki](https://i.pinimg.com/736x/4d/95/3d/4d953df5e1d268ba54c2821f5ccb95dc--garry-s-mod-stuff-to-buy.jpg)
When developing a gamemode, nothing is worse than being trapped in the cycle of save code -> run through game -> mispelled variable name -> back to square one Type all the things! Compile errors instead of runtime errors! Horray! Not just hacked onto lua, and so a lot more reliable Haxe comes with some advantages over just plain (gmod) lua development Pros
Gmod lua wiki how to#
This has been developed alongside a new gamemode I hope to release soon, you can check it out if you want more detailed examples on how to use this library. Things may be improperly typed, and therefore if you see any out of date documentation, definition or need to use a new function not avaliable, please submit a pull request or an issue. (i.e only functions that exist in server/client will autocomplete/build in current context)Įxterns have been generated from scraped info from an older version of the gmod wiki. Haxe is a strictly typed language that compiles to lua (+ many other languages like javascript/c++/c#).Īll externs are fully client/server context dependent, so will only work in proper context
![gmod lua wiki gmod lua wiki](https://static.wikia.nocookie.net/gmod/images/7/7d/20200729123031_1_(2).jpg)
Haxe externs for gmod + macros intended for gamemode development.