No Papyrus IsRidingHorse Function?

Post » Mon Jun 18, 2012 9:46 pm

The console function IsRidingHorse doesn't seem to have a Papyrus equivalent. The following workaround seems to work, but it seems a little odd that there's no function or property anywhere that'll just give you the answer. Am I missing something?

bool function PlayerOnHorse()   Actor lastHorse = Game.GetPlayersLastRiddenHorse()   if lastHorse == none      return false   else      return lastHorse.GetPlayerControls()   endIfendFunction

IsMoving() would also be nice, especially since IsRunning seems to return true even if the player is standing still.
User avatar
Kate Schofield
 
Posts: 3556
Joined: Mon Sep 18, 2006 11:58 am

Post » Mon Jun 18, 2012 7:44 am

You might be able to work something up using the below function.

-> http://www.creationkit.com/SetVehicle_-_Actor
User avatar
Lew.p
 
Posts: 3430
Joined: Thu Jun 07, 2007 5:31 pm

Post » Mon Jun 18, 2012 2:35 pm

How about his?: http://www.creationkit.com/GetSitting
User avatar
Nichola Haynes
 
Posts: 3457
Joined: Tue Aug 01, 2006 4:54 pm

Post » Mon Jun 18, 2012 9:07 pm

You might be able to work something up using the below function.

-> http://www.creationkit.com/SetVehicle_-_Actor

There doesn't seem to be a "GetVehicle" function, so that's sort of a dead end. Still a useful function though.

How about his?: http://www.creationkit.com/GetSitting

GetSitting is another console command, and the Papyrus equivalent, GetSitState, only returns 0, 2, 3, or 4, so it won't differentiate between sitting in a chair and sitting on a horse.
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Mon Jun 18, 2012 3:46 pm

Use the event http://www.creationkit.com/OnSit_-_Actor, and test the reference passed to it?
User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Mon Jun 18, 2012 9:14 pm

Use the event http://www.creationkit.com/OnSit_-_Actor, and test the reference passed to it?

Yup, that'd probably work, and it could be used for actors other than the player. That event has to be in an Actor script though, or a ReferenceAlias script, so for my purposes (checking only the player, in a quest script) the GetPlayerControls method is probably more straightforward.
User avatar
Motionsharp
 
Posts: 3437
Joined: Sun Aug 06, 2006 1:33 am


Return to V - Skyrim