Jump to content

Moving players riding a horse


Thalassicus

Recommended Posts

I'm not 100% sure, but I'm thinking it can't be done mate... I remember seeing something similar somewhere to this, maybe on the Bethsoft forums, but the answer was generally that you can't teleport horse and rider together, something about both been referenced to appear at the same place in the other cell causing issues, thats why when you fast travel you're always dismounted when you arrive at your destination.

Sorry for the negative answer. And theres a chance there is a way to do it now, as that was a while ago, but I do remember reading it.

 

Jen

Link to comment
Share on other sites

Ahh... well, I'd be fine with dismounting. Here's the problem. I have a collision box that triggers the script below. When I test it by bumping the collision box while mounted, the following happens:

 

- Horse disappears

- Player disappears

- Camera stays put, but fixed to a range (like as if sitting on a chair)

- Unable to move

 

begin OnTriggerActor
set rTarget to getParentRef
set rActor to getActionRef
if rActor.IsRidingHorse
	set bIsActivated to 1
	set fTimer to 1
	PlaySound DRSWoodenOpen01
	rActor.MoveTo rTarget
endif
end

begin gamemode
if bIsActivated == 1
	if fTimer <= 0
		set bIsActivated to 0
	endif
endif
if fTimer > 0
	set fTimer to fTimer - getsecondspassed
endif
end

Link to comment
Share on other sites

You set up a timer, but you are not checking it. Therefore the TriggerZone is moving the actor every frame, which is the likely cause of the problem.

 

An "if rActor.IsRidingHorse && fTimer <= 0" should do the trick (but the TriggerZone will only move one actor per second)

 

Obs: The OnTrigger block runs every frame while there is an actor triggering it.

Link to comment
Share on other sites

Noticed that. I change the code to what's below, and now it does one of three things seemingly at random:

 

A) Same bug as above

B) Horse arrives at destination, leaves player behind

C) Game freezes at the load screen

 

Additionally after B, when I go to the horse and re-mount, the player will sometimes - but not always - be mounted in a standing pose.

 

I wish I knew of a way to call the coc console command, because that is reliable every time, and would work for what I'm trying to accomplish. Does anyone know of a way to call coc/fast travel?

 

begin OnTriggerActor
if bIsActivated == 1
	RETURN
endif
set rTarget to getParentRef
set rTrigActor to getActionRef
if rTrigActor == player
	if rTrigActor.IsRidingHorse
		printc "Arath: Activated by %X" rTrigActor
		set bIsActivated to 1
		set fTimer to 1
		PlaySound DRSCreakyOpen01
		rTrigActor.MoveTo rTarget
	endif
endif
end

begin gamemode
if bIsActivated == 0
	RETURN
endif
if fTimer > 0
	set fTimer to fTimer - getSecondsPassed
else
	set bIsActivated to 0
	PlaySound DRSCreakyClose01
endif
end

Link to comment
Share on other sites

Well, on my previous tests I was moving the player from a worldspace to an interior,

Just retried and it works fine.

 

But I found that moving a mounted player within Tamriel does not work.

After trying several approaches, the best I could come up with was dismount the player, wait until the dismounting finishes and, then, move the player and the horse.

 

The final script is this:

scn aaqqxxTestTrigSCRIPT
short bIsActivated 
ref refTarget 
ref refActor 
ref refHorse
ref reff 

begin OnTriggerActor
if bIsActivated == 0
	set refTarget to aaqqxxTestMarker
	set refActor to getActionRef
	if refActor == player
		if refActor.IsRidingHorse
			set bIsActivated to 3
			PlaySound DRSCreakyOpen01
			if eval refActor.GetParentWorldspace ==  tamriel
				let refHorse := refActor.GetHorse
				refHorse.activate player 1
			else
				refActor.MoveTo refTarget
			endif
		endif
	endif
elseif  refActor.IsRidingHorse == 0
;=== first frame after dismounting ===
	set bIsActivated to 0
	refHorse.MoveTo refTarget
	refActor.MoveTo refTarget
endif
end

Link to comment
Share on other sites

  • Recently Browsing   0 members

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