zerther Posted July 22, 2016 Share Posted July 22, 2016 Just wondering if its possible to make an npc teleport to an x marker at the end of a dialogue topic. how would this be done? right now i have a script that does this via triggerbox, but im a nub at scripting and the same thing doesnt work withf ragments apparently. Link to comment Share on other sites More sharing options...
AnuH1 Posted July 23, 2016 Share Posted July 23, 2016 There are many ways to do this. But the easiest way is to use it directly. So you see the boxes beginning and end, in the end box type a comment to allow a script to form. It can be anything as long as it starts with a semicolon. Then press compile and in the Scripts tab to the end of this, you should see a new script with a blue plus sign. It will most likely begin with "TIF_". Close the windows and them the quest tab. Reopen it. Click on the script you just made and click properties. Add the NPC you want to move. Then add the reference you want them to move to. Then in the "end" box, your script should look something like this: NPC.MoveTo(MoveToMarker) I recommend adding Utility.Wait(5) before you type the line above in. This will give time for the conversation to finish so they don't disappear right after they say the last sentence. Link to comment Share on other sites More sharing options...
zerther Posted July 24, 2016 Author Share Posted July 24, 2016 (edited) On 7/23/2016 at 10:15 AM, AnuH1 said: There are many ways to do this. But the easiest way is to use it directly. So you see the boxes beginning and end, in the end box type a comment to allow a script to form. It can be anything as long as it starts with a semicolon. Then press compile and in the Scripts tab to the end of this, you should see a new script with a blue plus sign. It will most likely begin with "TIF_". Close the windows and them the quest tab. Reopen it. Click on the script you just made and click properties. Add the NPC you want to move. Then add the reference you want them to move to. Then in the "end" box, your script should look something like this: NPC.MoveTo(MoveToMarker) I recommend adding Utility.Wait(5) before you type the line above in. This will give time for the conversation to finish so they don't disappear right after they say the last sentence. doing this throws me the error: "moveto is not a function or does not exist" im actually using an x marker as an alias ref to fill the argument after moveto.... does this need to be saved as a different property type? Edited July 24, 2016 by zerther Link to comment Share on other sites More sharing options...
Ghaunadaur Posted July 24, 2016 Share Posted July 24, 2016 If you're using an alias for the marker...NPC.MoveTo(MoveToMarker.GetReference())should work. Link to comment Share on other sites More sharing options...
zerther Posted July 24, 2016 Author Share Posted July 24, 2016 On 7/24/2016 at 7:20 PM, Ghaunadaur said: If you're using an alias for the marker...NPC.MoveTo(MoveToMarker.GetReference())should work.This gives me GetReference is not a function or does not exist MoveTo is not a function or does not exist :( Link to comment Share on other sites More sharing options...
Ghaunadaur Posted July 25, 2016 Share Posted July 25, 2016 (edited) Can you post the script? Also make sure the property type is 'ReferenceAlias', not 'Alias'. Edited July 25, 2016 by Ghaunadaur Link to comment Share on other sites More sharing options...
zerther Posted July 25, 2016 Author Share Posted July 25, 2016 On 7/25/2016 at 12:51 AM, Ghaunadaur said: Can you post the script? Also make sure the property type is 'ReferenceAlias', not 'Alias'.Sure, and thanks for looking into it... sry about the links, i think they changed how you display images here? I have myalias and myxmarkerreference set to the actor and the xmarker im using in the properties window of the script http://imgur.com/a/TbiBN http://imgur.com/5kXTK9T http://imgur.com/JT3aRWu http://imgur.com/d4k459b i have x marker as a specific reference ----------------------- setting xmarker as an alias and not referencealias----------------- http://imgur.com/Ieb5vQ8 http://imgur.com/xPUIqwJ Link to comment Share on other sites More sharing options...
AnuH1 Posted July 25, 2016 Share Posted July 25, 2016 In the script, I noticed you are using GetActorRef(). This will not work as you are trying to get get an actor to move, however actors don't move in this sense. Object References do. Instead you need to call a GetObjectRef() on the alias to call it as an object reference. NPC.GetRef().MoveTo(MoveToMarker.GetReference()) Link to comment Share on other sites More sharing options...
zerther Posted July 25, 2016 Author Share Posted July 25, 2016 (edited) On 7/25/2016 at 9:20 AM, AnuH1 said: In the script, I noticed you are using GetActorRef(). This will not work as you are trying to get get an actor to move, however actors don't move in this sense. Object References do. Instead you need to call a GetObjectRef() on the alias to call it as an object reference. NPC.GetRef().MoveTo(MoveToMarker.GetReference())Alright. Thank you! that seemed to work. Also, I think I was typing "alias myalias property auto" instead of "referencealias", incase anyone else has this problem. So I need to know, is Getref( ) the same as Getreference()? Edited July 25, 2016 by zerther Link to comment Share on other sites More sharing options...
Ghaunadaur Posted July 25, 2016 Share Posted July 25, 2016 On 7/25/2016 at 3:23 PM, zerther said: So I need to know, is Getref( ) the same as Getreference()?GetRef() is a short version of GetReference(). Both are doing the same. ; Convenience function ObjectReference Function GetRef() return GetReference() endFunction Link to comment Share on other sites More sharing options...
Recommended Posts