I thought I read that that was disabled for Luna?Hoeloe wrote:Using Lua standard stuff you can read and write files pretty easily
LunaLua Offical Thread
-
- Floof Incarnate
- Posts: 28
- Joined: 14 years ago
- Pronouns: she/they
Re: LunaLua Offical Thread
Re: LunaLua Offical Thread
It was disabled.JVyrn wrote:I thought I read that that was disabled for Luna?Hoeloe wrote:Using Lua standard stuff you can read and write files pretty easily
Re: LunaLua Offical Thread
Well that's clearly not the case because I'm using it in a work in progress library to read some files in, and I believe CinematX uses it for animation files, too.Kevsoft wrote:It was disabled.JVyrn wrote:I thought I read that that was disabled for Luna?Hoeloe wrote:Using Lua standard stuff you can read and write files pretty easily
- romajiQuadhash
- typos "raocow" as "roacow" (and I TAS)
- Posts: 12
- Joined: 9 years ago
- First name: Romaji Quadhash
- Pronouns: ke/keh/ker
- Location: ""Canada""
Re: LunaLua Offical Thread
Hence the bolded was.Hoeloe wrote:Well that's clearly not the case because I'm using it in a work in progress library to read some files in, and I believe CinematX uses it for animation files, too.Kevsoft wrote:It was disabled.JVyrn wrote: I thought I read that that was disabled for Luna?
Now it's not
This is a sig
Re: LunaLua Offical Thread
Ah, didn't spot the bolding, it's fairly subtle. That makes more sense then.romajiQuadhash wrote: Hence the bolded was.
Now it's not
Re: LunaLua Offical Thread
So, in trying to work out what went wrong with my MAGLX2 level today, I updated it to use the most recent version of Multipoints and discovered something fairly alarming: Multipoints doesn't actually work in a finished game, only in the editor. I have no idea why this would be though...
- FrozenQuills
- hehe haha 2024
- Posts: 843
- Joined: 9 years ago
- Location: my skull
Re: LunaLua Offical Thread
Well both your and my secondary midpoints worked for raocow (just the filters messed up), so if maglx2 doesn't use the most recent library maybe a previous version works? Unless you did something different for your level of course...Hoeloe wrote:So, in trying to work out what went wrong with my MAGLX2 level today, I updated it to use the most recent version of Multipoints and discovered something fairly alarming: Multipoints doesn't actually work in a finished game, only in the editor. I have no idea why this would be though...
avatar by crayonchewer!
Re: LunaLua Offical Thread
I looked into it, and it's a bug with LunaLua. For whatever reason, when loading from a hub or world map, onLoop is called exactly once before the level is initialised. This means that multipoints sets the spawn point and such, and SMBX immediately sets it right back.FrozenQuills wrote:Well both your and my secondary midpoints worked for raocow (just the filters messed up), so if maglx2 doesn't use the most recent library maybe a previous version works? Unless you did something different for your level of course...Hoeloe wrote:So, in trying to work out what went wrong with my MAGLX2 level today, I updated it to use the most recent version of Multipoints and discovered something fairly alarming: Multipoints doesn't actually work in a finished game, only in the editor. I have no idea why this would be though...
Today's bug was caused by recent versions of LunaLua breaking onLoad when it's called by an API.
Re: LunaLua Offical Thread
Okay, updates to Multipoints and RNG.
There is a bug in LunaLua that causes onLoop to be run once before a level is loaded properly when coming from a hub or world map. This caused Multipoints to fail, as it was setting up the player, only to have everything re-initialised immediately afterwards.
To solve this, Multipoints has a new event (which you can treat similar to onLoad):
This is called by Multipoints immediately after it has finished setting up the player (even if no checkpoint was previously collected), so you can guarantee that the player is positioned and ready to go as dictated by Multipoints. It is not, however, guaranteed to run before onLoop, so if you need to use it to initialise variables, you can use a boolean to hold back onLoop until this function is run.
As for RNG, there was a bug with randomInt that caused it to generate numbers incorrectly. The top and bottom values in a range of numbers were 50% less likely to be generated than other numbers in that range. This has now been fixed.
There is a bug in LunaLua that causes onLoop to be run once before a level is loaded properly when coming from a hub or world map. This caused Multipoints to fail, as it was setting up the player, only to have everything re-initialised immediately afterwards.
To solve this, Multipoints has a new event (which you can treat similar to onLoad):
Code: Select all
function multipoints.onLevelStart()
--your code here
end
As for RNG, there was a bug with randomInt that caused it to generate numbers incorrectly. The top and bottom values in a range of numbers were 50% less likely to be generated than other numbers in that range. This has now been fixed.
Re: LunaLua Offical Thread
Another update to multipoints, which is a little more stable thanks to Rednaxella's diving into the source of the problem. It's just a stability upgrade this time.
Re: LunaLua Offical Thread
Oop, just found a bug in colliders. In previous versions, Triangle and Poly colliders reported false to collision tests when the other collider was entirely inside them. This is now fixed.
Re: LunaLua Offical Thread
So it turns out that stability fix for multipoints actually ruined everyone's day, so I updated it back to the method used in 3.0.2.
-
- Floof Incarnate
- Posts: 28
- Joined: 14 years ago
- Pronouns: she/they
Re: LunaLua Offical Thread
Hey, I'd like to make a small-but-possibly-tricky request with big technology implications: the ability to add directories to the image/txt/etc. search path list, probably implemented as two global (array) tables (one before the level's directory, one after). This would allow such things as on-demand character swapping (between Mario and Demo etc.) in my currently-in-research-and-planning Big Project (you'll see a post in project showcase soon) and possibly even proper Mario Maker-style theming if the level in question marks support for it.
Re: LunaLua Offical Thread
You probably mean something like Misc.resolveFile / Misc.resolveDir which lookup a file first in the custom folder, then in the episode folder and then in LuaScriptsLib.
-
- Floof Incarnate
- Posts: 28
- Joined: 14 years ago
- Pronouns: she/they
Re: LunaLua Offical Thread
Eh, kind of in the other direction; basically, adding a directory for the game to look in when loading a level's txts and graphics replacements.
Re: LunaLua Offical Thread
Well I have to think something out for this. But I will note it.
Re: LunaLua Offical Thread
After much wait it is finally here: LunaLua v0.7.2
This version is a big milestone because it fixed some major bugs.
Here is the changelog:
This version is a big milestone because it fixed some major bugs.
Here is the changelog:
Re: LunaLua Offical Thread
Wouldn't it have been better to add an argument onto the end of the existing functions that could be nil? That way existing code wouldn't break and it wouldn't require these weirdly named functions.Kevsoft wrote: * Added printTextWP, drawImageWP, drawImageToSceneWP which enables rendering with priority settings (also known as Z-Index)
Re: LunaLua Offical Thread
The problem is that for the current functions (especially drawImage) another argument with the same name is not possible due to overload conflicts:Hoeloe wrote:Wouldn't it have been better to add an argument onto the end of the existing functions that could be nil? That way existing code wouldn't break and it wouldn't require these weirdly named functions.Kevsoft wrote: * Added printTextWP, drawImageWP, drawImageToSceneWP which enables rendering with priority settings (also known as Z-Index)
i.e.:
Code: Select all
Graphics.drawImage(LuaImageResource img, int xPos, int yPos)
Graphics.drawImage(LuaImageResource img, int xPos, int yPos, float opacity)
Graphics.drawImageWP(LuaImageResource img, int xPos, int yPos, double priority)
Code: Select all
Graphics.drawImage(LuaImageResource img, int xPos, int yPos, int sourceX, int sourceY, int width, int height, float opacity, double priority)
Another method would have been to use named argument via table, but this might confuse people a bit.
If there is something that specifies drawImage futher, I will promise to do that via named arguments.
- SAJewers
- ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
- Posts: 4200
- Joined: 11 years ago
- Location: Nova Scotia
Re: LunaLua Offical Thread
I think something broke.
That text appears for a few seconds whenever I start a level. Using 0.7.2 Update from the download page.
EDIT: OK, did a bit of testing. It only happens when I try to play this level, then I get the mound of text, and seemly continue to get it until I give it time to dissapear.
EDIT2: OK, me and Wolhstand fixed out the problem in IRC, the level author used autocode, and used \\ instead of // for comments.
That text appears for a few seconds whenever I start a level. Using 0.7.2 Update from the download page.
EDIT: OK, did a bit of testing. It only happens when I try to play this level, then I get the mound of text, and seemly continue to get it until I give it time to dissapear.
EDIT2: OK, me and Wolhstand fixed out the problem in IRC, the level author used autocode, and used \\ instead of // for comments.
Re: LunaLua Offical Thread
For those who downloaded LunaLua and missing "FreeImage.dll", I did update the package. I apologize for that!
- SAJewers
- ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
- Posts: 4200
- Joined: 11 years ago
- Location: Nova Scotia
Re: LunaLua Offical Thread
Goddamit how....? I did even test the module and it worked fine by me.SAJewers wrote:Um, I think you might have broke Autocode.
- Rednaxela
- Maker of Shenanigans
- Posts: 897
- Joined: 10 years ago
- Pronouns: they/them
- https://rednaxela.talkhaus.com
Re: LunaLua Offical Thread
Fun code snippet of the day for sake of silliness:
Code: Select all
function onLoop()
player:mem(0x52, FIELD_WORD, 10)
player:mem(0x50, FIELD_WORD, -1)
player:mem(0x60, FIELD_WORD, -1)
player:mem(0x11E, FIELD_WORD, -1)
player:mem(0x120, FIELD_WORD, -1)
if (player:mem(0x146, FIELD_WORD) ~= 0) or (player:mem(0x48, FIELD_WORD) ~= 0) then
local jh = -5 - 0.5*math.abs(player:mem(0xE0, FIELD_DFLOAT))
if (player:mem(0xFA, FIELD_WORD) ~= 0) or (player:mem(0xFA, FIELD_WORD) ~= 0) then
jh = jh * 2
end
player:mem(0xE8, FIELD_DFLOAT, jh)
end
player:mem(0xE0, FIELD_DFLOAT, player:mem(0xE0, FIELD_DFLOAT)*0.985)
end
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaLua Offical Thread
I'm having the same problem regarding the new version of LunaLUA and autocode. I used no comments in my level's autocode yet I still got the same on-screen syntax errors as SAJewers did. Though, I'm glad it isn't a problem with my level's LunaDLL code.