HellFencer Posted September 16, 2012 Share Posted September 16, 2012 I am using New Vegas Script Extender (most current edition). Alright, here is what I am trying to achieve: NPC joins youAccess object finder through "hired" menu optionsTell NPC to begin (setting a variable)NPC equips item with attached scriptScript locates nearest objectScript moves / generates an xmarker to get NPC to walk to locationNPC handles object once within a certain distanceNPC returns to player Where I am having trouble is getting the xmarker into the world and then moving it to the location. Here is the broken code:set placedObject to Player.PlaceAtMe XMarkerRef 1 currentObject.placeatme placedObject 1 Shouldn't this pace an xmarker at the player as placedObject, which can then be moved to the currentObject? I very much appreciate any help that the community can give! Link to comment Share on other sites More sharing options...
viennacalling Posted September 17, 2012 Share Posted September 17, 2012 1. Unless you have created a form object called XMarkerRef, I strongly suspect you want XMarker.2. Your second line is creating a second thing, not moving the object from the first line. set placedObject to Player.PlaceAtMe XMarker 1 placedObject.moveto currentObject Link to comment Share on other sites More sharing options...
HellFencer Posted September 17, 2012 Author Share Posted September 17, 2012 I created a new XMarker (by dragging XMarker into a cell) and gave it that reference. I assumed I would need to know a specific xmarker, given there are various ones all over cells already (and this script is meant to be used all over the place). However, you are right; I was creating objects, not moving them. You solved my issue, only backwards. :) XMarkerRef.moveto currentObject ;some other code to activate a travel AIpackage to XMarkerRef. Its late at the moment. I'll let you know after I've tested tomorrow. Thanks! Link to comment Share on other sites More sharing options...
HellFencer Posted September 17, 2012 Author Share Posted September 17, 2012 Okay, I got the script to work but modified it at bit: XMarkerRef.moveto currentObject set NPCRef.IsTraveling to 1 ;activates travel AIpackage to XMarkerRef This is successful. The NPC now walks to the object and interacts. However, immediately after doing so I CTD every time. I can only think that I am creating some kind of endless loop or something that eats all the memory. I am running the script on the NPC via equipping an item. Does the following setup cause issues? IE doing nothing when combat is initiated to try to save on system resources. begin gamemode if player.isincombat else ;not in combat ;Code endif ;combat end ;gamemode Link to comment Share on other sites More sharing options...
HellFencer Posted September 19, 2012 Author Share Posted September 19, 2012 Okay... Nevermind then. Link to comment Share on other sites More sharing options...
Recommended Posts