Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
I recently had the idea if I should stream some LunaLua live development. Just say if you would be interested or not.
Because I get often ask where you can download LunaLua, I make a own topic about it.
LunaLua is a addition to lunadll which adds the script language lua. The problem with Autocode (the lunadll-language) is the lack of flexibility that it has (such as the way it lacks custom functions, variables,... etc). With this we don't need any hardcoded code for complex ideas anymore.
So first of all: What is lua?
Lua is an actual script language, which supports custom functions, variables and much more. The script type is something like JavaScript + Visual Basic
Cool, I hope this awesomeness will be stickied! You could add into the post some example videos, which were posted at PGE forum too, that would be better in my opinion
So, apparently, LunaLua isn't working for me. I saved this test code in a lunaworld file (obviously in .lua format) but nothing happens. I still need a new exe or something?
* loadAPI is no longer using 'require'. I've writte my own loading function.
It will search in following paths for an API:
"{SMBXPath}\LuaScriptsLib\{apiName}.lua"
"{SMBXEpisodePath}\{apiName.lua}"
"{SMBXEpisodePath}\{CustomLevelFolder}\{apiName}.lua"
* loadSharedAPI added: Loads or gets (if already loaded) a shared instance of an API. (lunaworld.lua and lunadll.lua will reference the same API memory)
* hud(boolean displayHud) add: Toggle hud display on/off
Because there are lot of code changes I mark this version as "BETA". If there are any problems then please let me know!
SnifitGuy wrote:Could you possibly make an updated reference page? I know it may sound stupid, but I just don't want to have to go searching everywhere for new kinds of codes. Also, I tried using this code to display text, but it won't work. Any help?
Code:
Try to run Autocode (aka. lunadll.txt with some debug code) first. Because when it is executing then it is a issue on my side. Also please check if you have a folder in your main dir called "LuaScriptsLib".
LunaLua is now v0.5 BETA. We can now run code in the overworld YAY!
To run your code for the overworld make a file called "lunaoverworld.lua" in your episode dir.
Q: Can we run Autocode (lunadll.txt).
A: No you can only run lua code.
Q: Could you implement Autocode for overworld?
A: I could, but it would take way too long time. If kil does it then I am fine.
Q: Can we deactivate the world HUD?
A: No (maybe later), but the render code is the last painting code which is called. So you can overdraw everything if you want to.
Q: Why BETA?
A: There might be some bugs floating. If you have any issues please report them to me!
* Added world class with following functions and properties:
** field double world.playerX
** field double world.playerY
** field int world.playerWalkingDirection
** field int world.playerWalkingTimer
** field int world.playerWalkingFrame
** field int world.playerWalkingFrameTimer
** field boolean world.playerIsCurrentlyWalking
** field nil or VBStr world.levelTitle
** function mem