YesNoOk
avatar

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

Started by RedDragonCats17, April 05, 2018, 03:02:57 am
Share this topic:
MegaMan charge attacks, win poses against certain characters + more
#1  April 05, 2018, 03:02:57 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
I couldn't add everything that I needed help with in the title box.

So... I did say I needed some more help in my thread. So here's what's up. I got all of Zero's attacks in, right now he needs his charge slash, shot, and punch.

There was a forum thread in another MUGEN forum, and Borewood did post the code, but I can't seem to find it. Does anyone know how to code a charge attack in the same way MegaMan characters do it?

I'm pretty sure that Zero, Vent (Model ZX), and Rock are going to be easy, but Aile (Model X) and Omega Zero.... idk.
Last Edit: April 15, 2018, 12:00:44 am by RedDragonCats17
Re: MegaMan charge attacks, win poses against certain characters + more
#2  April 05, 2018, 12:42:46 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
You need to increase a variable (in a -2 state) while you are holding the button, and then code a changestate when the button is released.
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: MegaMan charge attacks, win poses against certain characters + more
#3  April 05, 2018, 08:00:21 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Mind showing me how I should code this?
Re: MegaMan charge attacks, win poses against certain characters + more
#4  April 05, 2018, 08:25:58 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
[state -2, variable charge]
type = varadd
trigger1 = command = "button hold"
var(x) = 1

and for the actual launch
[state -2, feuer!!]
type = changestate
trigger1 = var(x)>=any number ; adjust the value you want for the charged shot
trigger1 = command != "button hold" ;you release the button
trigger1 = ctrl ;player needs control or whatever conditions you want to set
triggerxxxx = any other conditions you want to specify or restrict
value = XXX ;state of the charged shot

And in the charged shot state, don't forget to reset var(x)
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: MegaMan charge attacks, win poses against certain characters + more
#5  April 05, 2018, 09:03:19 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Aight, here's what I got so far.

Code:
[State -2, VarAdd]
type = VarAdd
trigger1 = command = "hold_x"
var(3) = 1

[State -2, ChangeState]
type = ChangeState
trigger1 = var(3) >= 5
trigger1 = command != "hold_x"
trigger1 = ctrl
trigger2 = power = 1000 ;This is here because this is supposed to be the level 1 charge shot.
value = 310

1: Should I put in a State -1 in the commands, or am I good?

2: Can I use this for the fully charged (level 2) shot?
Re: MegaMan charge attacks, win poses against certain characters + more
#6  April 05, 2018, 09:20:51 pm
  • *****
  • Resident Tosspot
  • Pftheh
    • UK
    • plasmoidthunder.neocities.org
Problem with that is that the Power trigger is its own trigger, so he'll automatically change state whenever his Power is equal to 1000.

Also, that requires his Power to be exactly 1000, which is unlikely to happen unless that's the maximum he can have.

Oh, I want a diagram. I fucking love diagrams.
Re: MegaMan charge attacks, win poses against certain characters + more
#7  April 05, 2018, 10:20:29 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Do you know how I could make his level 1 charge shot require 1000 power? My idea is that as long as you hold the button (y for the Buster Shot), the power gauge will go up. If it's at 1000, the shot will be level 1. If it's 2000, which is a full bar for Zero, it'll be level 2 (full power).

Also, I've tried resetting the var by setting it back to 0 in the charge shot state, and Zero is still spamming the level 1 buster. Here's what I got.

Code:
[State 310, VarSet]
type = VarSet
trigger1 = var(3) = 1
var(3) = 0

Idk what people mean by "setting it back to 0", so.... How can I reset it?
Last Edit: April 05, 2018, 10:35:56 pm by RedDragonCats17
Re: MegaMan charge attacks, win poses against certain characters + more
#8  April 05, 2018, 11:10:31 pm
  • *****
  • Resident Tosspot
  • Pftheh
    • UK
    • plasmoidthunder.neocities.org
Wouldn't var(3) have a value of more than or equal to 5 by the time he enters the charge shot state?

Oh, I want a diagram. I fucking love diagrams.
Re: MegaMan charge attacks, win poses against certain characters + more
#9  April 06, 2018, 12:50:07 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Like this?

Code:
[State -2, ChangeState]
type = ChangeState
trigger1 = var(3) <= 5
trigger1 = command != "hold_y"
trigger1 = ctrl
trigger2 = power = 1000
value = 310

[State 310, VarSet]
type = VarSet
trigger1 = var(3) <= 5
var(3) = 0

Edit: Aight, I changed the button to Y, since that button is for the buster shot, and I changed the var on release Y. Like this:

Code:
[State -2, VarAdd]
type = VarAdd
trigger1 = command = "hold_y"
var(3) = 1

[State -2, ChangeState]
type = ChangeState
trigger1 = var(4) <= 5
trigger1 = command != "hold_y"
trigger1 = ctrl
trigger2 = power = 1000
value = 310

The least I have to do is this: Make the power gauge go up when I'm holding Y, make the level 1 shot require 1000 power, and reset the var(3) or var(4) (Gargoyle said var(x), so idk which var(x) he was referring to.)

(I'll probably make a idea engineering post while I wait for you guys)
Last Edit: April 06, 2018, 01:40:37 am by RedDragonCats17
Re: MegaMan charge attacks, win poses against certain characters + more
#10  April 06, 2018, 04:50:28 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
You still there, guys?
Re: MegaMan charge attacks, win poses against certain characters + more
#11  April 06, 2018, 04:03:30 pm
  • *****
  • Resident Tosspot
  • Pftheh
    • UK
    • plasmoidthunder.neocities.org
I feel like there's a misunderstanding here.

What you want is to have a variable increase while a button is held (which you have).
You then want that same variable to reset when that button is no longer being held.
If you have enough Power when you release the button, you want your character to go into the attack's state.

What you have now is the first part, but that same variable isn't being reset when the button isn't being held. In addition, your character is automatically going into the attack's state when he has exactly 1000 Power, since the Power trigger is trigger2 and all the other prerequisites are trigger1.

Oh, I want a diagram. I fucking love diagrams.
Re: MegaMan charge attacks, win poses against certain characters + more
#12  April 06, 2018, 07:28:13 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
So should I change the var(4) back to var(3) and change the power trigger to trigger1 or.... What's up?
Re: MegaMan charge attacks, win poses against certain characters + more
#13  April 06, 2018, 08:25:56 pm
  • *****
  • Shame on you!
    • USA
I dont think you'd want the changestate in -2. It should work in -1, the cmd.
Code:
[State -1, ChangeState]
type = ChangeState
triggerall = power >= 1000
trigger1 = var(3) >= 5  ;not sure how your var(3) works but I think it resets to 0 so itd always fire off if <= 5...
trigger1 = command != "hold_y"
trigger1 = ctrl
value = 310
vVv Ryuko718 Updated 10/31/22 vVv
Re: MegaMan charge attacks, win poses against certain characters + more
#14  April 06, 2018, 09:45:21 pm
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
I'll give it a shot.
Re: MegaMan charge attacks, win poses against certain characters + more
#15  April 06, 2018, 10:51:04 pm
  • *****
  • Shame on you!
    • USA
One tip for writing triggers is using two sentences to write and check if each trigger set is going to work properly.
#1 I need this to work when,
and to check
#2 Every time, ... this is going to happen.

So
I need this to work when P1's power is equal or greater than 1000, & var(3) is equal or greater than 5,  and you're not holding  y, & you have ctrl.
Every time P1's power is equal or greater than 1000, & var(3) is equal or greater than 5,  and you're not holding  y, & you have ctrl this thing will fire off.

If you did that for trigger2 = power = 1000
Every time P1's power is equal to 1000 this thing will fire off.
Would make it automatically fire. It's a pretty exact specification. and if you had greater than in there you'd never be able to not use it. So you need more triggers/checks.
vVv Ryuko718 Updated 10/31/22 vVv
Re: MegaMan charge attacks, win poses against certain characters + more
#16  April 07, 2018, 12:00:03 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Hmmm, triggerall seems to work much better than trigger2, although Zero still automatically fires and spams his level 1 shot when the power gauge is up to level 1 or 2.

My reset var(3) looks like this:

Code:
[State 310, VarSet]
type = VarSet
trigger1 = var(3) <= 5
var(3) = 0

There is a thread on how to reset variables, but there isn't a demonstration on how to do that, so I just made a guess and did this. How can you "reset the variable?"
Re: MegaMan charge attacks, win poses against certain characters + more
#17  April 07, 2018, 02:24:57 am
  • *****
  • Resident Tosspot
  • Pftheh
    • UK
    • plasmoidthunder.neocities.org
Wouldn't you want var(3) to reset regardless? I mean, you've placed that in the attack's state, so you'd want the charge to reset anyway. Besides, that'd only reset the var if it was less than or equal to 5, but what if it was higher than 5? You don't seem to have a limiter in place to prevent it from going above that value.

Oh, I want a diagram. I fucking love diagrams.
Re: MegaMan charge attacks, win poses against certain characters + more
#18  April 07, 2018, 02:36:05 am
  • ***
  • I am a little editor of pixel art
    • Brazil
    • felipexavier.stuart@gmail.com
Here a copy-paste code of a buster shot (Austin X base, but I've changed a bit)
CNS, basic buster projectiles, you can use helpers if you want as well:
Code:
;---------------------------------------------------------------------------
; Standing Buster Shot (strong punch)
[Statedef 220]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 10
ctrl = 0
velset = 0,0
anim = 220
;sprpriority = -1

[State -2, Effect]
type = Explod
trigger1 = time = 5
anim = 221
pos = 0,0
vel = 0,0
removetime = 15
ontop = 5
sprpriority = 2

[State 220, 0]
type = ChangeState
value = 220
triggerall = Time > 12
triggerall = NumProj < 3
triggerall = command = "z"
triggerall = command != "holddown"
trigger1 = statetype = S

[State 220, 0] ;Level 1 Buster Sound
type = Playsnd
triggerall = var(1) < 30
trigger1 = time = 0
value = 0,10

[State 220,4] ;Level 1 Buster Shot
type = Projectile
triggerall = var(1) < 30
trigger1 = Time = 12
projid = 222
projanim = 222
projhitanim = 900
projsprpriority = 1
offset = -10,0
velocity = 7
;HitDef
attr = S, SP
animtype = Light
damage = 15
getpower = 20
givepower = 20, 20
hitflag = MAFD
guardflag = MAF
pausetime = 0,0
sparkno = 0
sparkxy = 0,0
hitsound = s0,2
guardsound = s120,0
ground.type = High
ground.slidetime = 3
ground.hittime = 0
ground.velocity = -5
airguard.velocity = -5
air.velocity = -5
air.juggle = 9
air.fall = 1

[State 220, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------
[Statedef 221]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 220
;sprpriority = -1

[State -2, Effect]
type = Explod
trigger1 = time = 5
anim = 223
pos = 0,0
vel = 0,0
removetime = 12
sprpriority = 2
ontop = 5

[State 221, 0] ;Level 2 Buster Sound
type = Playsnd
triggerall = var(1) >= 30
triggerall = var(1) < 60
trigger1 = time = 0
value = 0,5

[State 221,4] ;Level 2 Buster Shot
type = Projectile
triggerall = var(1) >= 30
triggerall = var(1) < 60
trigger1 = Time = 0
projsprpriority = 1
projid = 224
projanim = 224
projhitanim = 901
supermovetime = 1000
pausemovetime = 1000
projhits = var(0)
offset = -10,0
velocity = .1
accel = .50,0
; HitDef
attr = S, SP
animtype = Medium
damage    = 20,10
hitflag = MAFD
guardflag = MAF
pausetime = 3,6
sparkno = 1
sparkxy = 0,0
hitsound   = s0,2
guardsound = s120,0
ground.type = High
ground.slidetime = 3
ground.hittime  = 20
ground.velocity = -5
airguard.velocity = -5
air.velocity = -5
air.juggle = 9
air.fall = 1

[State 221, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;------------------------------------
[Statedef 222]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 220
;sprpriority = -1

[State -2, Effect]
type = Explod
trigger1 = time = 5
anim = 223
pos = 0,0
vel = 0,0
removetime = 12
ontop = 5
sprpriority = 2

[State 212,0] ;Level 3 Buster Sound
type = Playsnd
triggerall = var(1) >= 60
triggerall = var(1) < 120
trigger1 = time = 0
value = 0,5

[State 212,4] ;Level 3 Buster Shot
type = Projectile
triggerall = var(1) >= 60
triggerall = var(1) < 120
trigger1 = Time = 0
projid = 224
projanim = 224
projhitanim = 902
supermovetime = 1000
pausemovetime = 1000
projsprpriority = 1
projhits = var(0)
offset = -20,0
velocity = .1
accel = .50,0
; HitDef
attr = S, SP
animtype = Medium
damage    = 20,10
hitflag = MAFD
guardflag = MAF
pausetime = 3,6
sparkno = 2
sparkxy = 0,0
hitsound   = s0,2
guardsound = s0,1
ground.type = High
ground.slidetime = 3
ground.hittime  = 20
ground.velocity = -5,-5
airguard.velocity = -5
air.velocity = -5,-5
air.juggle = 9
air.fall = 1

[State 212, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------
[Statedef 223]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 225
;sprpriority = -1

[State -2, Effect]
type = Explod
trigger1 = time = 0
anim = 226
pos = 0,0
vel = 0,0
removetime = 18
sprpriority = 2
ontop = 5

[State 223,0] ;Level 4 Buster Sound
type = Playsnd
triggerall = var(1) > 120
trigger1 = time = 0
value = 200,6

[State 1, Sound]
type = PlaySnd
trigger1 = var(1) > 120
trigger1 = time = 0
value = 250, 2

[State 223,4] ;Level 4 Buster Shot
type = Projectile
triggerall = var(1) > 120
trigger1 = Time = 0
projid = 227
projanim = 227
projhitanim = 903
projsprpriority = 1
supermovetime = 1000
pausemovetime = 1000
projhits = var(0)
offset = -20,0
velocity = .1
accel = .50,0
; HitDef
attr = S, SP
animtype = Hard
damage    = 20,10
hitflag = MAFD
guardflag = MAF
pausetime = 3,6
sparkno = 2
sparkxy = 0,0
hitsound   = s0,2
guardsound = s0,1
ground.type = High
ground.slidetime = 3
ground.hittime  = 20
ground.velocity = -5,-5
airguard.velocity = -5
air.velocity = -5,-5
air.juggle = 9
air.fall = 1

[State 223, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

CNS, statedef -3 (you can use -2 if you want), this code defines the explods, and sounds, and Austin's custom hit counter on charge (chare for enough time can make a 1000 damage buster shot, you can disable it removing the very first 4 var codes, and the vars related on the attack code:
Code:
[State -2, Reset Hits]
type = VarSet
triggerall = Command != "hold_z"
trigger1 = numproj != 0
trigger2 = Var(2) > 0
var(0) = 0

[State -2, Charge X-Buster Hits]
type = VarAdd
triggerall = timemod = 50,10
trigger1 = Command = "hold_z"
trigger1 = Var(2) = 0
trigger1 = ctrl
var(0) = 1

[State -2, Charge Reset]
type = VarSet
triggerall = Command != "hold_z"
trigger1 = numproj != 0
trigger2 = Var(2) > 0
var(1) = 0

[State -2, Max Charge]
type = VarSet
trigger1 = Var(1) >= 400
var(1) = 399

[State -2, Charge X-Buster]
type = VarAdd
trigger1 = Command = "hold_z"
trigger1 = Var(2) = 0
trigger1 = ctrl
var(1) = 1

[State -2, X-Buster]
type = Playsnd
trigger1 = Var(1) = 30
value = 210,0
channel = 1

[State -2, X-Buster]
type = Playsnd
trigger1 = Var(1) = 135
value = 200,1
channel = 2

[State -2, X-Buster Loop]
type = Playsnd
trigger1 = Var(1) = 135
value = 210,1
channel = 1
loop = 1

[State -2, Stop Loop]
type = Stopsnd
triggerall = Command != "hold_z"
trigger1 = numproj != 0
channel = 1

[State -2, Remove Charge]
type = RemoveExplod
trigger1 = Command != "hold_z"
id = 900

[State -2, Remove Charge]
type = RemoveExplod
trigger1 = Command != "hold_z"
id = 901


[State -2, Remove Charge]
type = RemoveExplod
trigger1 = Command != "hold_z"
id = 902

; -| Charge Level 1 |----------
[State -2, 1st Blue]
type = PalFX
triggerall = var(1) >= 30
triggerall = var(1) <= 60
trigger1 = TimeMod = 4,0
time = 2
add = 0,0,250

[State -2, 1st Charge]
type = Explod
triggerall = var(1) >= 30
triggerall = var(1) <= 60
triggerall = numexplod = 0
trigger1 = TimeMod = 1,0
anim = 228
id = 228
pos = 1,-5
bindtime = -1
ownpal = 1
ontop = 5

[State -2, Remove Charge]
type = RemoveExplod
trigger1 = command != "hold_z"
trigger2 = var(1) = 100
id = 228

; -| Charge Level 2 |----------
[State -2, 2nd Flash]
type = PalFX
triggerall = var(1) >= 60
triggerall = var(1) <= 120
trigger1 = TimeMod = 4,0
time = 2
add = 0,0,250

[State -2, 2nd Charge]
type = Explod
triggerall = var(1) >= 60
triggerall = var(1) <= 120
triggerall = numexplod = 0
trigger1 = TimeMod = 1,0
anim = 228
id = 228
pos = 0,-5
bindtime = -1
ownpal = 1
ontop = 5

[State -2, Remove Charge]
type = RemoveExplod
trigger1 = command != "hold_z"
trigger2 = var(1) = 300
id = 228

; -| Charge Level 3 |----------
[State -2, 3rd Flash]
type = PalFX
triggerall = var(1) >= 120
;triggerall = var(1) <= 180
trigger1 = TimeMod = 4,0
time = 2
add = 0,0,250

[State -2, 2nd Charge]
type = Explod
triggerall = var(1) >= 120
triggerall = numexplod = 0
trigger1 = TimeMod = 1,0
anim = 228
id = 228
pos = 0,-5
bindtime = -1
ownpal = 1
ontop = 5

[State -2, 3rd Charge]
type = Explod
triggerall = var(1) >= 120
;triggerall = var(1) <= 180
triggerall = numexplod(229) = 0
trigger1 = TimeMod = 1,0
anim = 229
id = 229
pos = 0,-5
bindtime = -1
ownpal = 1
ontop = 5

[State -2, Remove Charge]
type = RemoveExplod
trigger1 = command != "hold_z"
id = 229

[State -2, Remove Charge]
type = RemoveExplod
trigger1 = command != "hold_z"
id = 228

CMD, command to release the shot:
Code:
;Stand Buster Shot (Strong Punch)
[State -1, Stand Buster Shot]
type = ChangeState
value = 220
triggerall = var(59)!= 1
triggerall = NumProj < 3
triggerall = command = "z"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl

;Stand Level 2 Charged Shot
[State -1, Stand Level 2 Charged Shot]
type = ChangeState
value = 221
triggerall = var(59)!= 1
triggerall = command != "hold_z"
triggerall = var(1) >= 30
triggerall = var(1) < 60
triggerall = statetype = S
trigger1 = ctrl

;Stand Level 3 Charged Shot
[State -1, Stand Level 3 Charged Shot]
type = ChangeState
value = 222
triggerall = var(59)!= 1
triggerall = command != "hold_z"
triggerall = var(1) >= 60
triggerall = var(1) < 120
triggerall = statetype = S
trigger1 = ctrl

;Stand Level 4 Charged Shot
[State -1, Stand Level 4 Charged Shot]
type = ChangeState
value = 223
triggerall = Var(20) >= 0
triggerall = var(59)!= 1
triggerall = command != "hold_z"
triggerall = var(1) > 120
triggerall = statetype = S
trigger1 = ctrl
trigger2 = Var(15) > 0
If you want crouching and jump versions, just copy-paste the attack code and command code then change the properties to air and crouching, the statedef -3 vars works with all moves that use the var(1). On my command you can see the var(59)!= 1 its related to AI, you can remove that line...
Re: MegaMan charge attacks, win poses against certain characters + more
#19  April 07, 2018, 03:01:28 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
I'll give this a whirl. Thanks FX.
Re: MegaMan charge attacks, win poses against certain characters + more
#20  April 07, 2018, 06:59:36 am
  • ***
  • Part-Time MUGEN creator
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Okay, I took reference from the code that fx posted and the code that odb posted, and I'm getting close to perfecting the level 1 buster shot.

I made a poweradd for when I'm holding Y, so that the power gauge goes up to level 1 for the shot. Then I made a powerset to 0, so that the gauge goes back to 0.

Code:
[State -2, Buster Power]
type = PowerAdd
trigger1 = command = "hold_y"
value = 20

[State -2, PowerSet]
type = PowerSet
trigger1 = command != "hold_y"
value = 0

I also made a attempt to keep the gauge at 0 when in training mode by using another powerset, with trigger1 being roundset = 1, which failed miserably. I'll get on that another time.

Code:
;---------------------------------------------------------------------------
[State -1, ChangeState]
type = ChangeState
triggerall = power <= 1000; Zero can fire his level 1 shot when the power is less than or equal to 1000. If I make it greater than or exactly 1000, Zero will not fire; however, Zero will fire his level 1 shot with his default shot. It's awkward, really.
trigger1 = var(3) >= 5
trigger1 = command != "hold_y"
trigger1 = ctrl
value = 310

I took reference from fx's code for the reset var(3). Works like a charm.

Code:
[State 310, Buster Reset]
type = VarSet
trigger1 = var(3) > 0
var(3) = 0

I'm getting close. I just need a few more adjustments.