TheWanderer001 Posted March 21, 2020 Share Posted March 21, 2020 What I'm trying to do is add/move a mapmarker to the players current location via script in game. I've started out with the marker in game but originally disabled.The first time I run the script it works and the mapmarker is placed on the map at the players current location.Then later I disable the marker removing it from the map... but the next time I run the script it doesn't work... no mapmarker ??? The basic code I'm using is... relivant part from longer script... PlayerREF.PlaceAtMe(TWMapMarker, 1, true, false) TWMapMarker.MoveTo( PlayerREF ) TWMapMarker.Enable() TWMapMarker.AddToMap( True ) then later I'm just using... TWMapMarker.Disable() As I say this works the first time but not subsequent times...I'm sure I'm just missing something simple... but no idea what :sad: Hope someone can help :smile: Link to comment Share on other sites More sharing options...
Evangela Posted March 21, 2020 Share Posted March 21, 2020 (edited) You're not actually disabling the MapMarker that was created. Try this ObjectReference kMapMarker = PlayerREF.PlaceAtMe(TWMapMarker, 1, true, false) kMapMarker.MoveTo(PlayerREF) kMapMarker.Enable() kMapMarker.AddToMap(true) That will allow manipulation to the map marker created, as PlaceAtMe's return value is the thing it created. It may just be that you're experiencing a problem that PlaceAtMe has been documented to have with MapMarkers(doesn't actually create them). If so, you can instead link a regular marker to the map marker, and then manipulate that marker to suit your needs. Edited March 21, 2020 by Rasikko Link to comment Share on other sites More sharing options...
TheWanderer001 Posted March 21, 2020 Author Share Posted March 21, 2020 Thanks for response Rasikko :smile: Unfortunitly it didn't help... in fact using that code meant it didn't even work the first time :sad: Not sure how using an ordinary marker first would work.. the map marker would still need to be moved to that... same problem.Unless I'm misunderstanding what you mean... Link to comment Share on other sites More sharing options...
piotrmil Posted February 6, 2021 Share Posted February 6, 2021 Hey, have you found solution to that? I'm facing similar problem.I have created a custom warehouse cell, created a map marker there. Now in real map, I am calling Moveto(), and then AddtoMap(), and the map marker does move, but it isn't showing up, until you re-load the game. I'd love to know how to make it appear instantly when the script moves it. Link to comment Share on other sites More sharing options...
ReDragon2013 Posted February 6, 2021 Share Posted February 6, 2021 (edited) ObjectReference myMarker ; use a script variable here FUNCTION someFunction() IF ( myMarker ) myMarker.DisableNoWait() myMarker.Delete() myMarker = None ENDIF myMarker = PlayerREF.PlaceAtMe(TWMapMarker, 1, TRUE, False) myMarker.MoveTo( PlayerREF ) myMarker.Enable() myMarker.AddToMap( TRUE ) ENDFUNCTION Edited February 6, 2021 by ReDragon2013 Link to comment Share on other sites More sharing options...
TheWanderer001 Posted February 7, 2021 Author Share Posted February 7, 2021 (edited) Hi Can't remember the code I endded up using but you can check it out with my modmobile tent - https://www.nexusmods.com/skyrimspecialedition/mods/34308I don't currently play or mod Skyrim SE... Edited February 7, 2021 by TheWanderer001 Link to comment Share on other sites More sharing options...
dafydd99 Posted February 7, 2021 Share Posted February 7, 2021 I think you're coming across the same issue I had a while back. https://forums.nexusmods.com/index.php?/topic/8993053-moving-mapmarkers-across-worldspaces/ The problem is that you can't move a mapmarker into the current worldspace and see it - the mapmarkers are only placed on the map when a new worldspace is entered, and can't be forced. So you'd need to: only move the mapmarker when the player is in a different worldspacehave a duplicate mapmarker in the desired worldspace that's disabled, and enabled it as neededmake the player change worldspace and returnNB going into an interior cell does not count as changing worldspace. Hope this helps! Cheers - dafydd99 Link to comment Share on other sites More sharing options...
piotrmil Posted February 9, 2021 Share Posted February 9, 2021 (edited) ObjectReference myMarker ; use a script variable here FUNCTION someFunction() IF ( myMarker ) myMarker.DisableNoWait() myMarker.Delete() myMarker = None ENDIF myMarker = PlayerREF.PlaceAtMe(TWMapMarker, 1, TRUE, False) myMarker.MoveTo( PlayerREF ) myMarker.Enable() myMarker.AddToMap( TRUE ) ENDFUNCTION That didn't work at all. What's weirder is that if I place the object into new objectreference, the myMarker, game doesn't even prompt me that "map has been updated". If I do it the way it is done in the TWTentKitAdd, it at least prompts that, though the map marker is still not placed. Also, I tried placing the mapmarker in Tamriel, instead of warehouse cell, and it didn't help. Edited February 9, 2021 by piotrmil Link to comment Share on other sites More sharing options...
TheWanderer001 Posted February 9, 2021 Author Share Posted February 9, 2021 (edited) Sorry I can't help you :sad: The best solution I came up with was what I used in my Tent Mod... which worked for me most of the time... but not always... so not 100% as I said though I don't currently play or mod Skyrim SE... but will still be interested if you come up with better code. Edited February 9, 2021 by TheWanderer001 Link to comment Share on other sites More sharing options...
piotrmil Posted February 25, 2021 Share Posted February 25, 2021 Also, I tried placing the mapmarker in Tamriel, instead of warehouse cell, and it didn't help.Right, so I tried that again, but on safe clean test mod and it DID work. So the map marker has to be in the same WorldSpace, otherwise it won't reappear until you reload. Link to comment Share on other sites More sharing options...
Recommended Posts