SetVehicle (None)

Post » Thu Jun 21, 2012 9:35 am

I want the player to be detached from horse/cart/... befor being moved to new location. Scripting ref pointet to SetVehicle (None), but it dont work...

This is my script, which compiles wihout errors:

Scriptname crbBoatTeleportScript extends ObjectReference  ObjectReference Property teleDestMarker autoMessage Property Message1  AutoEvent onActivate(ObjectReference akActionRef)	int choice = Message1.Show()	if (choice == 0)		Game.GetPlayer().SetVehicle(None)		Game.GetPlayer().MoveTo(teleDestMarker)	EndIfEndEvent

I made a kind of ferry which transfers the player to a tiny island and back. AS soon as the player enters the trigger, he gets a message to choose if he wants to use the boat or not. Works fine unless the player sits on a horse...

Since "IsRiding" and "GetSitState" wont work with papyrus, I decided, to detach the player from any vehicle before moving him - according to the CK Scripting Ref I do this with SetVehicle(None). But it simply don′t work. Player is still riding the horse after transfer with causes the game to freeze or CTD.


Any help welcome! Thanks!
User avatar
Nice one
 
Posts: 3473
Joined: Thu Jun 21, 2007 5:30 am

Post » Thu Jun 21, 2012 1:02 pm

getsitstate does work btw it's an objectreference script function


also have you tried

If GetPlayersLastRiddenHorse() != None
GetPlayersLastRiddenHorse().moveTo(somewhere)
EndIf
User avatar
Vincent Joe
 
Posts: 3370
Joined: Wed Sep 26, 2007 1:13 pm

Post » Thu Jun 21, 2012 4:29 am

To get the player off the horse, you could make a Package associated with an alias that gets filled by the player at the appropriate time. Then just make a small Travel package with Allow Horse or whatever its called unchecked. The player gets off, walks a few steps, and then the transport script triggers.
User avatar
Laura Shipley
 
Posts: 3564
Joined: Thu Oct 26, 2006 4:47 am

Post » Thu Jun 21, 2012 10:50 am

Thank you two for your replies - big help!

Solved it!

I gave the "GetSitState" another try since Deceiver wrote, that this code should work - and it does!!
Guess, I coded something wrong yesterday and didn′t realize it :blink:

Thx again!
User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm


Return to V - Skyrim