Korodic Posted February 10, 2012 Share Posted February 10, 2012 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 More sharing options...
Korodic Posted February 10, 2012 Author Share Posted February 10, 2012 It compiles but wont move the player to the REF, guess im gunna have to try direct coordinates. :wallbash: EDIT: Am I not allowed to call REF's from other cells...? Link to comment Share on other sites More sharing options...
Ocyris Posted February 11, 2012 Share Posted February 11, 2012 Check the MoveTo article on the wiki, the last note might be on point. You might try using kind of visible object while you're debugging it. Link to comment Share on other sites More sharing options...
Korodic Posted February 11, 2012 Author Share Posted February 11, 2012 I did, but I think the issue is beyond the function. I am using a script which extends quests, and this function probably needs the objectreference extension. Link to comment Share on other sites More sharing options...
Korodic Posted February 11, 2012 Author Share Posted February 11, 2012 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 More sharing options...
Galacticat42 Posted February 11, 2012 Share Posted February 11, 2012 This is the basic outline that you should have. ;Properties Quest Property QuestThatUsesThisScript auto ;Functions Function MoveMarker() ;Your stuff here endFunction ;Events Event onSuchEvent(arg1, arg2) MoveMarker() endEvent Link to comment Share on other sites More sharing options...
porroone Posted February 11, 2012 Share Posted February 11, 2012 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 More sharing options...
Korodic Posted February 11, 2012 Author Share Posted February 11, 2012 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 More sharing options...
Recommended Posts