Jump to content

mist.msgMGRS Repeats for the Display Time


Wrecking Crew

Recommended Posts

I am using the mist.msgMGRS in a Switched Condition event that is triggered by an F10 Radio command.  The displayed text repeats for the duration of the DisplayTime, but I want it to only run once.  I am in the mission as a Blue Game Master.  I did wrap the mist.msgMGRS in a Do .. End and also in a While loop to try to limit the text out to just once.  

 

I am loading Mist 4.1.61.

 

Here is the current Do Script -

idx = 0
while (idx < 1) do
 mist.msgMGRS{
  units = {'BLF Killbox 10 NW'},
  acc = 5,
  displayTime = 2,
  msgFor = {coa = {'all'}},
  text = "BLF Killbox 10 NW coordinates: ",
 }
idx = idx + 1
end

 

Screen_210822_180338.png

How can I get the mist.msgMGRS text out to show just once for the DisplayTime duration?  The mission is attached.

 

Boxcutter 274S0a.miz

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

Looks like trigger.action.outTextForCoalition isn't working correctly. The "clearview" setting is ignored, which is what mist uses to overwrite previous messages. 

 

That whole section of code in mist was made before messages in DCS could stack like that, so it works a bit like a monitor where it has a refresh rate and combines messages as they get added so nothing is erased. Also a royal PITA that you can't send messages that only CA players can see. If you jump into a group slot it should be ok. Fixing it for CA would take some work but is doable. 

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

Thank you Grimes

 

The Mist approach gave the MGRS coords spot on.  I will try it from an a/c client slot.  

 

We tried ..

DCS functions LOtoLL and LOtoMGRS functions

and got coordinates in the YE box instead of BV

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

2 hours ago, Wrecking Crew said:

We tried ..

DCS functions LOtoLL and LOtoMGRS functions

and got coordinates in the YE box instead of BV

 

Donno if that is a typo because you have to convert LO to LL and then LL to MGRS. There is no direct LO to MGRS. In fact this is what the code looks like when mist does it: 

 

mist.tostringMGRS(coord.LLtoMGRS(coord.LOtoLL(avgPos)), acc)

 

Probably something that could be a bit clearer on the wiki, but you are kinda going about it backwards. You are averaging the position of a group with 4 units making up a grid square the target is in. You could just pass different values for the acc entry with the target coords to get the same result. Its documented in the tostringMGRS page but none of the other MGRS related pages. 

 

  mist.tostringMGRS(table, 0) returns 38T AB 
  mist.tostringMGRS(table, 3) returns 38T AB 123 123 
  mist.tostringMGRS(table, 5) returns 38T AB 12345 12345

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

  • 2 months later...

Hi Grimes,

I have been away from this mission development, and just getting back to it.  Happily I am seeing that the mist.msgMGRS is no longer repeating from a CA slot.  Thank you and everyone else who helped for fixing this.

I actually do want the individual coordinates of the corner units.  In this mission the clients must search the box to find the target, and the box/target location will be randomized.

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

I am trying to run adapted script to also display LL coords.  

The code below is adapted from the https://wiki.hoggitworld.com/view/MIST_tostringMGRS in the Usage Examples section -

do
 local mgrs = coord.LLtoMGRS(coord.LOtoLL(Unit.getByName('BLF Killbox 10 NW'):getPosition.p))
 trigger.action.outText("BLF Killbox 10 NW coordinates: " .. mist.tostringMGRS(mgrs, 4)", 60)
end

I get an error box -

Untitled.png

I did play around with the quotes (") in the outText line - looks like there is an extra one?  

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

The MGRS coordinates are displaying correctly.  Now I am trying to display the LL coordinates.  I thought I could change/strip off the mist.tostringMGRS & coord.LLtoMGRS.  I have tried various things such as:

do
 local coordsLL = (coord.LOtoLL(Unit.getByName('BLF Killbox 1 NW'):getPoint()))
 trigger.action.outText("Killbox NW coordinates: " .. mist.tostringLL(coordsLL, 4), 60)
end

..but I only get errors.  I also tried mist.getLLString. 

How can I display the LL coordinates of unit 'BLF Killbox 1 NW'?

 

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

42 minutes ago, Wrecking Crew said:

...How can I display the LL coordinates of unit 'BLF Killbox 1 NW'?

 

coord.LotoLL() has 2 parts, so :

do
local lat, lon = coord.LOtoLL(Unit.getByName('BLF Killbox 1 NW'):getPoint())
local coordsLL = mist.tostringLL(lat, lon, 4)
trigger.action.outText('Killbox NW coordinates: ' .. coordsLL, 60)
end

 

Link to comment
Share on other sites

On 10/31/2021 at 4:22 PM, toutenglisse said:

coord.LotoLL() has 2 parts, so

That works great.  

Thanks again!

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

  • 4 weeks later...

I appreciate all the assistance with the code.  This new Boxcutter Aleppo mission is ready and attached to enjoy.  Currently it has A-10s, F-16s and F-14s.  Feel free to add more a/c.  

-------------------------------

Boxcutter Aleppo
Ground attack.  This mission requires map coordinates input to the aircraft computer.  Mission times out after eight hours.  Radio F10 Menu has mission options.  

---
Summary
Blue Liberation Forces are defending Aleppo from the Red Democratic Republic scud missile attacks.  

Red to win:
Destroy all of the Blue at Aleppo Airbase

Blue to win:
Destroy the Red Scud and armor in the designated killbox

---
Designer Notes

Mission action is initiated when ... 
... a Client takes off; or use F10 Radio Menu.  The mission times out eight hours after action is initiated.  Use the Radio F10 Menu to restart the mission.  

The killbox coordinates are generated at mission startup.  The killbox is within ~25 miles of Aleppo Airbase.
Up to three killboxes can be attacked in this mission.  After a killbox win, a new killbox objective may be selected using the Radio F10 Menu.  Note that Red could win the mission before Blue completes the next objective.

Boxcutter Aleppo 278S1a.miz

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

  • 1 year later...
On 11/24/2021 at 5:32 PM, Wrecking Crew said:

I appreciate all the assistance with the code.  This new Boxcutter Aleppo mission is ready and attached to enjoy.  Currently it has A-10s, F-16s and F-14s.  Feel free to add more a/c.  

-------------------------------

Boxcutter Aleppo
Ground attack.  This mission requires map coordinates input to the aircraft computer.  Mission times out after eight hours.  Radio F10 Menu has mission options.  

---
Summary
Blue Liberation Forces are defending Aleppo from the Red Democratic Republic scud missile attacks.  

Red to win:
Destroy all of the Blue at Aleppo Airbase

Blue to win:
Destroy the Red Scud and armor in the designated killbox

---
Designer Notes

Mission action is initiated when ... 
... a Client takes off; or use F10 Radio Menu.  The mission times out eight hours after action is initiated.  Use the Radio F10 Menu to restart the mission.  

The killbox coordinates are generated at mission startup.  The killbox is within ~25 miles of Aleppo Airbase.
Up to three killboxes can be attacked in this mission.  After a killbox win, a new killbox objective may be selected using the Radio F10 Menu.  Note that Red could win the mission before Blue completes the next objective.

Boxcutter Aleppo 278S1a.mizUnavailable

Hey! Seems to be a very exciting mission. Is there a way you got check the miz. Its unavailable and cannot download. Thanks.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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