Page 1 of 2

How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Thu Sep 04, 2014 7:17 am
by DarkShadeX
This shows you how to make a custom HUD like this:
Spoiler: show
Image
-What's Required?
1.You need the LATEST LunaDLL version (currently 8+)
you can get it here: (http://www.gamearchaeology.com/LunaDll.dll)
2.You need a Tool to make/draw the HUD like Paint.net or Photoshop.
3.Save this on your Computer:
Spoiler: show
Image
4.OPTIONAL:extr25 (Extractor) to hide the original icons/Reserve box.

After you got everything,start to make the HUD (use the above template as help (Second Spoiler)) and apply a PINK (Copy color from Template) Background to it this will be the transparent area.After you're done with the HUD,save it as a .bmp file.
It should look like this then:
Spoiler: show
Image
Place this .bmp file into the Level Folder that should use this HUD.
Now,make an lunadll or lunaworld Text Document and apply the following code to it:
Spoiler: show

Code: Select all

#-1
// --> Load image into slot 1 with transparency color FF00DC (Pink)
LoadImage,1,0xDC00FF,0,0,0,YOUR FILE NAME.bmp

// Place spritetype 1 from image slot 1 at X:0 Y:0
PlaceSprite,1,1,0,0,0,0
Start SMBX and the level and you should now see your new HUD!

REMEMBER:
-This BMP Sprite is 1 layer behind the Original Hud,that means it isn't infront of the original hud,so you can also just make a border for the original hud.

Heres also the Template for Toad/Peach/Link:
[rimg]http://www11.pic-upload.de/04.09.14/ubyi57hnii.png[/rimg]

Tutorial 1.5: How to make custom Life and Coins HUD text?
Spoiler: show
Simply add the following codes to the lunadll document:

Code: Select all

#-1
//Create 2 Variables for Coins and Lifes:
$CurrentCoins,SetVar,0,0,0,-1,1,0
$CurrentLifes,SetVar,0,0,0,-1,2,0

#0
//Show HUD data.
$CurrentCoins,LoadGlobalVar,0x00B2C5A8,0,0,0,0,w
$CurrentLifes,LoadGlobalVar,0x00B2C5AC,0,0,0,0,f
$CurrentCoins,ShowVar,0,X Position,Y Position,1,0,
$CurrentLifes,ShowVar,0,X Position,Y Position,1,0,
Multiplayer (2 Player/Battle) Templates:
Spoiler: show
Here are the Template for Super Mario and Super Luigi (2P):
[rimg]http://www11.pic-upload.de/04.09.14/5ll1sktw28h.png[/rimg]
Here is the Template for a Character Mix (2P)
[rimg]http://www11.pic-upload.de/04.09.14/3zwdzok48f62.png[/rimg]
Tutorial/Example 2: Get HUD sprite depending on Character:
Spoiler: show
NOW that is really easy!
Simply Add this Codes:

Code: Select all

#-1
// Load the Hud sprites into the Slot of your choice with transparency color FF00DC (PINK!!!)
LoadImage,1,0xDC00FF,0,0,0,MARIO_HUD.bmp
LoadImage,2,0xDC00FF,0,0,0,LUIGI_HUD.bmp
LoadImage,3,0xDC00FF,0,0,0,TOAD_HUD.bmp
LoadImage,4,0xDC00FF,0,0,0,PEACHY_HUD.bmp
LoadImage,5,0xDC00FF,0,0,0,HEY_HUD.bmp

//Get Player ID:
//OnPlayerMem,0xF0,Character ID,0,Event that starts to draw the hud,0,w
OnPlayerMem,0xF0,1,0,1101,0,w *Mario*
OnPlayerMem,0xF0,2,0,1102,0,w *Luigi*
OnPlayerMem,0xF0,3,0,1103,0,w *Toad*
OnPlayerMem,0xF0,4,0,1104,0,w *Peach*
OnPlayerMem,0xF0,6,0,1105,0,w *Link*
//Remove the *NAME*

//Now that we got dat,activate the HUD depending on character:
//Marios HUD:
#1101
PlaceSprite,1,1,0,0,0,0
//Luigis HUD:
#1102
PlaceSprite,1,2,0,0,0,0
//Toads HUD:
#1103
PlaceSprite,1,3,0,0,0,0
//Princess Peach's HUD:
#1104
PlaceSprite,1,4,0,0,0,0
//Links HUD:
#1105
PlaceSprite,1,5,0,0,0,0
//DONE!

Re: How to make a Custom HUD (LunaDLL V.8+)

Posted: Thu Sep 04, 2014 8:15 am
by zernicalohd
Very nice tuto, and very well explained thank you so much ^^

Re: How to make a Custom HUD (LunaDLL V.8+)

Posted: Thu Sep 04, 2014 8:19 am
by DarkShadeX
Just a preview what else can be done using lunadll and this tutorial ;)
(I will later explain how to draw the text at a custom position)
Spoiler: show
Image

Re: How to make a Custom HUD (LunaDLL V.8+)

Posted: Thu Sep 04, 2014 8:24 am
by Mudkip
Darkeyyyy you are a genius :D

Re: How to make a Custom HUD (LunaDLL V.8+)

Posted: Thu Sep 04, 2014 8:40 am
by Mikepjr
Sweeeeeet.
Can't wait to finally get a status hud how i want it.
I hate the default one with a passion.. too simple looking i suppose.

Re: How to make a Custom HUD (LunaDLL V.8+)

Posted: Thu Sep 04, 2014 9:16 am
by zernicalohd
Darkchaox100 wrote:Just a preview what else can be done using lunadll and this tutorial ;)
(I will later explain how to draw the text at a custom position)
Spoiler: show
Image
OMG, I'm waiting that tuto with all my passion :P I want to make something especial ^^

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Thu Sep 04, 2014 11:45 am
by DarkShadeX
Updated Main post a bit.

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Thu Sep 04, 2014 12:05 pm
by DarkShadeX
Alrighty,the Main post is done now,it also includes a code for each characters own hud (It might be the best to use this only in 1 Player Mode.)

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Thu Sep 04, 2014 1:02 pm
by FanofSMBX
Could please post example level?

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Thu Sep 04, 2014 1:08 pm
by DarkShadeX
FanofSMBX wrote:Could please post example level?
Here:
https://www.sendspace.com/file/w7y35m

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Sat Nov 15, 2014 6:06 pm
by Sambo
It seems that your spoilers are broken. Will you fix it?

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Thu Nov 20, 2014 8:56 pm
by Cognition
I downloaded everything, made my own HUD, but when I put it all in the levels graphics folder and start SMBX I get Demos 0/65. I just need someone to explain what I'm doing wrong. Thanks

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Fri Nov 21, 2014 1:07 pm
by DarkShadeX
You have a really old LunaDLL version then.
Get this one:
dl.dropboxusercontent.com/u/45743579/Lunadll%20with%20lua%200.3.4.2.zip

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Fri Nov 21, 2014 1:21 pm
by FanofSMBX
You don't need to hack the exe. You can use LunaControl to remove the HUD.

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Fri Nov 21, 2014 3:31 pm
by Cognition
DarkShadeX wrote:You have a really old LunaDLL version then.
Get this one:
dl.dropboxusercontent.com/u/45743579/Lunadll%20with%20lua%200.3.4.2.zip
Thanks! I tried it out and it worked great. I'm going to start looking deeper into LunaDLL. Maybe change some power-ups.

Edit: I take back what I said about it working out great. It is now acting funny and only showing my custom HUD. It's not showing how many coins I have, how any lives or stars. It isn't even showing the reserve item. I want it to be like the original HUD just somewhat recolored. The only thing that is not recolored is the 1-Up symbol.

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Sat Nov 22, 2014 9:27 am
by DarkShadeX
You seem to use the LunaControl code.
Just remove it to unhide the original HUD.

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Sat Nov 22, 2014 4:45 pm
by Cognition
I see what I'm doing wrong... Even though I don't want to hack the .exe, I just need the extr25 (Extractor) which I have downloaded. Thanks for the help again, but if there is a different way to remove the old HUD but keep the numbers where they are let me know. :)

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Sun Nov 23, 2014 5:39 pm
by Anphiba
Amazing.
Custom HUD using LunaDLL.
I guess that means no more extr25!! I hope...
This post should be sticky!!

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Thu Dec 11, 2014 9:51 pm
by hacheipe399
Hey Dark did you found the offset for star count?

Re: How to make a Custom HUD (LunaDLL V.8+) UPDATED!

Posted: Fri Dec 12, 2014 8:49 am
by Catskart
How do we do for the Mario's (or Luigi's) reserve box ? :3