LunaLua Offical Thread - SMBX Usermod Framework

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

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?

Shall I steam some LunaLua live development?

Yes
200
92%
No
17
8%
 
Total votes: 217
Mable
Luigi
Luigi
Posts: 5806
Joined: Sat Dec 21, 2013 4:23 am
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Mable » Wed Nov 25, 2015 6:28 am

XerX wrote: That's pretty neat. I was working on something similar myself to go with the Overhaul mod, but never got around to finishing it. Maybe I should finish it just for the heck of it.
Image
Why is Mayro half on the map down and half above it.

Cornholio309
Koopa
Koopa
Posts: 19
Joined: Fri Nov 06, 2015 4:26 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Cornholio309 » Wed Nov 25, 2015 11:08 am

Not sure if this bug has been reported before, but the Underground background track in SMB1 appears to be broken. The game still seems to be searching for an MP3 rather than the .spc file, so any level that uses "smb-underground.mp3" throws up an error and no music plays.

The other tracks work fine however as far as I'm aware. I'm using LunaLUA 0.7.2.2-beta, but this issue was present in LunaLUA 0.7.2.1 as well.

Image

Wohlstand
Chargin' Chuck
Chargin' Chuck
Posts: 2008
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Wohlstand » Wed Nov 25, 2015 1:26 pm

Cornholio309 wrote:Not sure if this bug has been reported before, but the Underground background track in SMB1 appears to be broken. The game still seems to be searching for an MP3 rather than the .spc file, so any level that uses "smb-underground.mp3" throws up an error and no music plays.

The other tracks work fine however as far as I'm aware. I'm using LunaLUA 0.7.2.2-beta, but this issue was present in LunaLUA 0.7.2.1 as well.

Image
1) Please download FULL build of LunaLUA, because it has updated & fixed music.ini and fixed musics folder + SMB-Underground is NSF-based track whuch also requires track number suffix, I.e. "file.nsf|2", because alone NSF file contains multiple different music tracks.
2) LunaLUA 0.7.2.2-beta still have a bug with support of track number suffix which wasn't worked from INI-files (but worked from "custom" music field or from lua-code Audio.openMusic("file.nsf|2")). So, after re-taking of full LunaLUA, please take a fixed LunaDLL.dll: http://engine.wohlnet.ru/docs/_laborato ... unaDll.dll

+ a little news that nightly builds of LunaLUA core are available for everyone: https://ci.appveyor.com/project/Wohlstand/lunadll
(you also can find a "Build passing" badge which is a direct link to that page). Download build you can in the "Artifacts" tab.

Cornholio309
Koopa
Koopa
Posts: 19
Joined: Fri Nov 06, 2015 4:26 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Cornholio309 » Wed Nov 25, 2015 3:31 pm

Wohlstand wrote: 1) Please download FULL build of LunaLUA, because it has updated & fixed music.ini and fixed musics folder + SMB-Underground is NSF-based track whuch also requires track number suffix, I.e. "file.nsf|2", because alone NSF file contains multiple different music tracks.
2) LunaLUA 0.7.2.2-beta still have a bug with support of track number suffix which wasn't worked from INI-files (but worked from "custom" music field or from lua-code Audio.openMusic("file.nsf|2")). So, after re-taking of full LunaLUA, please take a fixed LunaDLL.dll: http://engine.wohlnet.ru/docs/_laborato ... unaDll.dll

+ a little news that nightly builds of LunaLUA core are available for everyone: https://ci.appveyor.com/project/Wohlstand/lunadll
(you also can find a "Build passing" badge which is a direct link to that page). Download build you can in the "Artifacts" tab.
Excellent. That worked wonders! The SMB1 Underground track now plays a-okay which is pretty awesome!

Thank you so much!

I have to say LunaLua is incredibly nifty. In addition to the music looping seamlessly now and taking chip tune formats, I swear the game runs at a constant stable framerate. Back in 1.3, the framerate really felt all over the place which is a bit odd.

Now to delete me 0.7.2.1 installation and transfer my custom level over to this new one.

Edit: I'm starting to notice an issue now where MP3s don't seem to play properly. All of them are played at a higher pitch and sound significantly speed up for some reason. I noticed this while playing New Great Castle Adventure's Ruinous Caverns. That level uses Donkey Kong Country's Cave Dweller Concert.

Here's what is should sound like:



Here's what it sounds like in LunaLUA 0.7.2.2:



For further reference, here's the same level recorded by bossedit8. The music plays at the proper pitch here:


Wohlstand
Chargin' Chuck
Chargin' Chuck
Posts: 2008
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Wohlstand » Thu Nov 26, 2015 8:48 am

Cornholio309 wrote:
Resample your audio file into 44100 hz!
Until I will don't implement SOXR support, SDL2 has a shitty resampler which doing a shit instead of output, therefore I commented it to play music as-is (result is pitched because it wasn't re-sampled)

....or better put .SPC file with this music from Donkey Kong Chip tunes pack which will be played directly in LunaLUA-SMBX (for Vanillia you should rip it into MP3)
(you can see that LunaLUA-SMBX's music folder has a lot of SPC-files instead of MP3/OGG files since SDL2_mixer_ext directly supports playback of those formats)
Full music formats list supported by PGE and by LunaLUA-SMBX:
http://engine.wohlnet.ru/pgewiki/SDL2_m ... ic_Formats

Suggestion:
You can quickly resample all musics in episode to right format with a small tool:
https://drive.google.com/open?id=0B3QNP ... authuser=0

* Unpack contents of downloaded archive into the "%Your SMBX Path%\worlds" folder
* Run a "MusicFixer.bat" file and wait while it will say "All files has been fixed!"

Cornholio309
Koopa
Koopa
Posts: 19
Joined: Fri Nov 06, 2015 4:26 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Cornholio309 » Thu Nov 26, 2015 11:00 am

I actually found out that another user was having the same issue in a completely separate thread and saw your advice there. Thanks for that! A bit of an unfortunate issue, but Foobar2000 made quick work of the issue and now all of the tracks in New Great Castle Adventure are now fixed!

I'll definitely have to use that tool though if I run into the issue again. Any chance of adding it to the PGE Tool Pack? It seems pretty handy.

Wohlstand
Chargin' Chuck
Chargin' Chuck
Posts: 2008
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Wohlstand » Thu Nov 26, 2015 7:45 pm

Cornholio309 wrote:I actually found out that another user was having the same issue in a completely separate thread and saw your advice there. Thanks for that! A bit of an unfortunate issue, but Foobar2000 made quick work of the issue and now all of the tracks in New Great Castle Adventure are now fixed!

I'll definitely have to use that tool though if I run into the issue again. Any chance of adding it to the PGE Tool Pack? It seems pretty handy.
In the PGE is a WIP-tool calling as "PGE Maintainer" which will unite all PNG2GIFs, GIFs2PNG, LazyFixTool and flexible music fixing/conversion. That tool will provide features to quickly port episodes between PGE or LunaLUA/Vaniila SMBX, graphics fixing/coversion and convenient and flexible music fixing toolset (you be able to convert all MP3's into OGG's with automatic replacing of links inside level files)

XerX
Phanto
Phanto
Posts: 1487
Joined: Fri Dec 20, 2013 3:33 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby XerX » Fri Nov 27, 2015 3:35 am

Tinkerbell wrote:
XerX wrote: That's pretty neat. I was working on something similar myself to go with the Overhaul mod, but never got around to finishing it. Maybe I should finish it just for the heck of it.
Image
Why is Mayro half on the map down and half above it.
it's a glitch that happens when you change his powerup from small to anything on the world map.

lotus006
Spike
Spike
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Fri Nov 27, 2015 3:48 am

XerX wrote:
Tinkerbell wrote:
XerX wrote: That's pretty neat. I was working on something similar myself to go with the Overhaul mod, but never got around to finishing it. Maybe I should finish it just for the heck of it.
Image
Why is Mayro half on the map down and half above it.
it's a glitch that happens when you change his powerup from small to anything on the world map.
Never tried on the World Map but your one is nice too :)
Nice Job :)


I have done on my side now player select for who got the powerups from the inv. and also the Inventory bar got now 4 Row of items :D and working soon :)

But I need to figure a better way to increment more less faster instead of in the loop the number add 1 and reach the last max number in a micro second, lol
I mean 1 by 1 ...

and also a way how to remove an item in a table and they move to 1 to the side left like in the real smb3 when the item is taken :S , I have hard time with this one :(
(Maybe I have a hint , when in the table the value is " nil " then the value is not " nil " do -1 to his value) not sure how I will do this one but I will try harder to get it working now :)
If some one have idea I'm open :)

Kevsoft
Ripper II
Ripper II
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Kevsoft » Fri Nov 27, 2015 4:29 am

XerX wrote: it's a glitch that happens when you change his powerup from small to anything on the world map.
I found out that the powerup settings should be done via the player.powerup variable. The player class can be access in the overworld.

XerX
Phanto
Phanto
Posts: 1487
Joined: Fri Dec 20, 2013 3:33 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby XerX » Fri Nov 27, 2015 9:47 am

Kevsoft wrote:
XerX wrote: it's a glitch that happens when you change his powerup from small to anything on the world map.
I found out that the powerup settings should be done via the player.powerup variable. The player class can be access in the overworld.
I've been using player.powerup since the beginning.

PersonNamedUser
Reznor
Reznor
Posts: 2882
Joined: Fri Feb 27, 2015 8:07 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PersonNamedUser » Fri Nov 27, 2015 12:04 pm

Again, could someone please tell me how to put the image path in the code?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Emral » Fri Nov 27, 2015 12:09 pm

SuperMario12345 wrote:Again, could someone please tell me how to put the image path in the code?
If It's in the custom graphics folder:
local image = Graphics.loadImage("image.png")

If It's in a subfolder:
local image = Graphics.loadImage("subfolder/image.png")

If It's in the episode folder:
local image = Graphics.loadImage("../image.png")

PersonNamedUser
Reznor
Reznor
Posts: 2882
Joined: Fri Feb 27, 2015 8:07 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PersonNamedUser » Fri Nov 27, 2015 1:37 pm

The code works, but when i try to collect coins, i get this error message:
Image

And I'm putting in this code:

Code: Select all

local coins = Graphics.loadImage("coincounter.png")
local raocoin = true

raocoin = loadSharedAPI("raocoin2");
rc = raocoin.registerCurrency(274, true, 472, 66);
coins = raocoin.registerMemCurrency(0x00B2C5A8,FIELD_WORD,true,false,0,0,"coincounter.png");

function raocoin.onCollect()
	if(currency.id == 272) then
		Currency:get(1)
		currency:save(1);
	end
end
Does anyone know what code i should be putting in?

HenryRichard
Reznor
Reznor
Posts: 2843
Joined: Mon Dec 23, 2013 12:09 pm
Flair: Is this where I type my password?
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby HenryRichard » Sat Nov 28, 2015 5:36 pm

You're still doing this:
Enjl wrote:Also, you're setting the value "coins" repeatedly. What you're essentially doing in onLoad is overwriting a bunch of stuff. Only the last time you define "coins" will actually be relevant, because it's the one up to date. It's like defining:
Hello = 1
Hello = 2
Hello = 1
Hello = 2
Hello = 5
while you could just write
Hello = 5
which would give the same result.
I don't know if that's the problem, but you still shouldn't do it.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Emral » Sat Nov 28, 2015 5:45 pm

Let me run over this, I marked the areas which are faulty or weird to me in the quote. Keep in mind that I never used raocoin.
SuperMario12345 wrote:local coins = Graphics.loadImage("coincounter.png") -- Do you want "coins" to be the image file, or the registered currency (further down)?
local raocoin = true

raocoin = loadSharedAPI("raocoin2"); -- What are you trying to accomplish in these lines? You're setting the variable you just set to "true" to hold the raocoin API
rc = raocoin.registerCurrency(274, true, 472, 66); -- You're registering ID 274, but further down you're calling for 272
coins = raocoin.registerMemCurrency(0x00B2C5A8,FIELD_WORD,true,false,0,0,"coincounter.png"); -- This overwrites "coins" set in the first line. I'd just get rid of the first line altogether.

function raocoin.onCollect()
if(currency.id == 272) then --SMB2 Hoopster || EVERYTHING IS CASE SENSITIVE BY THE WAY
Currency:get(1) --From looking at the wiki, this will return the value of the currency. With Currency.get() you can store the value of the currency in a variable. An example: local stuff = Currency:get()
currency:save(1); --There is no such thing as Currency:save(1). It's just Currency:save() and saves the currency value set with Currency:set(number)
end
end

PersonNamedUser
Reznor
Reznor
Posts: 2882
Joined: Fri Feb 27, 2015 8:07 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby PersonNamedUser » Sat Nov 28, 2015 7:04 pm

Enjl wrote:Let me run over this, I marked the areas which are faulty or weird to me in the quote. Keep in mind that I never used raocoin.
SuperMario12345 wrote:local coins = Graphics.loadImage("coincounter.png") -- Do you want "coins" to be the image file, or the registered currency (further down)?
local raocoin = true

raocoin = loadSharedAPI("raocoin2"); -- What are you trying to accomplish in these lines? You're setting the variable you just set to "true" to hold the raocoin API
rc = raocoin.registerCurrency(274, true, 472, 66); -- You're registering ID 274, but further down you're calling for 272
coins = raocoin.registerMemCurrency(0x00B2C5A8,FIELD_WORD,true,false,0,0,"coincounter.png"); -- This overwrites "coins" set in the first line. I'd just get rid of the first line altogether.

function raocoin.onCollect()
if(currency.id == 272) then --SMB2 Hoopster || EVERYTHING IS CASE SENSITIVE BY THE WAY
Currency:get(1) --From looking at the wiki, this will return the value of the currency. With Currency.get() you can store the value of the currency in a variable. An example: local stuff = Currency:get()
currency:save(1); --There is no such thing as Currency:save(1). It's just Currency:save() and saves the currency value set with Currency:set(number)
end
end
I meant to insert 274 right there, that was a mistake. Thanks for telling me that Currency:save(1) isn't a real code. I also wanted coins to be image file name.
I don't really understand what i was doing on the API line. Ok, i'll get rid of first line and see what happens.

lotus006
Spike
Spike
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Sat Nov 28, 2015 7:09 pm

SuperMario12345 wrote:
Enjl wrote:Let me run over this, I marked the areas which are faulty or weird to me in the quote. Keep in mind that I never used raocoin.
SuperMario12345 wrote:local coins = Graphics.loadImage("coincounter.png") -- Do you want "coins" to be the image file, or the registered currency (further down)?
local raocoin = true

raocoin = loadSharedAPI("raocoin2"); -- What are you trying to accomplish in these lines? You're setting the variable you just set to "true" to hold the raocoin API
rc = raocoin.registerCurrency(274, true, 472, 66); -- You're registering ID 274, but further down you're calling for 272
coins = raocoin.registerMemCurrency(0x00B2C5A8,FIELD_WORD,true,false,0,0,"coincounter.png"); -- This overwrites "coins" set in the first line. I'd just get rid of the first line altogether.

function raocoin.onCollect()
if(currency.id == 272) then --SMB2 Hoopster || EVERYTHING IS CASE SENSITIVE BY THE WAY
Currency:get(1) --From looking at the wiki, this will return the value of the currency. With Currency.get() you can store the value of the currency in a variable. An example: local stuff = Currency:get()
currency:save(1); --There is no such thing as Currency:save(1). It's just Currency:save() and saves the currency value set with Currency:set(number)
end
end
I meant to insert 274 right there, that was a mistake. Thanks for telling me that Currency:save(1) isn't a real code. I also wanted coins to be image file name.
I don't really understand what i was doing on the API line. Ok, i'll get rid of first line and see what happens.
I'm not very good in lua not now :S , but with the "Currency:get(1)" the 1 is just a number on save and get you need to put a variable to insert the value you want.
like

Code: Select all

local banana = 1

currency:save("banana");

Currency:get("banana")
Sorry if i'm wrong

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9865
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Emral » Sat Nov 28, 2015 7:20 pm

lotus006 wrote: I'm not very good in lua not now :S , but with the "Currency:get(1)" the 1 is just a number on save and get you need to put a variable to insert the value you want.
like

Code: Select all

local banana = 1

currency:save("banana");

Currency:get("banana")
Sorry if i'm wrong
What you're doing is absolute bollocks. Watch the case-sensitivity :P
Also, You're trying to set the currency to a string, which isn't possible.

I'll give you a quick run-through of the Data class and how it differs from the raocoin class, from my understanding:

The data class lets you save values to different strings inside a file, which can be carried across levels. If you want to set a value, you do this:
data:set("value", 1)
sata:save()
This sets the value of "value" to 1. If you fancy, you can go more complicated and do stuff like
data:set("value", data:get("value") + 1)
to have it count up every time the event is executed.

To get a variable from the data class, you, as seen above, type
data:get("value")
You can save this to a variable by typing
local variable = data:get("value")
and vice-versa, you don't have to use numbers when setting your custom data class element:
data:set("other thing", variable)
data:save()

The Currency class for raocoin seems to get rid of the string present in the data class, which means all you can set now is the value of the internal currency. With Currency:get() you get the value of the currency, and with Currency:set(number) you can set it. Currency:save() works the same way as in the data class.

Someone with more knowledge, correct me if I'm wrong.

lotus006
Spike
Spike
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Sat Nov 28, 2015 7:28 pm

Enjl wrote:
lotus006 wrote: I'm not very good in lua not now :S , but with the "Currency:get(1)" the 1 is just a number on save and get you need to put a variable to insert the value you want.
like

Code: Select all

local banana = 1

currency:save("banana");

Currency:get("banana")
Sorry if i'm wrong
What you're doing is absolute bollocks. Watch the case-sensitivity :P
Also, You're trying to set the currency to a string, which isn't possible.
you see how I am lol thanks

Code: Select all

[code]
local banana = 1

Currency:save( banana );  -- not sure about this one , I need to add like this ? ( Currency:save( banana + 1); or Currency:save( ); ?

Currency:get( banana )
[/code]
Thanks you are very good :) , without your help our codes will be disastruous ^^

in talk of this, is there a way to make it dynamic like my graphic menu if I change value like a button if is true then the next time it will be staying on the same value
on the next load ?

I think it should be the same thing ? when the value is saved I can get the saved value and the button will stay true ? I mean just in an example for sure ^^


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari