How do you detect the player is riding a horse?

Post » Tue Jun 19, 2012 6:57 pm

How do you detect that the player is currently riding a horse? In the conditions window http://www.creationkit.com/IsRidingHorse is available, but what is the script equivalent?

EDIT: Also http://www.creationkit.com/IsBeingRiddenis available in the conditions window, but no script equivalent either.
User avatar
maddison
 
Posts: 3498
Joined: Sat Mar 10, 2007 9:22 pm

Post » Tue Jun 19, 2012 5:07 pm

I came up with something a while back, posted it in http://www.gamesas.com/topic/1347565-no-papyrus-isridinghorse-function/page__p__20308648__hl__horse__fromsearch__1#entry20308648. It only works for the player, but someone also posted an idea that would probably work for NPCs. Kind of weird they didn't include a function for it though.
User avatar
Jamie Moysey
 
Posts: 3452
Joined: Sun May 13, 2007 6:31 am

Post » Tue Jun 19, 2012 1:09 pm

Alternately, you could try http://www.gamesas.com/topic/1354316-conditions-in-papyrus/.

Cipscis
User avatar
Spaceman
 
Posts: 3429
Joined: Wed May 23, 2007 10:09 am

Post » Tue Jun 19, 2012 1:06 pm

I came up with something a while back, posted it in http://www.gamesas.com/topic/1347565-no-papyrus-isridinghorse-function/page__p__20308648__hl__horse__fromsearch__1#entry20308648. It only works for the player, but someone also posted an idea that would probably work for NPCs. Kind of weird they didn't include a function for it though.
Detecting the player is perfect but I'll be running it from an alias. I check it out, see if it works. They also excluded IsBeingRidden from the script functions. I hope they add them in an update. At least they exist which means SKSE will be able to dig it out.

Alternately, you could try http://www.gamesas.com/topic/1354316-conditions-in-papyrus/.

Cipscis
Thanks but this is to do with 1st / 3rd person views on the horse - A much needed mod in its self! Is there something there that you saw that can help. I might be suffering from scripters blind spot. :blush:

What I'm trying to do is have a follower alias read what the player is doing (mounted /dismounted) and respond accordingly. Some as what we did in Oblivion for horse riding and evp'ing.
User avatar
Cedric Pearson
 
Posts: 3487
Joined: Fri Sep 28, 2007 9:39 pm

Post » Tue Jun 19, 2012 6:59 pm

Thanks but this is to do with 1st / 3rd person views on the horse - A much needed mod in its self! Is there something there that you saw that can help. I might be suffering from scripters blind spot. :blush:

What I'm trying to do is have a follower alias read what the player is doing (mounted /dismounted) and respond accordingly. Some as what we did in Oblivion for horse riding and evp'ing.

That post describes a generic method that can be used to give scripts access to every condition type available to effects, and there are a lot, including IsRidingHorse. Just replace the IsPC1stPerson condition with IsRidingHorse. The only drawbacks are that it requires a little more setup, and there's apparently a bit of a lag.
User avatar
Stacyia
 
Posts: 3361
Joined: Mon Jul 24, 2006 12:48 am

Post » Tue Jun 19, 2012 11:47 am

Thanks, I will have another look later.

Would any of these do the trick: GetPlayerAction (stub) or GetLastPlayerAction (no wiki info)? If they are anything like IsPlayerActionActive, perhap... not.

Or how about GetCurrentAIProcedure or GetCurrentAIPackage (no wiki info) which is in the conditions window. In Oblivion it had numbers such as ...

22 = MOUNT_HORSE
23 = DISMOUNT_HORSE
User avatar
Kill Bill
 
Posts: 3355
Joined: Wed Aug 30, 2006 2:22 am

Post » Tue Jun 19, 2012 4:06 pm

This is the way:
Game.GetPlayer().GetAnimationVariableBool("bIsRiding")
User avatar
Jhenna lee Lizama
 
Posts: 3344
Joined: Wed Jun 06, 2007 5:39 am

Post » Tue Jun 19, 2012 6:59 pm

The way that mitchalek posted would be the best way, it accesses the current havok animation's stored value of bIsRiding. There are many other useful variables stored in an animation but knowing which you have access to is a little more difficult, you either have to find another example used, or open up the havok animation yourself and take a peek.

Read the CK list and it pointed to a thread here
http://www.gamesas.com/topic/1360112-full-dump-of-all-animation-variables/
User avatar
Czar Kahchi
 
Posts: 3306
Joined: Mon Jul 30, 2007 11:56 am


Return to V - Skyrim