Jump to content

Is there a way to toggle ON/OFF the drawings that would appear on the F10 map, at specific times via TRIGGER/ACTIONS or even via scripting?


Recommended Posts

Posted

i.e. I have red circles drawn over the map as 'hints' of where bandits might be lurking.

I don't want them visible at the start, but when the player (via F10 Radio Menu) asks for a hint, I want to randomly show one of these circles for 60secs then turn it off again. 

I'm sure I can get them from env.mission and maybe toggle them via scripting, but is there a way to do this in the ME?

Posted (edited)

There is MARK TO ALL/GROUP/COALITION and REMOVE MARK that can be used in the ME. This would take playing with the triggers, one to draw it when radio command/flag is used, one to wait for a period of time + set a flag, and one to remove the mark when the time is reached/flag is set.

If you are interested in doing this in LUA, then you could use trigger.action.markToAll/Group/Coalition and removeMark after a timeout period. You could also use setMarkupColor with RGBA (desired color) then 0,0,0,0 (for transparent alpha) to toggle the visibility of the mark.

Edited by Chump
Added LUA alternative
Posted

Unfortunately the drawings in the mission editor are completely separate than what you can do via scripting. The best triggers can do is toggle on/off the different layers. If you wanted more flexibility you can use scripting at the downside of less options for stuff like text and line types. If you want to you can easily use trigger zones, drawings, or even group routes as a basis for what gets drawn via scripting. 

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted
4 hours ago, Grimes said:

Unfortunately the drawings in the mission editor are completely separate than what you can do via scripting. The best triggers can do is toggle on/off the different layers. If you wanted more flexibility you can use scripting at the downside of less options for stuff like text and line types. If you want to you can easily use trigger zones, drawings, or even group routes as a basis for what gets drawn via scripting. 

So each of the draw shapes (circles or ovals) have been given a name 'HotZone1' or 'HotZone2' etc, and they are all on the common layer. 

Because they have a 'name' they should be addressable somehow right? 

I have them set to hidden (not hidden on F10) but just individually toggled hidden. 

So there is no way to toggle that hidden 'on' for a named graphic on the common layer? If not, then whats the point of giving each one a unique name?

7 hours ago, Chump said:

There is MARK TO ALL/GROUP/COALITION and REMOVE MARK that can be used in the ME. This would take playing with the triggers, one to draw it when radio command/flag is used, one to wait for a period of time + set a flag, and one to remove the mark when the time is reached/flag is set.

If you are interested in doing this in LUA, then you could use trigger.action.markToAll/Group/Coalition and removeMark after a timeout period. You could also use setMarkupColor with RGBA (desired color) then 0,0,0,0 (for transparent alpha) to toggle the visibility of the mark.

 

Yeah, those are tiny orange thin things - I've defaulted to using them, but they're crappy for visibility on the map. So I made large, thick rings using the DRAW tool. Those were the ones I was hoping to toggle on and off - either in the ME or if i had to via scripting. 

Posted
6 minutes ago, dark_wood said:

Hey @dark_wood

Thanks so much for that. That's great to know. 

However, it seems that it toggles everything on or off. There doesn't seem to be a way to address each arrow individually. Is that correct? 

Is that possible somehow in scripting? 

rings.jpg

Each ring has it's own name e.g.'HotZone1' etc.

And depending on what's going on in the mission one of these needs to be show - not all of them at once. 

 

Posted

If you are using trigger zones it is quite simple: 

local ref = trigger.misc.getZone("targetArea")
trigger.action.circleToAll(-1 , 1, ref.point , ref.radius , {0, 0, 0, 0} , {1, 0, 0, .7} , 0 , true)

Anything drawn in the editor is a little annoying because you have to iterate env.mission.drawings and the formats aren't easily plug and play with scripts. 

  • Like 1

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • 10 months later...
Posted

Hi I have a question :

When you use this command to display a drawing :

mist.marker.drawShape('ellipse')

Wich command to use to hide this drawing ?

mist.marker.remove({elipse}) or mist.marker.remove(elipse) or mist.marker.remove('elipse')

These commands does not work

Any idea please ?

 

Posted
1 hour ago, Flasher said:

Wich command to use to hide this drawing ?

I have next to no knowledge of Mist, but it if works anything like the underlying methods in DCS, you'd pass the result of what you get from creating a drawing into the destructor.

In other words, you need to preserve the result from mist.marker.drawShape and pass that to mist.marker.remove:

theShape = mist.marker.drawShape(...) -- save new shape ident into 'theShape' for later removal

...

-- remove the marker shape 
mist.marker.remove(theShape)

 

  • 4 weeks later...
Posted

OK I have an otter question, how to change a shape color ?

Mission1= mist.marker.drawShape('line')

First to get my drawing

setMarkupColor('Mission1' , {0, 1, 0, 1})
end

This line return an error, I can"t find the error....

If someone can help, thanks in advance.

  • Recently Browsing   0 members

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