LunaLUA: How to add item box to a custom HUD
Posted: Sat Jan 03, 2015 7:38 pm
I have created a complete re-code of the item reserve box with LunaLUA:
Using it is simple; just download the files and place them in your level's folder. Or if you want it for your whole episode, rename lunadll.lua to lunaworld.lua and place them in the episode folder instead.
Be careful not to overwrite your existing lunadll files. If you have lunadll.lua already, just add this to the onLoop function:
Don't forget to include 'end' at the end of your functions.
NOTE: The custom HUD shown is not included.
Spoiler: show
Be careful not to overwrite your existing lunadll files. If you have lunadll.lua already, just add this to the onLoop function:
Code: Select all
if reserve ~= player:mem(0x158, FIELD_WORD) then
reserve = player:mem(0x158, FIELD_WORD)
if reserve == 0 then
loadImage("NONE", 5, 0xdc00ff)
elseif reserve == 184 then
loadImage("../HUD/smb_shroom.bmp", 5, 0xdc00ff)
elseif reserve == 182 then
loadImage("../HUD/smb_flower.bmp", 5, 0xdc00ff)
elseif reserve == 9 then
loadImage("../HUD/smb3_shroom.bmp", 5, 0xdc00ff)
elseif reserve == 14 then
loadImage("../HUD/smb3_flower.bmp", 5, 0xdc00ff)
elseif reserve == 34 then
loadImage("../HUD/leaf.bmp", 5, 0xdc00ff)
elseif reserve == 264 then
loadImage("../HUD/smb3_iceflower.bmp", 5, 0xdc00ff)
elseif reserve == 169 then
loadImage("../HUD/tanooki_suit.bmp", 5, 0xdc00ff)
elseif reserve == 170 then
loadImage("../HUD/hammer_suit.bmp", 5, 0xdc00ff)
elseif reserve == 248 then
loadImage("../HUD/stopwatch.bmp", 5, 0xdc00ff)
elseif reserve == 185 then
loadImage("../HUD/smw_shroom.bmp", 5, 0xdc00ff)
elseif reserve == 183 then
loadImage("../HUD/smw_flower.bmp", 5, 0xdc00ff)
elseif reserve == 277 then
loadImage("../HUD/smw_iceflower.bmp", 5, 0xdc00ff)
end
placeSprite(1, 5, 384, 30)
end
NOTE: The custom HUD shown is not included.