Okay… but when using the zip from GitHub it doesnt get included… also what happens if they remove the repos? (not saying they will… but you never know ;))
Always the pessimist! 🙂
I’ll have a look at it tonight.
Edit: Done. Now using the official 5.3.3 release.
I’ll have to have a good play over the weekend 🙂
(BTW luadist folder is still there)
Fixed. Stupid git (not you).
git rm --cached native/luadist
I’m working on a simple Mojo demo project at the moment, hopefully with a “reload script” shortcut. At the moment you’re mostly limited to calling MX2 functions that you declare yourself, so it’s still WIP for usefulness. Coming along, though!
Reloading scripts will need to use DoFile rather than DoString(LoadString), as I believe the assets get baked into the distribution.
Note when using DoString/DoFile/PCall, make sure to wrap it with an if statement and grab the string value at the top of the stack. If there was an error somewhere in your script, that error message will be on the stack. You can also give custom error messages in your MX2 registered functions using state.Error/ lua_error. This will push the error message and raise an exception that’s caught by the Lua VM. Note that this call does a long jump and never returns.
Worked a bit more on the class binding. At the moment you still need to know how to do some low level stuff, but I hope to make this cleaner in the future.
I added a very simple Mojo demo, too. It has a placeholder for “script reloading”, but you’ll need to change it to DoFile and make sure the Lua file is in the right place. Whenever I test it from my build script, it tries to look in the root monkey2 directory rather than the current directory.
I’d love to see some of your usage examples so that I know how to make it betterer! Note: Coroutines are much nicer for handling entity logic, rather than constantly calling DoString as in my example.
Version 0.1.0 tag added and uploaded for review.
You must be logged in to reply to this topic.
Monkey2 is an easy to use, cross platform, games oriented programming language from Blitz Research.