Re: LunaLua Offical Thread - SMBX Usermod Framework
Posted: Fri Nov 20, 2015 10:58 pm
Thanks! I've managed to make this with your help:Enjl wrote:The name for the world .lua file is lunaoverworld.lua
Spoiler: show
Forums for SMBX
https://www.smbxgame.com/forums/
Thanks! I've managed to make this with your help:Enjl wrote:The name for the world .lua file is lunaoverworld.lua
Are you talking about the custom NPC graphics with ".gif" or the new one with ".png"?Voymo wrote:Guys, there is a (new) bug in the 7.2.2 version of SMBX 1.3.0.2 (haven't tested 1.3.0.1). After start, if you load an episode that has custom NPC graphics FIRST, then quitting and load an episode that has the default NPC graphics, the NPC's mask gets messed up (the old custom mask will still be used). However this doesn't happen if you load an episode with default graphics first and THEN another one that has custom graphics.
Not sure if this only applies to NPC custom graphics...
Ok I think I start to understand why no one have already made the inventory mode, is already started in the lunalua LuaScriptsLib folder but not yet finishedlotus006 wrote:I'm really surprised about the progress i've done to my inventory, I started now savedata and it's almost work now for when we collect items it's follow you
over the level, just a question how i'm saving onto the folder where is lunaworld instead of the level folder ?
And also I'm stuck again with sprites, I have some question about the size of the addon when he is finished for the user, is it a problem
if the pack will be over 3 or 4 mb the size I mean ? and I try to do concatenateit's say i can concatenate a upvalue something like this, or I got an another solution is to duplicate img "\\SelMushroom" .. i .. ".png "Code: Select all
local SelMushroom = {} for i=1, 6 do table.insert(SelMushroom .. i , Graphics.loadImage(resPath .. "\\SelMushroom.png") ); end
but the size of the addon will grow alot with this
Any solutions ?
I'm desesperate with loop and local variable of imagenothing work because uservalue
Thanks in advance.
sprite = Graphics.loadImage("sprite.png)lotus006 wrote:because there is no possible way to make more than 1 same sprites without make a copy of the png when
is loaded in the game the same png will not appear until you make a copy of a copy of the png, I hope in the next Lunalua this bug will be corrected.
I will take a break now because I think is impossbile to make the inventory mode for now.
Thanks for this, but in this case it should work but I test on my stuff and isnt should work becauseEnjl wrote:sprite = Graphics.loadImage("sprite.png)lotus006 wrote:because there is no possible way to make more than 1 same sprites without make a copy of the png when
is loaded in the game the same png will not appear until you make a copy of a copy of the png, I hope in the next Lunalua this bug will be corrected.
I will take a break now because I think is impossbile to make the inventory mode for now.
function onLoop()
Graphics.drawImage(sprite, 0, 0)
Graphics.drawImage(sprite, 32, 0)
Graphics.drawImage(sprite, 64, 0)
Graphics.drawImage(sprite, 96, 0)
end
Just a simple example of how to draw the same image multiple times.
Code: Select all
Graphics.unplaceSprites(inv2);
Graphics.placeSprite(1,inv2, 160 , 518 );
what is the difference ?HenryRichard wrote:Why not find a way to make it work with Graphics.drawImage?
Graphics.drawImage draws the image for only one frame - it's gone the next one.lotus006 wrote:what is the difference ?HenryRichard wrote:Why not find a way to make it work with Graphics.drawImage?
Even if is in the loop section ?HenryRichard wrote:Graphics.drawImage draws the image for only one frame - it's gone the next one.lotus006 wrote:what is the difference ?HenryRichard wrote:Why not find a way to make it work with Graphics.drawImage?
Graphics.placeSprite makes the image drawn until it's removed with Graphics.unplaceSprite.
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)lotus006 wrote: Even if is in the loop section ?
And I can alway make moving with Graphics.drawImage ?
Oh I didnt know about this one i was thinking it's just an older code from older version, thanks I will try soonEnjl wrote: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)lotus006 wrote: Even if is in the loop section ?
And I can alway make moving with Graphics.drawImage ?
HenryRichard wrote:Graphics.drawImage draws the image for only one frame - it's gone the next one.
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
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