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?


TEMPEST.114

Recommended Posts

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?

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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. 

 

Link to comment
Share on other sites

Correct, it will hide all.

Take a look at MIST functions:

To add

https://wiki.hoggitworld.com/view/MIST_markerDrawShape

Try to remove it with this one:

https://wiki.hoggitworld.com/view/MIST_markerRemove

From documentation: "Returns a boolean if the passed mark(s) were removed. Can be used to remove a single mark or a group of marks"

I haven't tested yet, but i think is worth to try...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 10 months later...

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 ?

 

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

  • 4 weeks later...

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.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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