Jump to content

how to use getlastplayeraction/isplayeractionactive


Pendraz

Recommended Posts

Well the title says it all.

 

i wanted to add in my script a line which works on its own, completely unlinked from the rest of the code, which should just check if the character is currently jumping, but i can't seem to get it to work.

 

at first i had tried to put it in a line with various others conditions, like "If ... && getlastplayeraction == 6 ... effect" or "If ... isplayeractionactive 6 ... effect" but the effect would never trigger, while the rest of the script works fine.

then i have tried to eliminate all the other conditions, to see if it would work only as a condition on its own. but nothing. then i tried even without the "if" but at this point the effect would trigger automatically.

 

The whole script is running under "GameMode", could that be the cause? And if so, what am i supposed to use in order to use this condition?

 

Thanks everybody, i hope this is understandable enough :P

Link to comment
Share on other sites

I can't find the post or PM of reference, but I'm pretty sure I remember someone reporting that these functions can't be used to check if the player is jumping. The best alternative is probably to use IsAnimPlaying to check if any of the "Jump" animations are currently being played on the player.

 

Unfortunately, certain jumps (especially small ones) don't always seem to cause the appropriate animations to play, so this solution probably won't work as perfectly as we'd all like, but hopefully it's good enough for what you're trying to do.

 

Cipscis

Link to comment
Share on other sites

Hey thanks a lot for the answer.

 

I actually got "stuck" with this idea of trying to make it work because i saw a mod containing a perk which would trigger its effect exactly by using the isplayeractionactive for the jump. So i guess I'll give that a try as well (even if it won't be exactly as i had planned, but oh well, I can still make the perk trigger its own script in theory (never tried to make perks though so far, /sigh ).

 

I'll also give a try to your great tip though, if it works and after some testing it proves to be reliable I'll definitely stick with that.

Thanks again :)

 

edit: IsAnimPlaying doesn't seem to be working for me either unless i screwed up royally (which is very likely in my case).

 

If player.IsAnimPlaying Jumploop == 1

player.setav luck 6

endif

 

This is a test sample i made to try and see how it would work and only then add up stuff to it.

However the effect seems to trigger with any kind of animation, like for example making a step forward or backwards etc etc, not just when playing that specific animation. only time it doesn't trigger is if am standing still in the moment i start/load a game. in the second the character plays any kind of animation the effect will trigger, and i can't understand why. I have also tried with JumpStart and JumpLand instead of Jumploop, but with the same result.

Am i doing something wrong or?

I'll wait to see if anybody can give me any input on how i am supposed to make this work, otherwise i guess i'll start working on the perk.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...