mario fan games galaxysmbx communityirc.cat.bio

firefox related css updates (bbcode/shoutbox) - ctrl-f5 if they're still jacked up for you

LunaLua Offical Thread

The second SMBX collab!

Shall I stream some LunaLua live development?

Yes
22
92%
No
2
8%
 
Total votes: 24

User avatar
Hoeloe
One of them Lua people
Posts: 807
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

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

User avatar
romajiQuadhash
typos "raocow" as "roacow" (and I TAS)
Posts: 12
Joined: 2 years ago
First name: Romaji Quadhash
Pronouns: ke/keh/ker
Location: ""Canada""

Re: LunaLua Offical Thread

Postby romajiQuadhash » 1 year ago

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
One of them Lua people
Posts: 807
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

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

User avatar
Hoeloe
One of them Lua people
Posts: 807
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

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

User avatar
FrozenQuills
ok flair 2017
Posts: 704
Joined: 2 years ago
Location: my own skull, obviously

Re: LunaLua Offical Thread

Postby FrozenQuills » 1 year ago

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
Image
SMBX Tileset Compiler and Separator
MaGLX2 Level Commentaries (updated up to 169th place) + My entry
The boss entry that made me eat a shoe.
Image

5th place counter: 4
(SMBX Forums CC11, SMBX Forums CC12, Endgame Madness Contest, SMWC Kaizo Contest 2016)

User avatar
Hoeloe
One of them Lua people
Posts: 807
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

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

User avatar
Hoeloe
One of them Lua people
Posts: 807
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

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

User avatar
Hoeloe
One of them Lua people
Posts: 807
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

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

User avatar
Hoeloe
One of them Lua people
Posts: 807
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

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

User avatar
Hoeloe
One of them Lua people
Posts: 807
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

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

JVyrn
Floof Incarnate
Posts: 26
Joined: 6 years ago

Re: LunaLua Offical Thread

Postby JVyrn » 1 year ago

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: 2 years ago

Re: LunaLua Offical Thread

Postby Kevsoft » 1 year ago

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.

JVyrn
Floof Incarnate
Posts: 26
Joined: 6 years ago

Re: LunaLua Offical Thread

Postby JVyrn » 1 year ago

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: 2 years ago

Re: LunaLua Offical Thread

Postby Kevsoft » 1 year ago

Well I have to think something out for this. But I will note it.

User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 2 years ago

Re: LunaLua Offical Thread

Postby Kevsoft » 1 year ago

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
One of them Lua people
Posts: 807
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

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

User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 2 years ago

Re: LunaLua Offical Thread

Postby Kevsoft » 1 year ago

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
A2XT Guy
Posts: 1852
Joined: 4 years ago
Location: Nova Scotia

Re: LunaLua Offical Thread

Postby SAJewers » 1 year ago

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.
DO NOT PM ME ABOUT A SECOND MARIO BROS X. THING. I WILL NOT RESPOND TO PMs.
Image
Head over to the ASMBXT Forums and join the discssion, or submit levels!
Image
Image
Image

User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 2 years ago

Re: LunaLua Offical Thread

Postby Kevsoft » 1 year ago

For those who downloaded LunaLua and missing "FreeImage.dll", I did update the package. I apologize for that!

User avatar
SAJewers
A2XT Guy
Posts: 1852
Joined: 4 years ago
Location: Nova Scotia

Re: LunaLua Offical Thread

Postby SAJewers » 1 year ago

Um, I think you might have broke Autocode.
DO NOT PM ME ABOUT A SECOND MARIO BROS X. THING. I WILL NOT RESPOND TO PMs.
Image
Head over to the ASMBXT Forums and join the discssion, or submit levels!
Image
Image
Image

User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 2 years ago

Re: LunaLua Offical Thread

Postby Kevsoft » 1 year ago

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: 654
Joined: 3 years ago

Re: LunaLua Offical Thread

Postby Rednaxela » 1 year ago

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.
Currently LPing: Ys Origin

User avatar
Karatekid5
Master of submarines
Posts: 32
Joined: 7 years ago
Location: Pennsylvania
Contact:

Re: LunaLua Offical Thread

Postby Karatekid5 » 1 year ago

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

User avatar
Wohlstand
PGE and LunaLUA developer
Posts: 152
Joined: 3 years ago

Re: LunaLua Offical Thread

Postby Wohlstand » 1 year ago

Karatekid5 wrote: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.
Please take hotfix (Kevin has been fixed that bug in Autocode module), just uploaded and it's available now

User avatar
Karatekid5
Master of submarines
Posts: 32
Joined: 7 years ago
Location: Pennsylvania
Contact:

Re: LunaLua Offical Thread

Postby Karatekid5 » 1 year ago

Excellent! Everything is working again! ^_^
Yoshi Ambassador!
Image


Return to “A2XT”

Who is online

Users browsing this forum: No registered users and 2 guests

cron