Jump to content

Scripting: Moving the player


Korodic

Recommended Posts

I need to move the player for a certain event, but I cannot figure out how.

 

Here is my script function

 

function MoveMarker()

MyREF.MoveTo(PlayerREF, abMatchRotation = true) ; (I didnt use these if i dont need em.) , afXOffset = 0.0, afYOffset = 0.0, afZOffset = 0.0,

endfunction

 

MyREF is a xmarkerheading

 

I had placed a code to test this in the fragment of a quest stage. But I switched the PlayerREF and MyREF, so the player would tele to where they were at.

 

Can I get some help with this?

 

btw this solution could double as a mark/recall spell script :P

Link to comment
Share on other sites

Maybe I'm just an idiot? Because I spent 6 hours today trying to get this to work. Can someone please check this out? Like make a basic shell of a moveto script and explain what you did. Because I have references, I have markers. They are all named, and are inside the script's properties. But when I try the command nothing happens. I am extending the object reference and it shows a message when it goes past a certain condition. But nothing is moving, PLEASE someone else look into this :facepalm:

 

I'm testing this in a fully navmeshed building w/ NPC moving to an object ref. Doesn't work at all. Do I need to add the script to the marker? or what? I'm running out of ideas >.>

Link to comment
Share on other sites

Are you defining the object that moves as a property ? you need to declare it as a property on the script then close the script, go to the panel where the Add/Remove/Properties are, select the script, click on properties, select the Object/Actor/whatever you want to move, then click on edit value, then 2 things will show up, cell and ref, where cell, the cell the object is and reference the object itself, If you dont do that, the script probably doesnt know what object needs to move, if you are doing what I just told and still getting the problem you migh want to try with a different function like SetPosition or TranslateTo, that last one is very useful since you can see the object move, so it helps for debugging purposes.
Link to comment
Share on other sites

Well I do have it in that format. Messages prove to me that my code does go to the function area. But nothing happens.

 

Each object is declared to be an ObjectReference inside the properties. Has anyone else actually tried the moveto command?

 

EDIT: I cannt use translate or setposition, because the object needs to be able to move across cells.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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