Jump to content

Player.MoveTo Function


falloutperson416

Recommended Posts

So, I've got this script that is basically used to teleport the player to different x marker headings. The problem is, MoveTo on its own doesn't work, I need to move the player to the x marker. Player.MoveTo fails to compile, any help?

 

 

Scriptname IHTeleportationScript extends ObjectReference  
{Teleports the player to vanilla houses}

ObjectReference Property IHBreezehomeREF auto
ObjectReference Property IHHoneysideREF auto
ObjectReference Property IHVlindrelHallREF auto
ObjectReference Property IHHjerimREF auto
ObjectReference Property IHProudspireManorREF auto
ObjectReference Property PlayerREF

Message Property IHTeleMessage auto 
Message Property IHTeleMessage2 auto
Message Property IHTeleMessage3 auto
Message Property IHTeleMessage4 auto
Message Property IHTeleMessage5 auto
Message Property IHTeleMessage6 auto

int count  

  Event OnActivate (ObjectReference akActionRef)

       int Button
       Button = IHTeleMessage.Show()
       if Button == 0  ; button 1 pressed
             
       elseif Button == 1      ; button 2 pressed
                player.MoveTo (IHBreezehomeREF)
                      IHTeleMessage2.Show()
       elseif Button == 2      ; button 3 pressed
                player.MoveTo (IHHoneysideREF)
                      IHTeleMessage3.Show()
       elseif Button == 3      ; button 4 pressed
                player.MoveTo (IHVlindrelHallREF)
                      IHTeleMessage4.Show()
       elseif Button == 4      ; button 5 pressed
                player.MoveTo (IHHjerimREF)
                      IHTeleMessage5.Show()
       elseif Button == 5      ; button 6 pressed
                player.MoveTo (IHProudspireManorREF)      
                      IHTeleMessage6.Show()
       endif
  EndEvent

Edited by falloutperson416
Link to comment
Share on other sites

You want to word it like this:

 

Game.Getplayer() can't come from nowhere. The workaround is pointing at the activator and identifying the actor as the player.

 

 

 



Event OnActivate(ObjectReference akActionRef)  
 If akActionRef == Game.GetPlayer()
     If (Button == 1)     ; button 2 pressed
        akActionRef.MoveTo (IHBreezehomeREF)*
    ElseIf
                   ; End the interraction
     EndIf
 EndIf
EndEvent

 

Hope this helps :)

Edited by Scarlex
Link to comment
Share on other sites

Like Gasti said, your player property is "PlayerREF" not "player".

 

 

Scriptname IHTeleportationScript extends ObjectReference  
{Teleports the player to vanilla houses}

ObjectReference Property IHBreezehomeREF auto
ObjectReference Property IHHoneysideREF auto
ObjectReference Property IHVlindrelHallREF auto
ObjectReference Property IHHjerimREF auto
ObjectReference Property IHProudspireManorREF auto
ObjectReference Property PlayerREF

Message Property IHTeleMessage auto 
Message Property IHTeleMessage2 auto
Message Property IHTeleMessage3 auto
Message Property IHTeleMessage4 auto
Message Property IHTeleMessage5 auto
Message Property IHTeleMessage6 auto

int count  

  Event OnActivate (ObjectReference akActionRef)

       int Button
       Button = IHTeleMessage.Show()
       if Button == 0  ; button 1 pressed
             
       elseif Button == 1      ; button 2 pressed
                PlayerREF.MoveTo (IHBreezehomeREF)
                      IHTeleMessage2.Show()
       elseif Button == 2      ; button 3 pressed
                PlayerREF.MoveTo (IHHoneysideREF)
                      IHTeleMessage3.Show()
       elseif Button == 3      ; button 4 pressed
                PlayerREF.MoveTo (IHVlindrelHallREF)
                      IHTeleMessage4.Show()
       elseif Button == 4      ; button 5 pressed
                PlayerREF.MoveTo (IHHjerimREF)
                      IHTeleMessage5.Show()
       elseif Button == 5      ; button 6 pressed
                PlayerREF.MoveTo (IHProudspireManorREF)      
                      IHTeleMessage6.Show()
       endif
  EndEvent

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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