YesNoOk
avatar

Help scaling Explod for a custom powerbar in MUGEN 1.1 (Read 3696 times)

Started by Sir Ghostler, October 19, 2018, 04:09:52 pm
Share this topic:
Help scaling Explod for a custom powerbar in MUGEN 1.1
#1  October 19, 2018, 04:09:52 pm
  • ***
  • Working on MUGEN characters, 24/7.
    • Australia
So I'm creating a custom powerbar for one of my characters using a blank Helper with some Explods in MUGEN 1.1. I'm having trouble trying to scale and position the 'fill' layer so it lines up with the edge of the 'frame'.

I don't know how to go about having the fill layer positioned with the left width of the frame at all. I do have the scaling working, but it's using old-ass code from years ago which I could never get exactly right.

Here's what the bar currently looks like (while the root has 150 power).
Spoiler, click to toggle visibilty

Here's the powerbar code.
Spoiler, click to toggle visibilty

Any help would be appreciated. :) Hopefully I explained this correctly, lol.
Re: Help scaling Explod for a custom powerbar in MUGEN 1.1
#2  October 21, 2018, 12:22:49 pm
  • *****
  • Shame on you!
    • USA
I personally dislike extra power bars. BUT
I'm pretty sure the easiest way to get them to line up is to have the spot they need to line up at be the 0 point.
Then you position the base and the bar is perfectly lined up.
Is your bar's 0 point the center of the bar or one of the ends? How does it look in the Anim window in fighter factory?
vVv Ryuko718 Updated 10/31/22 vVv
Re: Help scaling Explod for a custom powerbar in MUGEN 1.1
#3  October 26, 2018, 06:32:49 am
  • ***
  • Working on MUGEN characters, 24/7.
    • Australia
Sorry for the late reply, they're centered in the middle.



I actually never thought about making the meet/line up point being in the center instead.
Re: Help scaling Explod for a custom powerbar in MUGEN 1.1
#4  October 26, 2018, 06:42:25 am
  • ****
  • Retired
  • Terminally Online
    • New Zealand
    • network.mugenguild.com/devon/
Your bar will need to be on the side to scale properly.

Here's an example being my revenge guage:


And here it is scaled in game:
Spoiler, click to toggle visibilty
Re: Help scaling Explod for a custom powerbar in MUGEN 1.1
#5  October 26, 2018, 04:25:48 pm
  • ***
  • Working on MUGEN characters, 24/7.
    • Australia
Ah, that fixed the positioning! Thanks, guys!

A related secondary request, could I possibly get some suggestions for improving the scaling code I'm currently using? At the moment, it's a little bit inaccurate. Otherwise I'll just keep playing with the numbers myself.
Re: Help scaling Explod for a custom powerbar in MUGEN 1.1
#6  October 26, 2018, 10:20:48 pm
  • *****
  • Shame on you!
    • USA
Post what you got.
You dont have to ask permission to post here. Just as long as you follow the rules for each sub section of the forum you'll be fine.
You should create new threads for new, unrelated, problems. Because the scaling code is for what you're trying to do it makes sense to post it here.

vVv Ryuko718 Updated 10/31/22 vVv
Re: Help scaling Explod for a custom powerbar in MUGEN 1.1
#7  October 26, 2018, 11:37:32 pm
  • ******
[State 20000, Modify Effect]
type = ModifyExplod
trigger1 = numexplod(20001)
id = 20001
scale = ifelse((root, power != 3000), root, power * 0.00033333 - floor(root, power * 0.00033333), 1.0), 1.0
ignorehitpause = 1

floor(root,power...) isnt necessary since in that equation, it will always turn out to be 1.

I recommend using a variable to keep track of the root's power.
Then divide the variable by 3000 in the scale code and you'll get a decimal.

Should give you more accurate results on top of making your code less obtuse. You can then use the variable in place of Root,power everywhere else.
Last Edit: October 26, 2018, 11:46:03 pm by Niitris
Re: Help scaling Explod for a custom powerbar in MUGEN 1.1
#8  November 03, 2018, 07:22:27 am
  • ***
  • Working on MUGEN characters, 24/7.
    • Australia
Post what you got.
You dont have to ask permission to post here. Just as long as you follow the rules for each sub section of the forum you'll be fine.
You should create new threads for new, unrelated, problems. Because the scaling code is for what you're trying to do it makes sense to post it here.

Gotcha. Thanks for the clarification.

[State 20000, Modify Effect]
type = ModifyExplod
trigger1 = numexplod(20001)
id = 20001
scale = ifelse((root, power != 3000), root, power * 0.00033333 - floor(root, power * 0.00033333), 1.0), 1.0
ignorehitpause = 1

floor(root,power...) isnt necessary since in that equation, it will always turn out to be 1.

I recommend using a variable to keep track of the root's power.
Then divide the variable by 3000 in the scale code and you'll get a decimal.

Should give you more accurate results on top of making your code less obtuse. You can then use the variable in place of Root,power everywhere else.

Finally got around to trying this, it works like a charm!

Thanks for the help, everyone! I was stuck on this for a while, lol. Topic solved. :)