just reading this and figured i'd point out that while my wallgrab code is quite a bit different since it's a tile code, it did originally have the same "limitation" of not being able to jump out of it.
if you do wish to have that, it's a fairly easy thing to fix.
in order to be able to jump from a grab state (akin to this script, mine uses ignore gravity for the wallgrab, which disables jumping.) one simply has to bypass the problem of not being able to jump because of <condition>
what i did was simply added a check in my jup script that if the player is on wallgrab state, and you press jump, the object movement speed is set to the jump values instead of attempting to execute the normal jump script which as we know, doesnt work.
as such;
Code:
GetCurrentActionType player1_object
CMP #$07 ; wallgrab action state (grravity is disabled)
BEQ doWallClimbJumpThing
CMP #$05
BNE notHurting_jump
RTS
doWallClimbJumpThing:
ChangeObjectState #$02, #$03
LDA #$00
SEC
SBC #$A0 ; #JUMP_SPEED_LO
STA Object_v_speed_lo,x
LDA #$00
SEC
SBC #$06 ; #JUMP_SPEED_HI
STA Object_v_speed_hi,x
RTS
notHurting_jump:
in this code #$07 is the wallgrab state, and the values i set to the H_speed and V_speed are same ones that my actual jump uses, so this code is actually invisible to user in the sense that it would be a separate code. It simply behaves identical to a normal jump