(shouting)

LunaLua Offical Thread

The second SMBX collab!

Shall I stream some LunaLua live development?

Yes
23
92%
No
2
8%
 
Total votes: 25

Zia Satazaki
Floof Incarnate
Posts: 28
Joined: 14 years ago
Pronouns: she/they

Re: LunaLua Offical Thread

Post by Zia Satazaki »

Hoeloe wrote:Using Lua standard stuff you can read and write files pretty easily
I thought I read that that was disabled for Luna?
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaLua Offical Thread

Post by Kevsoft »

JVyrn wrote:
Hoeloe wrote:Using Lua standard stuff you can read and write files pretty easily
I thought I read that that was disabled for Luna?
It was disabled.
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaLua Offical Thread

Post by Hoeloe »

Kevsoft wrote:
JVyrn wrote:
Hoeloe wrote:Using Lua standard stuff you can read and write files pretty easily
I thought I read that that was disabled for Luna?
It was disabled.
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.
Image
Image
Image
Image
Image
User avatar
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

Post by romajiQuadhash »

Hoeloe wrote:
Kevsoft wrote:
JVyrn wrote: I thought I read that that was disabled for Luna?
It was disabled.
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.
Hence the bolded was.
Now it's not
This is a sig
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaLua Offical Thread

Post by Hoeloe »

romajiQuadhash wrote: Hence the bolded was.
Now it's not
Ah, didn't spot the bolding, it's fairly subtle. That makes more sense then.
Image
Image
Image
Image
Image
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaLua Offical Thread

Post by Hoeloe »

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...
Image
Image
Image
Image
Image
User avatar
FrozenQuills
hehe haha 2024
Posts: 843
Joined: 9 years ago
Location: my skull

Re: LunaLua Offical Thread

Post by FrozenQuills »

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...
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...
Image
Image
avatar by crayonchewer!
Image
Image
Image
SMBX Tileset Compiler and Separator
The boss entry that made me eat a shoe.

5th place counter: 5
(SMBX Forums CC11, SMBX Forums CC12, Endgame Madness Contest, SMWC Kaizo Contest 2016, SMWC 24hr Contest 2018)
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaLua Offical Thread

Post by Hoeloe »

FrozenQuills wrote:
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...
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...
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.

Today's bug was caused by recent versions of LunaLua breaking onLoad when it's called by an API.
Image
Image
Image
Image
Image
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaLua Offical Thread

Post by Hoeloe »

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):

Code: Select all

function multipoints.onLevelStart()
--your code here
end
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.
Image
Image
Image
Image
Image
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaLua Offical Thread

Post by Hoeloe »

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.
Image
Image
Image
Image
Image
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaLua Offical Thread

Post by Hoeloe »

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.
Image
Image
Image
Image
Image
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaLua Offical Thread

Post by Hoeloe »

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.
Image
Image
Image
Image
Image
Zia Satazaki
Floof Incarnate
Posts: 28
Joined: 14 years ago
Pronouns: she/they

Re: LunaLua Offical Thread

Post by Zia Satazaki »

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.
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaLua Offical Thread

Post by Kevsoft »

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.
Zia Satazaki
Floof Incarnate
Posts: 28
Joined: 14 years ago
Pronouns: she/they

Re: LunaLua Offical Thread

Post by Zia Satazaki »

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.
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaLua Offical Thread

Post by Kevsoft »

Well I have to think something out for this. But I will note it.
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaLua Offical Thread

Post by Kevsoft »

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:
* Extended Level class and World class (Overworld)
* Extended Player class
* Extended Section Class
* Extended Graphics Namespace
* Extended Block class
* Extended NPC class
* Added Section Namespace (Static functions for Section class)
* Added some new Defines (Defines.* namespace)
* Added switch between letterbox-mode (forced 4:3) or scretched-mode via F4
* Bugfix [LunaLua and SMBX Engine]: Decimal numbers now work perfectly in layer speed and npc codes (Thanks to DarkMecha for testing!)
* Bugfix [LunaLua and SMBX Engine]: Fullscreen in the level editor works again!
* Added printTextWP, drawImageWP, drawImageToSceneWP which enables rendering with priority settings (also known as Z-Index)
* Added sounds.ini on level-basis
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaLua Offical Thread

Post by Hoeloe »

Kevsoft wrote: * Added printTextWP, drawImageWP, drawImageToSceneWP which enables rendering with priority settings (also known as Z-Index)
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.
Image
Image
Image
Image
Image
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaLua Offical Thread

Post by Kevsoft »

Hoeloe wrote:
Kevsoft wrote: * Added printTextWP, drawImageWP, drawImageToSceneWP which enables rendering with priority settings (also known as Z-Index)
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.
The problem is that for the current functions (especially drawImage) another argument with the same name is not possible due to overload conflicts:
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)
I could have added an argument at the end like that:

Code: Select all

Graphics.drawImage(LuaImageResource img, int xPos, int yPos, int sourceX, int sourceY, int width, int height, float opacity, double priority)
But you would need to specifiy all these argument.
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.
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4200
Joined: 11 years ago
Location: Nova Scotia

Re: LunaLua Offical Thread

Post by SAJewers »

I think something broke.

Image


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.
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaLua Offical Thread

Post by Kevsoft »

For those who downloaded LunaLua and missing "FreeImage.dll", I did update the package. I apologize for that!
User avatar
SAJewers
ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
Posts: 4200
Joined: 11 years ago
Location: Nova Scotia

Re: LunaLua Offical Thread

Post by SAJewers »

Um, I think you might have broke Autocode.
ImageImageImageImageImage | Image | Image
Sharenite | RetroAchievements | NameMC | IGDB
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 9 years ago

Re: LunaLua Offical Thread

Post by Kevsoft »

SAJewers wrote:Um, I think you might have broke Autocode.
Goddamit how....? I did even test the module and it worked fine by me.
User avatar
Rednaxela
Maker of Shenanigans
Posts: 897
Joined: 10 years ago
Pronouns: they/them
https://rednaxela.talkhaus.com

Re: LunaLua Offical Thread

Post by Rednaxela »

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
Makes controls... a bit different.
User avatar
Karatekid5
Welcome to the resort!
Posts: 78
Joined: 14 years ago
Location: Pennsylvania
Contact:

Re: LunaLua Offical Thread

Post by Karatekid5 »

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.
Yoshi Ambassador!
Image
Post Reply