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
Re: LunaLua - Lunadll with lua
Posted: Mon Dec 01, 2014 9:08 am
by Kevsoft
Updated my main post with some videos, so people can see what you can do with it.
Re: LunaLua - Lunadll with lua
Posted: Sat Dec 06, 2014 1:18 pm
by Destiny
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!
Re: LunaLua - Lunadll with lua
Posted: Tue Dec 23, 2014 6:37 pm
by Wohlstand
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:
SnifitGuy, quick question:
1) did you saved as "lunadll.lua" file in your custom dir of level?
2) did you correctly installed LunaLUA?
Re: LunaLua - Lunadll with lua
Posted: Thu Dec 25, 2014 4:37 pm
by Wohlstand
SnifitGuy wrote:
Wohlstand wrote:SnifitGuy, quick question:
1) did you saved as "lunadll.lua" file in your custom dir of level?
2) did you correctly installed LunaLUA?
1) It's LunaDLL with Lua, yes? That's the zip I have.
2) I put all the contents of the zip (the folder and two Dll files) in C:\SMBX
Do you got hexed SMBX's exe file which linked with LunaDLL?
Re: LunaLua - Lunadll with lua
Posted: Fri Dec 26, 2014 2:17 am
by Kevsoft
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".
Re: LunaLua - Lunadll with lua
Posted: Fri Dec 26, 2014 7:47 am
by Kevsoft
I have a idea: Provide me a screenshot of your custom folder with the lunadll.lua inside.
Re: LunaLua - Lunadll with lua
Posted: Sat Dec 27, 2014 5:01 am
by Kevsoft
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!
Re: LunaLua - Lunadll with lua
Posted: Sat Dec 27, 2014 6:54 am
by DarkShadeX
i fu****g love you kevy!
Re: LunaLua - Lunadll with lua
Posted: Sat Dec 27, 2014 8:17 am
by Kevsoft
DarkShadeX wrote:i fu****g love you kevy!
Hehe, thanks
I also updated the package with a small hotfix towards loadImage.
Re: LunaLua - Lunadll with lua [Now with Overworld]
Posted: Sat Dec 27, 2014 11:24 am
by Kevsoft
I am currently trying to fix a bug where the overworld is crashing when lunaoverworld.lua is missing. I'll release a new version soon!
Okay: Just fixed the small bug. Just download the same ZIP and overwrite the LunaDll.dll file.
Re: LunaLua - Lunadll with lua [Now with Overworld]
Posted: Sun Dec 28, 2014 5:23 am
by UberAndrew
Man, this is really looking amazing.
If this was included with SMBX 1.3.2 and there were in depth tutorials, this could really revitalize SMBX.
Re: LunaLua - Lunadll with lua [Now with Overworld]
Posted: Tue Dec 30, 2014 8:29 am
by Kevsoft
And here is the first LunaLua update for the overworld adding now the world class!
Example Code:
* 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
Documentation will be updated soon!
Re: LunaLua - Lunadll with lua [Now with Overworld]
Posted: Tue Dec 30, 2014 9:30 am
by DarkShadeX
The code above doesnt work.
Re: LunaLua - Lunadll with lua [Now with Overworld]