Ability after spring

spellwiz

Member
I am hoping for relatively simple code to allow use of one's ability after hitting a spring. I've looked over every flag that can be given, and none seem to interfere with using the double jump ability after hitting a spring. Specifically I'm trying to be able to homing attack to a spring after using a spring. I've tried simple codes like:

if not P_IsObjectOnGround(player.mo)
//and not (player.pflags & PF_NIGHTSMODE)
and not (player.pflags & PF_ROPEHANG)
and not (player.pflags & PF_MACESPIN)
and not (player.pflags & PF_SLIDING)
and not (player.pflags & PF_CARRIED)
and not (player.pflags & PF_STASIS)
and not (player.pflags & PF_JUMPSTASIS)
and player.panim != PA_ROLL
player.mo.state = S_PLAY_ATK1
player.panim = PA_ROLL
end

I attempted that simply to test if it was an animation/state issue affecting the lack of being able to use the ability. charability2 is set to CA2_MULTIABILITY, so I can activate homing thok as many times as I like... until I hit a spring. Any help would be very appreciated, thank you!

Source: https://wiki.srb2.org/wiki/Object_flags
 
Setting the player to the rolling state is not enough—you may have noticed that if you try to hit an enemy after touching a spring with your current script, you'll take damage! What you additionally need to do is apply PF_JUMPED to the player's pflags; this will mark the player as if they had jumped into the air, which will allow you to damage enemies and use the jump abilities as well.
Code:
player.pflags = $ | PF_JUMPED
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top