YesNoOk
avatar

I tried, but your engine doesn't like letting Alpha Blade moves work consistentl (Read 2780 times)

Started by JasonThePhoenix, November 21, 2023, 02:56:18 AM
Share this topic:
I tried, but your engine doesn't like letting Alpha Blade moves work consistentl
#1  November 21, 2023, 02:56:18 AM
  • *
    • UK
I tried, but your engine doesn't like letting Alpha Blade moves work consistently.

The move is supposed to make the character go forwards, like a car, and upon impact with the foe (whether blocked or whether the foe failed to block doesn't matter), the character stops in front of the code if you aren't holding B, and stops behind the foe on impact if you are holding B (and then turn around to face the opponent).

If the character's rapidly zooming through the foe and turning over and over, changing direction over and over, not losing velocity when he should, that's wrong. If getting behind the foe only sometimes works but not always, that's also wrong.

[Statedef 930]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 935                       ;Change animation (Def: no change)
poweradd = 10                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 930, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 32, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -40, -304              ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = 5, 0                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 10             ;Time opponent is in hit state
ground.velocity = -16            ;Velocity at which opponent is pushed
airguard.velocity = -7.6,-3.2    ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -5.6,-12          ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 15                 ;Time before opponent regains control in air
guard.dist = 0

[State 930, 2]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0

[State 930, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 930, PlayerPush]
type = PlayerPush
trigger1=Time=[18,36]
value = 0

[State 930, Velset]
type = Velset
trigger1=Time=[18,36]
Trigger1=p2dist x > 0
trigger1=!movecontact
x = 120

[State 930, Velset]
type = Velset
triggerall=Time=[18,64]
Trigger1=p2dist x < 0
trigger1=movecontact
x = 0

[State 930, VelSet]
type = VelSet
trigger1=Time=[18,36]
trigger1=movecontact
triggerall=!command="HoldB"
x = 0
ignorehitpause = 1

;
[State 930, 2]
type=posset
triggerall=Time=[18,64]
triggerall=movecontact
triggerall=command="HoldB"
Trigger1=facing=1
x=playerID(1),pos x+300
ignorehitpause=1
persistent=0

[State 930, 2]
type=posset
triggerall=Time=[18,64]
triggerall=movecontact
triggerall=command="HoldB"
Trigger1=facing=-1
x=playerID(1),pos x-300
ignorehitpause=1
persistent=0
;

[State 930, Turn]
type = Turn
triggerall=Time=[18,64]
trigger1=command="x"
Trigger1=p2dist x < 0
trigger1=movecontact

[State 930]
type=ChangeState
triggerall=Time=[18,64]
trigger1=command="x"
trigger1=movecontact
value=400
Re: I tried, but your engine doesn't like letting Alpha Blade moves work consistentl
#2  November 21, 2023, 03:42:25 AM
  • ****
  • Objection! Sustained!
    • Russia
    • mitia.pogorelov1@yandex.ru
Because it's better done with multiple states.
Make a separate state for your character pushing through the enemy and trigger it on movehit and the B button being held, while keep this state only for non-push through option.
Re: I tried, but your engine doesn't like letting Alpha Blade moves work consistentl
#3  November 21, 2023, 03:51:42 AM
  • *
    • UK
Because it's better done with multiple states.
Make a separate state for your character pushing through the enemy and trigger it on movehit and the B button being held, while keep this state only for non-push through option.

But how can I make that second state cleanly look like the character continuing the horizontal movement and stopping behind the foe?
Re: I tried, but your engine doesn't like letting Alpha Blade moves work consistentl
#4  November 21, 2023, 02:45:55 PM
  • ******
  • Cosplayer by day, MUGEN creator by night
  • In mourning after being C&D'd
    • Chile
    • network.mugenguild.com/basara/
You enjoy to over complicate things as I see in your other thread. Stop making overelaborated code for things you can't recreate.

The attack state should be a continuous attack with a specific speed (usually making trigger1 = time > 0 or trigger1 = 1) and then use movecontact to change to another state (a ChangeState) where your character stops (and state it the velset = 0). Or, make two different ChangeState, one for moveguarded (where the enemy block your attack) and another one for movehit (where you connect your attack). Or even more simple: just one ChangeState for moveguarded and make a movehit for the HitDef where you char changes to another state when he connects
Re: I tried, but your engine doesn't like letting Alpha Blade moves work consistentl
#5  November 21, 2023, 03:36:27 PM
  • ****
  • Objection! Sustained!
    • Russia
    • mitia.pogorelov1@yandex.ru
Because it's better done with multiple states.
Make a separate state for your character pushing through the enemy and trigger it on movehit and the B button being held, while keep this state only for non-push through option.

But how can I make that second state cleanly look like the character continuing the horizontal movement and stopping behind the foe?

That's called "PlayerPush". With value = 1, your character is able to walk through the enemy while retraining his hitboxes and, in turn, vulnerability.
Just trigger it with something like "animelemtime(1)>=0 && animelemtime(2)<0" or something. This code works for a single tick of time, so you gotta make sure it gets triggered for every tick of time you need for effect to be continious. "Ignorehitpause = 1" is appreciated too, just for safety.
Re: I tried, but your engine doesn't like letting Alpha Blade moves work consistentl
#6  November 22, 2023, 03:59:41 AM
  • *
    • UK
You enjoy to over complicate things as I see in your other thread. Stop making overelaborated code for things you can't recreate.

The attack state should be a continuous attack with a specific speed (usually making trigger1 = time > 0 or trigger1 = 1) and then use movecontact to change to another state (a ChangeState) where your character stops (and state it the velset = 0). Or, make two different ChangeState, one for moveguarded (where the enemy block your attack) and another one for movehit (where you connect your attack). Or even more simple: just one ChangeState for moveguarded and make a movehit for the HitDef where you char changes to another state when he connects

Yeah, I guess I have been overcomplicating things.

I want a move that goes forward real fast, and can stop behind the foe on contact or in front of the foe on contact, please let me know the one correct way to make that happen in mugen.

This is my first mugen character, I don't speak mugen's coding language, and I haven't been at this for 20 years. Sorry about how long this is taking, but the character should be done soon once this move works correctly. Aside from this and the meter, everything else the character has is straightforward.
Re: I tried, but your engine doesn't like letting Alpha Blade moves work consistentl
#7  November 23, 2023, 02:48:40 AM
  • ******
  • Cosplayer by day, MUGEN creator by night
  • In mourning after being C&D'd
    • Chile
    • network.mugenguild.com/basara/
It's OK, don't worry, but what you ask can be done easily in a couple of states instead of making the whole stuff in just one... and without exaggerate with a lot of vars and stuff like the ones you used.

I'll take your same example, the state 930, there you make a VelSet sctrl where the char makes a continuous speed, in this example, since the 3rd sprite, where he makes the rush
Code:
[State 930, Velset]
type = Velset
trigger1= animelemtime(3) >= 0
x = 12
Or can make "trigger1 = 1" if the char starts since sprite 1 to make the rush

In the HitDef you can add the line "p1stateno = XXX" to put the state your char will make when it connects, in this case, where it goes behind the opponent
Code:
[State 930, 1]
type = HitDef
trigger1 = AnimElem = 2
(...)
p1stateno = 932
Let's say it's 932 when your char makes the move. If you want the enemy stays in a custom state, then add also p2stateno for another state for the enemy... but an easier way is to make a higher number for ground.hittime (in your example is 10, you can make it like 40/50 so your char can make the move)

The PlayerPush sctrl shouldn't be necessary here since it's enable by default, but will be used later. After this, you make a ChangeState where the move ends, being because doesn't reach the opponent or he blocks it. For that will be used "animtime = 0" (if the anim has a limited time in last sprite) or "time = XXX" (if the last sprite is -1)
Code:
[State 930]
type = ChangeState
trigger1 = animtime = 0
trigger2 = moveguarded
trigger3 = command = "HoldB"
value = 931
T1 is when the anime goes out of time, T2 is when the opponent block the attack and T3 is when you hold B (not sure if the button b or push back XD)

Then you create the second state, the 931, where the move fails, there you can make an anim where your char goes back to normal and the speed goes to 0, usually something like this:
Code:
[Statedef 930]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 936

[State 930, Velset]
type = Velset
trigger1= time = 0
x = 0

[State 930]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

And after that, you make the success attack state, the 932, when you char goes behind the opponent for a surprise attack. There you can finally use PlayerPush sctrl and stated it to 0. To move your char, you can use VelSet or PosSet, any of them can be usable here, but the idea is your char makes the move in this state, and here add ChangeStates like "trigger1 = command = "x"" or another one you prefer, or another custom state where the char makes something special, or connect it with another special you already had coded. For example, I made the state 1999 for my ClayFighter chars when they make the Combo Breaker and it's just a "connect" state, where it goes inmediately to a Shoryuken-like attack already coded (usually 1191, the strong ver. of it)

I hope this clarify better what you want to make, as you see I don't use complicate sctrls and triggers, just the necessary to make the job done (less is more for me), good luck and I hope this works for you ;)