YesNoOk
avatar

How do I make Custom HUD for characters? (Read 2743 times)

Started by XxJRushxX, January 04, 2020, 05:32:35 am
Share this topic:
How do I make Custom HUD for characters?
#1  January 04, 2020, 05:32:35 am
  • avatar
  • *
  • I like pancakes
  • Lol no
    • USA
Yo, it's been a while! So, I've been working on a couple characters simultaneously and encountered a problem. I wanted a custom HUD to depict a variable that would normally be hidden without the debug menu; I went to the internet and hoped for answers, but all I got was results for screenpack lifebars or this one thread that reported an issue with character's custom HUDs disappearing for games with certain aspect ratios. I've even put together a short video to showcase my progress with these characters:



If you figure out anything, please let me know. Thanks!  ;D
oh ok
Re: How do I make Custom HUD for characters?
#2  January 04, 2020, 09:29:32 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
All you can do with debugs is use displaytoclipboard. You can't trigger any mugen specific actions on it or even check if its active. Most huds and the like use start as the key to bring them up.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: How do I make Custom HUD for characters?
#3  January 04, 2020, 10:31:23 am
  • avatar
  • *
  • I like pancakes
  • Lol no
    • USA
Yes, but that doesn't quite answer my problem. You know those extra power bars or gauges that appear on screen for some characters? For example, Warusaki's Jotaro or Team Z2's Tien that put images up on the screen to show a value that would, in normal mugen, be hidden. I wish to know more about this technique and how to do it. I've tried it once myself and could only achieve something that didn't lock to the screen like most of custom HUDs did.
oh ok
Re: How do I make Custom HUD for characters?
#4  January 04, 2020, 02:21:47 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
These "bars" are just a helper or explod. You could dusplay a different sprite based on the "hidden" var value or simply scale up the sprite (usually for custom bars)
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: How do I make Custom HUD for characters?
#5  January 04, 2020, 02:37:00 pm
  • avatar
  • *
  • I like pancakes
  • Lol no
    • USA
These "bars" are just a helper or explod. You could dusplay a different sprite based on the "hidden" var value or simply scale up the sprite (usually for custom bars)

Thanks a lot, now one last question remains: How can I anchor these helpers or explods to the screen?
oh ok
Re: How do I make Custom HUD for characters?
#6  January 05, 2020, 12:29:21 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Well you said debug...

Anchoring is done with bindtime and the postype parameter. A postype of left right top etc will bind the explod to a specific point on the screen rather than the player. Helpers can be bound by using posset.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: How do I make Custom HUD for characters?
#7  January 05, 2020, 05:19:20 am
  • avatar
  • *
  • I like pancakes
  • Lol no
    • USA
Well you said debug...

Anchoring is done with bindtime and the postype parameter. A postype of left right top etc will bind the explod to a specific point on the screen rather than the player. Helpers can be bound by using posset.

Thank you very much. Although the "postype" parameter is deprecated in Mugen 1.1, so I think I might have to convert my characters over to that version if I feel the need to use explods. If you have any workarounds, I could try that. Thank you for the help!

Also, could you please elaborate on how I could use PosSet to bind helpers to the screen?

oh ok
Re: How do I make Custom HUD for characters?
#8  January 05, 2020, 05:23:57 am
  • avatar
  • *
  • I like pancakes
  • Lol no
    • USA
Nevermind, just figured out I was using the wrong parameters for postype. Thank you very much!
oh ok
Re: How do I make Custom HUD for characters?
#9  January 05, 2020, 05:36:27 am
  • avatar
  • *
  • I like pancakes
  • Lol no
    • USA
Oh, and one more thing...

I realized that when skipping intros, the explods disappear. Is this one of those instances where I use the helpers, or is there a workaround to this?

EDIT: I found a workaround, I could just use the statedef -2 to draw a new explod every frame. I'm trying to create and manipulate a custom health gauge, but whenever I change the scale the explod just disappears. I tried using both modifyexplod and the basic explod sctrl, but nothing worked. I've even tried using
"(life/lifemax) > 0.9," which is the equivalent of 90% health or higher, as a trigger to change the scale, but then the explod just disappears when the health changes.

In the meantime while waiting for a reply, I'll do work on the characters in question. I'll eventually meet a roadblock where I have to make these gauges, so if you'd answer my questions I'd highly appreciate it. Thanks you guys! You're the best!
oh ok
Last Edit: January 05, 2020, 06:22:03 am by XxJRushxX
Re: How do I make Custom HUD for characters?
#10  January 05, 2020, 10:56:53 am
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
You're scaling it based on a specific formula and not variables, right?

So far what you're saying you did is right, as you should only have to trigger an explod once with trigger1 = numexplod(XXXX) = 0, then when you scale it with modify explod like this it should work:
Code:
[state -2 example]
type = modifyExplod
Triggerall = (life/lifemax) > 0.9
trigger1 = 1
ID = XXXX
scale = ([your initial explod's x value]*[whatever formula you're actually using]),[your initial explod's y value] .
IgnoreHitPause = 1
Persistent = 1

You should post the formula you use, and the whole code if possible. I've done this countless times before with both hard health/power data and variables and I've never had the explod disappear. If it is disappearing then the explod exists but the modifyexplod is drawing it so that it returns 0.
Re: How do I make Custom HUD for characters?
#11  January 05, 2020, 09:44:30 pm
  • *****
  • Shame on you!
    • USA
@Bannana: Watch the quadruple posts. Not even sure how many I just removed. :P
vVv Ryuko718 Updated 10/31/22 vVv
Re: How do I make Custom HUD for characters?
#12  January 05, 2020, 09:51:41 pm
  • ***
  • Non est hoc propter hoc sed propter est hoc
    • USA
    • doubletrend-zeta.neocities.org/
Re: How do I make Custom HUD for characters?
#13  January 06, 2020, 01:29:58 am
  • avatar
  • *
  • I like pancakes
  • Lol no
    • USA
Code:
[State -2, updateHealth]
type = ModifyExplod
trigger1 = 1
ID = 11000
anim = 104000
pos = 12,-61
postype = back  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = -1
scale = 1,1*(life/lifemax) ;----Modifying this value makes it disappear
sprpriority = 3
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0

I've tried multiple methods, even redrawing the explod every frame and using the position instead of the scale (which would, instead, move to a point once health updated and stay there for the rest of the time.)
oh ok
Re: How do I make Custom HUD for characters?
#14  January 06, 2020, 08:57:55 pm
  • *****
  • Shame on you!
    • USA
vVv Ryuko718 Updated 10/31/22 vVv