NPCs, Horses, and you
heres my solution for the Ariana companion. This script only mounts her on the horse and then causes her to follow, gotta figure out dismount next.
Secret: NPCs must actually be very close to the horse for a period of time, so the trick is to get her to stay close to the horse long enough for the USE HORSE command to kick in.
Heres my Example of how I got it to work. In addition, you need too create two packages as follows: Package 1) Travel To the Horse "atGetToHorse" TRAVEL PACKAGE to Horse Target ID (MUST REACH LOCATION) (USE HORSE) Package 2) Follow on Horse "atFollowOnHorse" FOLLOW PACKAGE to Player Target Ref (USE HORSE)
And here is the Snippet.
if Player.IsRidingHorse == 1 Message "your mounted" if IsRidingHorse == 0 if timerb <= 0 set timerb to 3 [[Category:Solution]How to get an NPC to mount a horse] addScriptPackage atGetToHorse else set timerb to timerb - getSecondsPassed endif else if riding == 0 addScriptPackage atFollowOnHorse endif set timerb to 0 set riding to 1 Message "Ariana is mounted" endif endif
Caveats -This script assumes that her horse is nearby, you could be in for long wait if its far away. I created a script to have her horse follow mine when its not being ridden. This is outside the scope of this tutorial. -Obviously the NPC must be the owner by direct reference or by faction -I used a Unique Horse ID 'E3Horse' so she couldnt be confused by other horses nearby. Note The 'riding' variable in the script is of type short created at the beginning and set to 0. Its just a toggle so that I know to change the package.