YesNoOk
avatar

Create lifebar using Add004 (Read 1233 times)

Started by GaziraAgain, January 25, 2020, 10:30:44 AM
Share this topic:
Create lifebar using Add004
#1  January 25, 2020, 10:30:44 AM
  • ***
    • djjosehisterico@gmail.com
Hello to everyone, well, I'm working with the HUD' s expanded version of Blazblue Central Fiction. To do all my lifebars I use the awesome add004 because you have unlimited actions to do the anims. Ok! but in my other works I use the fight.def of mugen to work with the lifebar, but this time I wanna use the fightfx archive to reproduce it because I wanna do a better work in the recreation at the intro of the round. I try to add the sprites and modify the code but I can't do two things, all two very important things...
First of all, when I use the action facing=ifelse(teamside=1,-1,1) player 2 image it' s 1pixel misaligned to the right... I found in the common1.cns a part to modify the position of X,

;;>>@Config.LifeBar>>
;; lifebar init ; ƒ‰ƒCƒtƒo[ ‰Šú’l
;sys::init_lifebar
   trigger1=1|| var(31):=floor(ifelse(teamside=1,-18,18)*fvar(0)+var(3)*0.5) ;;<- LifeBar_Pos_X ;(XÀ•W)

Is this code that I must modify to position the images of player 2? If so, what should I do?

My other problem it's about the life bar. Add004 can use 3 bars for life, one for nodamage, another that it's the lifebar and the last for the danger. Wow! I don't understand nothing here... The life bar it' s in two segments in every of 3 a little part of the border and the rest. Based on what can I know the size of the small segment? And the most iportant thing, How can I give them a value? In the fight.def the mugen is used p1.range.x and p2.range.x, but the part that I think I need to modify in the common1 file, it's this?
Spoiler, click to toggle visibilty
This is the life bars that I wanna add:
Spoiler, click to toggle visibilty

Let's see if you can help me to move forward with the project, I would really appreciate it. Thank you very much.
Re: Create lifebar using Add004
#2  January 30, 2020, 01:39:51 AM
  • *****
  • Shame on you!
    • USA
I don't have much time to respond, so I'll try to later, but

   trigger1=1|| var(31):=floor(ifelse(teamside=1,-18,18)*fvar(0)+var(3)*0.5) ;;<- LifeBar_Pos_X ;(XÀ•W)

(teamside=1,-18,18)

The 18 values are the pixels. More than likely.
vVv Wheat Stage Released vVv
Re: Create lifebar using Add004
#3  January 30, 2020, 06:21:58 AM
  • ***
    • djjosehisterico@gmail.com
I don't have much time to respond, so I'll try to later, but

   trigger1=1|| var(31):=floor(ifelse(teamside=1,-18,18)*fvar(0)+var(3)*0.5) ;;<- LifeBar_Pos_X ;(XÀ•W)

(teamside=1,-18,18)

The 18 values are the pixels. More than likely.

Thanks for the response but I modify this values in the past and effective you modify the position of the lifebar but I can't move 1pixel to the left player's 2 lifebar. I try later another time.
Re: Create lifebar using Add004
#4  January 30, 2020, 12:12:57 PM
  • *****
  • Shame on you!
    • USA
I've seen a similar problem before with parallax scrolling and stages. You might want to dig around how the fix for the stage is worked out. Your solution may be very similar.
I guess it's because of the scaling.

You may be able to rework the math.
instead of
   trigger1=1|| var(31):=floor(ifelse(teamside=1,-18,18)*fvar(0)+var(3)*0.5) ;;<- LifeBar_Pos_X ;(XÀ•W)
maybe

   trigger1=1|| var(31):=floor(ifelse(teamside=1,(-18*fvar(0)+var(3)*0.5)),(18*fvar(0)+var(3)*0.5))) ;;<- LifeBar_Pos_X ;(XÀ•W)
You'd be able to modify the *0.5 of the side you need to get that half pixel?

Is the life bar jumping 2 pixels? 3 pixels?
vVv Wheat Stage Released vVv
Re: Create lifebar using Add004
#5  January 30, 2020, 02:11:40 PM
  • ***
    • djjosehisterico@gmail.com
Oh! Thank you very much!!! I try with this code later. About the pixels it's only 1 pixel misaligned. I need to displace it to the left.
EDIT:
I try the code and doesn't work... mugen crashes with a error related with the code.
Last Edit: January 30, 2020, 02:18:03 PM by GaziraAgain
Re: Create lifebar using Add004
#6  January 31, 2020, 12:53:16 PM
  • *****
  • Shame on you!
    • USA
I know it's misaligned 1 pixel. You said you've moved it. When you move it, does it move by 2 pixels, or 3 pixels, or more, at one time?

Code:
    trigger1=1|| var(31):=floor(ifelse(teamside=1,(-18*fvar(0)+var(3)*0.5),(18*fvar(0)+var(3)*0.5))) ;;<- LifeBar_Pos_X ;(XÀ•W)
Try this. I think it's to do with the brackets. I think I put 1 too many on accident.
vVv Wheat Stage Released vVv
Re: Create lifebar using Add004
#7  January 31, 2020, 02:13:06 PM
  • ***
    • djjosehisterico@gmail.com
Thank you again but this time nothing happens, the code work but lifebar it's in the same place.
I try to modify the code in the part that you see, for example I change (teamside=1,-18,18) for (teamside=1,-18,17) then player 2 lifebar move 4 pixels to the left. I try with decimals but doesn't work. Thank you very much for worrying and to see if you find the solution.
Re: Create lifebar using Add004
#8  February 01, 2020, 01:51:58 AM
  • *****
  • Shame on you!
    • USA
The fact that it's the same means it's working properly with the original values. So that's good news.

Maybe....
Code:
    trigger1=1|| var(31):=floor(ifelse(teamside=1,(-18*fvar(0)+var(3)*0.5),(18*fvar(0)+var(3)*0.5)-1)) ;;<- LifeBar_Pos_X ;(XÀ•W)
 
It's that last bit of code you want to edit. I'd think to do the total minus the value you need, OR you might have to edit the 0.5.

(18*fvar(0)+var(3)*0.5)-1)
This chunk of code is what you can edit and get it to move around.
I think if you remove the Floor(  ) it will crash. And I think the system is up-scaling everything 4x pixels. Have you tried to find info on the stages?

vVv Wheat Stage Released vVv
Re: Create lifebar using Add004
#9  February 01, 2020, 07:22:53 PM
  • ***
    • djjosehisterico@gmail.com
Thank you very much again! But the code that you send me move player 2 lifebar 4 pixels to the left, I try to modify the code in the scale and other things but not move 1 f... pixel. For now I mount the anim in the fight.def and .sff files but I don't have some actions to mount all the animations and some of them works in the same layer...
Spoiler, click to toggle visibilty

This is the last Hud of blazblue so I would like to do it as well as possible. Can I send you the files whith the lifebars and have a look? Maybe the solution it' s not in the code.
Re: Create lifebar using Add004
#10  February 29, 2020, 11:32:24 AM
  • ***
    • djjosehisterico@gmail.com
Hello to everyone, well after much testing, look at files and patience finally I can add lifebar in the fightfx file of add004! Now I use more than 50 actions to reproduce the fade in of the lifebar, it' s really beautifull now! I include portraits and names and you can fade in them too.








Ok! All looks really good, but... no... like always I have some little problems to run it perfectly. I have already reached my limit of possibilities, I hope now if you help me to finish it please. Let' s start:

1- Portraits
This is the most important thing to correct. I take Kung Fu Man like a testing character. If you see the captures the portraits appears with a blend on top of the lifebar and with the names in the correct way.

Spoiler, click to toggle visibilty

Playing with Kirito by Sennou-Room portraits are in the good place but they are below the lifebar and names are not good.
Spoiler, click to toggle visibilty

And with Cody by Trololo portraits are completely misaligned, below lifebar and names are not good too.
Spoiler, click to toggle visibilty

I use the same code for everyone, then... what's happen? To correct the 1pixel misaligned bug that have at the start I modify a little the code of the common1.cns deleting the facing=ifelse(teamside=1,1,-1) line and I create this template with 2 portraits with the names and the add. I delete too the removeexplod at the end because the portraits desappear at the end of the round. 



This is the code that I have in the common1.cns:

Spoiler, click to toggle visibilty

And this is the coords and anims that I include at the end of the .air file:

Spoiler, click to toggle visibilty

2-Time:
Time it' s coded by default in fight.def archive but with this appears below lifebar and with layerno=1 looks bad... For this reason I create a counter animation that work in it' s correct place. The problem it' s when you finish the round.  In all fighting games, time stops at the second when the fight is over. But as I have used an animation it is continuous.
It would be possible to create a state or trigger ( I may be saying nonsense but that is what I understood ) for this actions to stop at the end of the round? This is the code that I use for them:

Spoiler, click to toggle visibilty

3-This is my last problem and it' s because before starting the round, the images in the fight.sff file are displayed on the screen for a very short time
Spoiler, click to toggle visibilty

I use the flags nobardisplay and invisible but not affect in this part. Where should I add them? I have added them in these two parts:

Spoiler, click to toggle visibilty

Okay, this is all. I hope that together you can solve these doubts to be able to have the lifebars finished. Thank you very much!

Last Edit: February 29, 2020, 11:38:30 AM by GaziraAgain
Re: Create lifebar using Add004
New #11  March 01, 2020, 01:23:34 PM
  • ***
    • djjosehisterico@gmail.com
For the 3rd problem I found a code created by shammahomega that removes all fight elements at the intro and end of the round. I remove the part of the end and copy at Statedef -2 in the common1.cns:

[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = RoundState = [0,1]
flag = nobardisplay

I test it with Kfm and works perfect but with other chars doesn't work... What has different kfm so that everything works well with him? Waiting some answers please.

EDIT:

I have the 3rd problem resolved. The problem it' s because kfm no have files in it' s statedef-2 then mugen takes codes from common1.cns with the changes that I apply. In other chars Add004pie copy the code without modification from it' s files. Then you need to add the same code at the end of the files that copy and works good!

The problem with the portraits it' s something like that. Rewriting the existing files in the statedef-2 with the edited ones I can work portraits on top of the lifebar and now Kirito it' s in his position but Cody no... Maybe you need to add individually coordinates for each char? I hope it can be fixed in another way... Well there is less! I have a great time !!! Waiting some help...
Spoiler, click to toggle visibilty
Last Edit: March 01, 2020, 06:39:45 PM by GaziraAgain