Problem Description
I’m working on creating a counter move for a character, as advised in the old website tutorial I made it into two states (and then had to update the code to current engine standard). First state blocks and if there’s an attack it actually blocks it will transition into the next state. Second state does the attack.
My current hang up here is that the transition simply isn’t working. I’m using EOnBlocking to make sure it only happens in response to an attack, and I know EOnBlocking functions because the log statement I put there goes through on block, but not the transition.
My transition works just fine when I put it into the F branch, but then it happens right away regardless of if there’s an attack to block. But it does show that the failure point isn’t in the second state, it’s somewhere in this one.
Code:
AttackRegister(Special)
# Adjust parameters here
F1-90:
# Can use Guard-All if you don't need to discriminate against a specific one, but here we want to be vulnerable to throws.
Flag(CanBlock)
Flag(Blocking)
Flag(CanBlock-All)
Flag(Blocking-All)
Log(ItWorks)
endif
# Check if we got hit, and thus transition into the counter.
EOnBlocking:
AttackRecievedGetParam(Damage, MyCoolVariable)
Log(Confirmed Counter)
Transition(CounterConfirmed)
endif
The variable stuff is because the attack is meant to inflict the same amount of damage as what it counters. I tried removing the variable update and making the transition the only thing after EOnBlocking but that didn’t work, neither did changing the indentation.
Technical Info
Castagne Version: 0.57
Host Engine: Godot
Genre: 2D Fighter / 2.5D Fighter
