TEMPEST.114 Posted February 20, 2023 Posted February 20, 2023 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?
Chump Posted February 20, 2023 Posted February 20, 2023 (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 February 20, 2023 by Chump Added LUA alternative
dark_wood Posted February 20, 2023 Posted February 20, 2023 I think is an action, something like User Draw Show/Hide
Grimes Posted February 20, 2023 Posted February 20, 2023 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 Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
TEMPEST.114 Posted February 20, 2023 Author Posted February 20, 2023 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.
dark_wood Posted February 20, 2023 Posted February 20, 2023 Hi @Elphaba, see attached example. show_hide_draws.miz 1
TEMPEST.114 Posted February 20, 2023 Author Posted February 20, 2023 6 minutes ago, dark_wood said: Hi @Elphaba, see attached example. show_hide_draws.miz 11.34 kB · 2 downloads 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? 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.
dark_wood Posted February 20, 2023 Posted February 20, 2023 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...
TEMPEST.114 Posted February 20, 2023 Author Posted February 20, 2023 Darn, I don't use MIST or MOOSE... But I can take a look at their code I suppose. Thanks for your help again @dark_wood 1
Grimes Posted February 21, 2023 Posted February 21, 2023 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. 1 The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Flasher Posted December 24, 2023 Posted December 24, 2023 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 ?
cfrag Posted December 24, 2023 Posted December 24, 2023 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)
Flasher Posted January 18, 2024 Posted January 18, 2024 Why this method, seems to work only for drawing like "elipse" but not with "line" ?
Flasher Posted January 21, 2024 Posted January 21, 2024 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.
Recommended Posts