Jump to content

Disabling/Enabling a specific MapMarker


Willy4x4

Recommended Posts

Hi everyone,

 

I have a question about Map markers, because I'm making a mod with an MCM that will let you enable/disable some specific ones, i know once you find a place it will show up on your map, but how would i disable it from displaying on my map?

I can't seem to find anything , found "tmm" which shows them all but i want it just for a specific map marker not all...

 

Link to comment
Share on other sites

yourmarker.disable() or yourmarker.getreference().disable() might work in your script. to enable, just change disable to enable.

That is the script command i tried but it didn't seem to disable it :(

 

Is this the right way to check if the Global Variable has changed?

Scriptname Mapmarker extends ObjectReference

ObjectReference Property Ore Auto
GlobalVariable Property Mapmarker_OnOff Auto

Function SomeFunction()                
	RegisterForUpdate(5.0) ; Before we can use OnUpdate() we must register.
EndFunction
 
Event OnUpdate() ; This event occurs every five seconds		
If (Mapmarker_OnOff.GetValue() == 1 )
Ore.Enable()
Else 
Ore.Disable()
EndIf
EndEvent

Link to comment
Share on other sites

 

yourmarker.disable() or yourmarker.getreference().disable() might work in your script. to enable, just change disable to enable.

That is the script command i tried but it didn't seem to disable it :(

 

Is this the right way to check if the Global Variable has changed?

Scriptname Mapmarker extends ObjectReference

ObjectReference Property Ore Auto
GlobalVariable Property Mapmarker_OnOff Auto

Function SomeFunction()                
	RegisterForUpdate(5.0) ; Before we can use OnUpdate() we must register.
EndFunction
 
Event OnUpdate() ; This event occurs every five seconds		
If (Mapmarker_OnOff.GetValue() == 1 )
Ore.Enable()
Else 
Ore.Disable()
EndIf
EndEvent

 

I changed some things in the script and it now seems to work :smile:

But I'm going to make like a 500+ of these events so I'm not sure that checking every 5 secs (or even more) is the right thing to do, i only want it to update every time the Global Variable has changed :/

Scriptname Mapmarker extends ObjectReference

ObjectReference Property Ore Auto
GlobalVariable Property Mapmarker_OnOff Auto

Event Onload()
RegisterForUpdate(5)
EndEvent

Event OnUpdate() ; This event occurs every five seconds		
If (Mapmarker_OnOff.GetValue() == 1 )
Debug.MessageBox("Enabled")
Ore.Enable()
Else 
Debug.MessageBox("Disabled")
Ore.Disable()
EndIf
EndEvent



EDIT: Ended up doing the Property Settings directly In the MCM Script ^^ , Solved

Edited by Willy4x4
Link to comment
Share on other sites

  • 7 years later...

 

 

yourmarker.disable() or yourmarker.getreference().disable() might work in your script. to enable, just change disable to enable.

That is the script command i tried but it didn't seem to disable it :sad:

 

Is this the right way to check if the Global Variable has changed?

Scriptname Mapmarker extends ObjectReference

ObjectReference Property Ore Auto
GlobalVariable Property Mapmarker_OnOff Auto

Function SomeFunction()                
	RegisterForUpdate(5.0) ; Before we can use OnUpdate() we must register.
EndFunction
 
Event OnUpdate() ; This event occurs every five seconds		
If (Mapmarker_OnOff.GetValue() == 1 )
Ore.Enable()
Else 
Ore.Disable()
EndIf
EndEvent

 

I changed some things in the script and it now seems to work :smile:

But I'm going to make like a 500+ of these events so I'm not sure that checking every 5 secs (or even more) is the right thing to do, i only want it to update every time the Global Variable has changed :/

Scriptname Mapmarker extends ObjectReference

ObjectReference Property Ore Auto
GlobalVariable Property Mapmarker_OnOff Auto

Event Onload()
RegisterForUpdate(5)
EndEvent

Event OnUpdate() ; This event occurs every five seconds		
If (Mapmarker_OnOff.GetValue() == 1 )
Debug.MessageBox("Enabled")
Ore.Enable()
Else 
Debug.MessageBox("Disabled")
Ore.Disable()
EndIf
EndEvent



EDIT: Ended up doing the Property Settings directly In the MCM Script ^^ , Solved

 

 

Brother, I am looking for the exact same thing right now: I want to disable auto creation of map markers, in order to place them myself. Did you find a way how to do it? Could you please share it?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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