Jump to content

Help needed with placing a Dynamic MapMarker.


Recommended Posts

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

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 by Rasikko
Link to comment
Share on other sites

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

  • 10 months later...

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


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 by ReDragon2013
Link to comment
Share on other sites

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 worldspace
  • have a duplicate mapmarker in the desired worldspace that's disabled, and enabled it as needed
  • make the player change worldspace and return

NB going into an interior cell does not count as changing worldspace.

 

Hope this helps!

 

Cheers - dafydd99

Link to comment
Share on other sites

 

 

    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 by piotrmil
Link to comment
Share on other sites

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 by TheWanderer001
Link to comment
Share on other sites

  • 3 weeks later...

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

  • Recently Browsing   0 members

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