Page 23 of 48

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sat Nov 21, 2015 8:12 pm
by lotus006
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 ?

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sat Nov 21, 2015 10:16 pm
by HenryRichard
HenryRichard wrote:Graphics.drawImage draws the image for only one frame - it's gone the next one.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Sun Nov 22, 2015 2:12 am
by lotus006
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


Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Mon Nov 23, 2015 3:35 am
by Mosaic
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.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Tue Nov 24, 2015 4:43 pm
by Enjl
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.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Tue Nov 24, 2015 10:19 pm
by XerX
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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Wed Nov 25, 2015 12:13 am
by Mosaic
How do you put the path to your image in the lunalua code? I think i'm very close to making the money system

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Wed Nov 25, 2015 6:28 am
by Mable
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.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Wed Nov 25, 2015 11:08 am
by Cornholio309
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

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Wed Nov 25, 2015 1:26 pm
by Wohlstand
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.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Wed Nov 25, 2015 3:31 pm
by Cornholio309
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:


Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Thu Nov 26, 2015 8:48 am
by Wohlstand
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!"

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Thu Nov 26, 2015 11:00 am
by Cornholio309
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.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Thu Nov 26, 2015 7:45 pm
by Wohlstand
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)

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Fri Nov 27, 2015 3:35 am
by XerX
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.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Fri Nov 27, 2015 3:48 am
by lotus006
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 :)

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Fri Nov 27, 2015 4:29 am
by Kevsoft
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.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Fri Nov 27, 2015 9:47 am
by XerX
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.

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Fri Nov 27, 2015 12:04 pm
by Mosaic
Again, could someone please tell me how to put the image path in the code?

Re: LunaLua Offical Thread - SMBX Usermod Framework

Posted: Fri Nov 27, 2015 12:09 pm
by Enjl
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")