YesNoOk
avatar

MegaMan charge attacks, win poses against certain characters + more (Read 84157 times)

Started by RedDragonCats17, April 05, 2018, 03:02:57 am
Share this topic:
Re: MegaMan charge attacks, win poses against certain characters + more
#21  April 07, 2018, 11:03:14 am
  • *****
  • Shame on you!
    • USA
Code:
[State 310, VarSet]
type = VarSet
trigger1 = var(3) <= 5
var(3) = 0
This translates to If var 3 is less than or equal to 5 set it to 0. Which would then qualify to reset var 3 again because 0 is less than 5. This would fire off continuously.
You almost always want a triggerall that checks to see if the var is set, to what it's going to be set to, so it doesn't fire off every tic.
triggerall = var(3) != 0
I dont think this ^^^ is how you need it. I'm just making an observation.

You also have   
[State 310, Buster Reset]
type = VarSet
trigger1 = var(3) > 0
var(3) = 0
What ever adjusts this value wont have an opportunity to if this state is active.  If this is supposed to reset the var when the state is first launched you'd want a triggerall to check time = 0. If something in statedef -2 is adding to a the var it wont be able to. The way it is, statedef -2 and state 310 would be fighting with each other for no reason. You may also want to add a check to statedef -2 that you're not in state [300,330] or what ever range. [310,313] or whatever. Just remember ANY state in between the numbers will be blocked. So like if state 311 is a normal state it wont build power if you add these checks.


@fxfreitas: Why do you have var(0) and var(1) using the same triggers? If it's for hit count, you can easily do the math based off of 1 var. If it makes it easier and you have the variables it's not a big deal. But it just seems like a waste of a variable.
vVv Ryuko718 Updated 10/31/22 vVv
Re: MegaMan charge attacks, win poses against certain characters + more
#22  April 07, 2018, 04:46:30 pm
  • ***
  • I am a little editor of pixel art
    • Brazil
    • felipexavier.stuart@gmail.com
Code:
[State 310, VarSet]
type = VarSet
trigger1 = var(3) <= 5
var(3) = 0
This translates to If var 3 is less than or equal to 5 set it to 0. Which would then qualify to reset var 3 again because 0 is less than 5. This would fire off continuously.
You almost always want a triggerall that checks to see if the var is set, to what it's going to be set to, so it doesn't fire off every tic.
triggerall = var(3) != 0
I dont think this ^^^ is how you need it. I'm just making an observation.

You also have   
[State 310, Buster Reset]
type = VarSet
trigger1 = var(3) > 0
var(3) = 0
What ever adjusts this value wont have an opportunity to if this state is active.  If this is supposed to reset the var when the state is first launched you'd want a triggerall to check time = 0. If something in statedef -2 is adding to a the var it wont be able to. The way it is, statedef -2 and state 310 would be fighting with each other for no reason. You may also want to add a check to statedef -2 that you're not in state [300,330] or what ever range. [310,313] or whatever. Just remember ANY state in between the numbers will be blocked. So like if state 311 is a normal state it wont build power if you add these checks.


@fxfreitas: Why do you have var(0) and var(1) using the same triggers? If it's for hit count, you can easily do the math based off of 1 var. If it makes it easier and you have the variables it's not a big deal. But it just seems like a waste of a variable.

First, thank you for checking the code and point issues, it a bit old when my knowledge about mugen wasn't that good.

About the hits, my intention was make multiple chargeable weapons, so the hit counter is separated only for the Buster.
Re: MegaMan charge attacks, win poses against certain characters + more
#23  April 07, 2018, 09:06:48 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
What about this?

Code:
[State -1, ChangeState]
type = ChangeState
triggerall = power <= 1000
trigger1 = var(3) >= 5
trigger1 = command != "hold_y"
trigger1 = statetype = S
trigger1 = ctrl
value = 310

If I make the power greater than 1000, Zero will not fire his shot, but I want it to use 1000 power. How can I fix this?
Re: MegaMan charge attacks, win poses against certain characters + more
#24  April 07, 2018, 09:24:15 pm
  • ******
.cmd

triggerall = power <= 1000

This means you need to have power that is less than 1000 or equal.
power < number means the power you need is less than that number.
So to make him use the move when you have more than 1000 you use >

triggerall = power >= 1000 ;power must be more than 1000 or equal


.cns
Another thing, you want Zero to use his power, so you need to add a poweradd. Either below the statedef:
(example)
Code:
[Statedef 1000, Shooting]
type = S
movetype = A
physics = S
ctrl = 0
anim = 1000
poweradd = -1000
sprpriority = 2

[...]

or as a separate state controller:
Code:
[State 1000, PowerAdd]
type = PowerAdd
trigger1 = Time = 0
value = -1000
Re: MegaMan charge attacks, win poses against certain characters + more
#25  April 07, 2018, 09:37:02 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
I did try that, but as I said before, Zero will not fire, and I can't determine what's up.
Re: MegaMan charge attacks, win poses against certain characters + more
#26  April 07, 2018, 11:28:10 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
I guess I do have to change something in Statedef -2 and State 310, but idk what's to be changed.
Re: MegaMan charge attacks, win poses against certain characters + more
#27  April 08, 2018, 12:34:29 am
  • *****
  • Shame on you!
    • USA
Are you 100% sure that you have over 1000 power? If you know for certain that you have over 1000 in power and the >= doesn't work, set the >= value lower.
You may have something hiding in plain sight. Like your changestate might work but the state itself switches or ends instantly.
Make a test like
    [State -1, ChangeState]
    type = ChangeState
    triggerall = power >= 300
    trigger1 = var(3) >= 5
    trigger1 = command != "hold_y"
    trigger1 = statetype = S
    trigger1 = ctrl
    value = 310
and see if it'll fire.
vVv Ryuko718 Updated 10/31/22 vVv
Re: MegaMan charge attacks, win poses against certain characters + more
#28  April 08, 2018, 01:56:08 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Aight, I'll try.
Re: MegaMan charge attacks, win poses against certain characters + more
#29  April 08, 2018, 02:05:32 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
(quick, I know) God dammit... It still won't fire. I even tried 1 and 0, and it still won't fire.

Wtf, man? This is really starting to tick me off.
Re: MegaMan charge attacks, win poses against certain characters + more
#30  April 08, 2018, 02:22:28 am
  • ******
It's probably that variable then.

Code:
trigger1 = var(3) >= 5

what does that var(3) do?
Re: MegaMan charge attacks, win poses against certain characters + more
#31  April 08, 2018, 03:03:30 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
The original var(3) is for when I hold Y to charge the Buster Shot. It's this.

Code:
[State -2, Buster Charge]
type = VarAdd
trigger1 = command = "hold_y"
var(3) = 1
Last Edit: April 08, 2018, 04:04:39 am by RedDragonCats17
Re: MegaMan charge attacks, win poses against certain characters + more
#32  April 08, 2018, 03:11:05 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
The var(3) in the CMD was a part of XGargoyle’s code.

I did remove it, and Zero automatically spams is shot.
Last Edit: April 08, 2018, 04:05:18 am by RedDragonCats17
Re: MegaMan charge attacks, win poses against certain characters + more
#33  April 08, 2018, 08:28:43 am
  • *****
  • Shame on you!
    • USA
(quick, I know) God dammit... It still won't fire. I even tried 1 and 0, and it still won't fire.

Wtf, man? This is really starting to tick me off.
You mean
    [State -1, ChangeState]
    type = ChangeState
    triggerall = power >= 1   ;<<<This
    trigger1 = var(3) >= 5
    trigger1 = command != "hold_y"
    trigger1 = statetype = S
    trigger1 = ctrl
    value = 310
Wont work?? Are you using DisplayToClipboard to physically see that it should be working? Like are you displaying the var and the power values?
I only ask because you have another thing reseting Var(3) to 0 when command != hold_y. So these two triggers
    trigger1 = var(3) >= 5
    trigger1 = command != "hold_y"
could never be possible at the same time. I mean, depending on your set up.
Use displaytoclipboard and see what's happening.
vVv Ryuko718 Updated 10/31/22 vVv
Re: MegaMan charge attacks, win poses against certain characters + more
#34  April 08, 2018, 09:07:57 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Okay, I'm confused. I'm looking at the DisplayToClipboard code and the thread about this code, and even through I read the whole thing and looked at the example, my brain is pretty much smoked. How am I supposed to put this in?

I never used this before, so it's very advanced to me.
Last Edit: April 08, 2018, 09:17:07 am by RedDragonCats17
Re: MegaMan charge attacks, win poses against certain characters + more
#35  April 08, 2018, 10:13:12 am
  • *****
  • Shame on you!
    • USA
Well, it's so simple you're probably missing it. It goes in ANY state and will display in that state every tic you want it to.
BUT most people put it in statedef -2 and display it for every tic.
There's the display line and then there's the values to display line.
Spoiler: This is my current Noob's display to clipboard (click to see content)
Spoiler: This is my current Ryu's display to clipboard (click to see content)
Spoiler: This is my current Sagat's display to clipboard (click to see content)

These 3 examples should give you a pretty good understanding of what you can do with it. I try to keep the displaytoclipboard up at the top of Statedef -2 because I use FF3/FFS to jump to statedef -2 and it's right there. Once you use it, you'll ALWAYS use it.
Basically anything that can be saved as a variable's value can be displayed. And you can write the description. You don't have to have the = in it, but it helps when you look at it.

----
lol I just noticed how much the 3 displays have in common. >_<
 If you need more help let me know.

---- ----
[State -2, Debug data]
type = displaytoclipboard
trigger1 = time >= 0
text = "Power Float Value= %f,var(3) =%d, cmd = %d, Odb718kicksBUTT"
params = power, var(3), command != "hold_y"

One thing you'll notice is Odb718 is all caps when displayed.
vVv Ryuko718 Updated 10/31/22 vVv
Last Edit: April 08, 2018, 10:21:03 am by Odb718
Re: MegaMan charge attacks, win poses against certain characters + more
#36  April 08, 2018, 10:58:40 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Hmmmm, the var(3) continuously went up as I held Y, so I took the reset var(3) and put that into statedef -2, and now var(3) goes back to 0 like it was supposed to.

The power does go up when I'm holding Y, but cmd is 0. What does that mean?
Re: MegaMan charge attacks, win poses against certain characters + more
#37  April 08, 2018, 11:17:09 am
  • *****
  • Shame on you!
    • USA
cmd = %d,
command != "hold_y"

When you hold Y
cmd = 0 = command != "hold_y"
means that not holding y is false. 0 is false. If you let it got you get = 1.
so cmd = it's false that command doesn't equal p1 is holding y down.
vVv Ryuko718 Updated 10/31/22 vVv
Re: MegaMan charge attacks, win poses against certain characters + more
#38  April 08, 2018, 09:17:00 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
I don't see what's up with the level 1 shot in the debug and the Display Clipboard. The var(3) goes up when I hold Y and goes back to 0 when I release Y, the power does go up, so I don't see any problems.

So do you have any ideas on what's going on with the level 1 shot?
Re: MegaMan charge attacks, win poses against certain characters + more
#39  April 08, 2018, 09:31:35 pm
  • *****
  • Shame on you!
    • USA
So the move doesn't work, but the var is reset? Sounds like the problem I thought would happen.
The only place the var should get reset is IN the move.
In the CMD you're checking to see if the var is 5, and as soon as you let go of Y to activate the move, the var is 0... so the move can't activate
Comment out all of your var resets except for the one in the shot. If you don't have one in the shot, add it
 
If you want to be able to shoot and instantly start building up power again use the time = 0 in the varset.
If you want it so you cant build power while it's being shot set the var to 0 the entire time you're in the state. trigger1=1
vVv Ryuko718 Updated 10/31/22 vVv
Re: MegaMan charge attacks, win poses against certain characters + more
#40  April 08, 2018, 09:58:27 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Here's the thing. Even though the var reset is in the shot state, Zero still won't fire.

I have been switching the var reset back and fourth between Statedef -2 and state 310 as a means to figure out how this shizz work. Got any more ideas?
Last Edit: April 09, 2018, 12:26:43 am by RedDragonCats17