LunaLua Offical Thread - SMBX Usermod Framework

This is the place for discussion and support for LunaLua and related modifications and libraries.
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
lotus006
Mega Mole
Mega Mole
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Sat Nov 21, 2015 8:12 pm

Enjl wrote:
lotus006 wrote: Even if is in the loop section ?
And I can alway make moving with Graphics.drawImage ?
I mean you can make dynamic x and y values depending on how many items are already in your inventory. Since drawImage is only shown for one frame, it's even easier "move" it than placeSprite (though I never used placeSprite so whatever)
Oh I didnt know about this one i was thinking it's just an older code from older version, thanks I will try soon :)

Edit :
oh it's work without lagging, sorry guy's I'm feeling so embarrassed :S

I love so much Lua , and I have alot of Idea what to do now I can do everything with this toy and music in background meh !! :) haha thanks guy again :)

Next stuff maybe, I will try to implant Zelda 2 power menu or shop stuff with points (everyone know in Mario Points is useless then now it will be :D )

Edit2 :
But how I remove now Graphics.drawImage instead of Graphics.unplaceSprites ? is it the same thing ?

User avatar
HenryRichard
Ludwig von Koopa
Ludwig von Koopa
Posts: 2845
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 21, 2015 10:16 pm

HenryRichard wrote:Graphics.drawImage draws the image for only one frame - it's gone the next one.
Image

I'm on Soundcloud | My graphics pack!

Jesus is my savior.

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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby lotus006 » Sun Nov 22, 2015 2:12 am

Thanks I'm stupid sometimes sorry again :)

I have almost a beta release for the inventory mode, it work pretty good as I expecting
I hate so much placesprites lolll

before I release it i need to fix some sprites align it and make it with a stock i mean amount of the items when
you take the items will have -1 each times like in the normal game :D
and more than 1 row also maybe 4, and make it 2 mode smb4 advance and snes mode :)

there is a preview in video :)
thanks guy for your help :D
Edit: Oh and maybe an extra I will try to recreate the Warp Whistle and the world map :)
+ yoshi egg and hand items who will work only in game not on world in the future :D


User avatar
Mosaic
Ludwig von Koopa
Ludwig von Koopa
Posts: 2843
Joined: Fri Feb 27, 2015 8:07 pm
Flair: All has a reason behind it, even if it's tough.
Current Project: The Mosaic Group's Journey, Toad's SMB Adventure, Mosaic Adventures and Other Secret Projects?
Chat Username: Mosaic
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Mosaic » Mon Nov 23, 2015 3:35 am

Could someone help me to implement the money system? I'm putting in this code:

Code: Select all

function Onload()
raocoin = loadSharedAPI("raocoin2");
coins = raocoin.registerCurrency(10, true, 472, 66);
coins = raocoin.registerCurrency(33, true, 472, 66);
coins = raocoin.registerCurrency(88, true, 472, 66);
coins = raocoin.registerCurrency(133, true, 472, 66);
coins = raocoin.registerCurrency(152, true, 472, 66);
coins = raocoin.registerCurrency(251, true, 472, 66);
coins = raocoin.registerCurrency(252, true, 472, 66);
coins = raocoin.registerCurrency(253, true, 472, 66);
coins = raocoin.registerCurrency(258, true, 472, 66);
coins = raocoin.registerMemCurrency(0x00B2C5A8,FIELD_WORD,true,false);
end

function Onloop()
Currency:onCollect(1, 10) if not
    then elseif
     Currency:onCollect(1, 33) if not
     then elseif
         Currency:onCollect(1, 88) if not
         then elseif
             Currency:onCollect(1, 133) if not
             then elseif
             Currency:onCollect(1, 152) if not
             then elseif
             Currency:onCollect(1, 251) if not
             then elseif
             Currency:onCollect(5, 252) if not
             then elseif
             Currency:onCollect(20, 253) if not
             then elseif
             Currency:onCollect(5, 258) if not
             if not
	      end
	   end
    end
end
And It won't work. I need help to figure this out.

I believe in Jesus Christ as my Lord and Savior. If you do, put this in your signature.
And Here's The Proof
My Rainbow Of Levels
Mosaic's Museum(My Discord)

Image

Image

Danny wrote:Here's some constructive criticism: What the hell.
Witchking wrote:Approved!

Discord Quotes: show
Image


Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7951
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Enjl » Tue Nov 24, 2015 4:43 pm

I have a VERY HARD TIME believing that "if not then elseif" is a legitimate line.

Also, load APIs outside of any functions.
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.
The ABC of Creation
________________________________________________________
Image

XerX
Birdo
Birdo
Posts: 1495
Joined: Fri Dec 20, 2013 3:33 pm

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby XerX » Tue Nov 24, 2015 10:19 pm

lotus006 wrote:Thanks I'm stupid sometimes sorry again :)

I have almost a beta release for the inventory mode, it work pretty good as I expecting
I hate so much placesprites lolll

before I release it i need to fix some sprites align it and make it with a stock i mean amount of the items when
you take the items will have -1 each times like in the normal game :D
and more than 1 row also maybe 4, and make it 2 mode smb4 advance and snes mode :)

there is a preview in video :)
thanks guy for your help :D
Edit: Oh and maybe an extra I will try to recreate the Warp Whistle and the world map :)
+ yoshi egg and hand items who will work only in game not on world in the future :D


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

User avatar
Mosaic
Ludwig von Koopa
Ludwig von Koopa
Posts: 2843
Joined: Fri Feb 27, 2015 8:07 pm
Flair: All has a reason behind it, even if it's tough.
Current Project: The Mosaic Group's Journey, Toad's SMB Adventure, Mosaic Adventures and Other Secret Projects?
Chat Username: Mosaic
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Mosaic » Wed Nov 25, 2015 12:13 am

How do you put the path to your image in the lunalua code? I think i'm very close to making the money system

I believe in Jesus Christ as my Lord and Savior. If you do, put this in your signature.
And Here's The Proof
My Rainbow Of Levels
Mosaic's Museum(My Discord)

Image

Image

Danny wrote:Here's some constructive criticism: What the hell.
Witchking wrote:Approved!

Discord Quotes: show
Image


Mable
Peach
Peach
Posts: 5835
Joined: Sat Dec 21, 2013 4:23 am
Current Project: Account soon to be deleted
Chat Username: Account soon to be d
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
Cheep-Cheep
Cheep-Cheep
Posts: 11
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

User avatar
Wohlstand
Boom Boom
Boom Boom
Posts: 1751
Joined: Tue Feb 11, 2014 4:44 pm
Flair: 狐エンジニア
Current Project: Moondust (PGE Project)
Chat Username: Wohlstand#4881
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.
PGE Project, my Media and supported projects: show
Support me on the Patreon
Image

PGE Project
PGE Project SMBX Topic
PGE Project Official Site and forums
Download fresh experimental builds HERE!

I'm support:
Lowser's Conquest by Sednaiur

Image
P.S. I don't like huge signatures which would be annoying, therefore I put huge content into spoilers

Cornholio309
Cheep-Cheep
Cheep-Cheep
Posts: 11
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:


User avatar
Wohlstand
Boom Boom
Boom Boom
Posts: 1751
Joined: Tue Feb 11, 2014 4:44 pm
Flair: 狐エンジニア
Current Project: Moondust (PGE Project)
Chat Username: Wohlstand#4881
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!"
PGE Project, my Media and supported projects: show
Support me on the Patreon
Image

PGE Project
PGE Project SMBX Topic
PGE Project Official Site and forums
Download fresh experimental builds HERE!

I'm support:
Lowser's Conquest by Sednaiur

Image
P.S. I don't like huge signatures which would be annoying, therefore I put huge content into spoilers

Cornholio309
Cheep-Cheep
Cheep-Cheep
Posts: 11
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.

User avatar
Wohlstand
Boom Boom
Boom Boom
Posts: 1751
Joined: Tue Feb 11, 2014 4:44 pm
Flair: 狐エンジニア
Current Project: Moondust (PGE Project)
Chat Username: Wohlstand#4881
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)
PGE Project, my Media and supported projects: show
Support me on the Patreon
Image

PGE Project
PGE Project SMBX Topic
PGE Project Official Site and forums
Download fresh experimental builds HERE!

I'm support:
Lowser's Conquest by Sednaiur

Image
P.S. I don't like huge signatures which would be annoying, therefore I put huge content into spoilers

XerX
Birdo
Birdo
Posts: 1495
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
Mega Mole
Mega Mole
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 :)

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
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
Birdo
Birdo
Posts: 1495
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.

User avatar
Mosaic
Ludwig von Koopa
Ludwig von Koopa
Posts: 2843
Joined: Fri Feb 27, 2015 8:07 pm
Flair: All has a reason behind it, even if it's tough.
Current Project: The Mosaic Group's Journey, Toad's SMB Adventure, Mosaic Adventures and Other Secret Projects?
Chat Username: Mosaic
Contact:

Re: LunaLua Offical Thread - SMBX Usermod Framework

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

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

I believe in Jesus Christ as my Lord and Savior. If you do, put this in your signature.
And Here's The Proof
My Rainbow Of Levels
Mosaic's Museum(My Discord)

Image

Image

Danny wrote:Here's some constructive criticism: What the hell.
Witchking wrote:Approved!

Discord Quotes: show
Image


Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 7951
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Postby Enjl » 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")
The ABC of Creation
________________________________________________________
Image


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests