Jump to content

Shuffmayn

Members
  • Posts

    4
  • Joined

  • Last visited

1 Follower

About Shuffmayn

  • Birthday 11/07/1984

Personal Information

  • Flight Simulators
    DCS,
    MSFS2020,
  • Location
    Denmark
  • Interests
    Sims

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Shouldn't the above be: local ratio = gp:getSize()/gp:getInitialSize() if ratio < 0.2 then mist.respawnGroup(gName, true) end or am I completely (and this is very likely the case) completely off kilter in my understanding of how lua works?
  2. I found that out I'll be going to the hoggit wiki from now on for references, thank you! That's what I want to do though. Convoy 1 is also a group I want to respawn when below the threshold. It probably isn't, but I spent a lot of time getting to this point with my code and until I feel more confident coding my own stuff in lua I'll continue relying on your work Before getting back into lua a week ago, I haven't looked at a code in years (used to code Arma and Operation Flashpoint) so I'm sloooowly getting back into the swing of things.
  3. Hi all! I'm rather new to DCS scripting and MIST, but I've been trying to create a script for a little mission I want to run with some friends. I'm trying to post a message in-game when we've destroyed ~80% of each individual SAM-site and then respawn it, but instead of writing a statement for each individual unit I figured I would simply create a table with all the units I want to be able to respawn, and then put a reference to the table in the mist.flagFunc.group_alive_less_than function. I can't get it to work. I feel like I've tried everything I can imagine to get it to work, but I'm at my wits end. Could someone please look over my code and see if they can figure out where I went wrong? spawnGroups = {} -- table containing units for respawning (and other things) spawnGroups[1] = "Halo 1" spawnGroups[2] = "RED AWACS" spawnGroups[3] = "HOS SU-27" spawnGroups[4] = "SAM NORTH" spawnGroups[5] = "SAM SOUTH" spawnGroups[6] = "CONVOY 1" spawnGroups[7] = "Train 1" local groupNames = {} -- Initialize groupNames table -- Populate groupNames with values from spawnGroups[4], spawnGroups[5], and spawnGroups[6] for a = 4, 6 do local groupName = tostring(spawnGroups[a]) if groupName and mist.DBs.groupsByName[groupName] then groupNames[#groupNames + 1] = groupName else -- Handle the case where the group name is not valid local errorMessage = "Invalid group name or group not found: " .. tostring(groupName) print(errorMessage) env.info(errorMessage) trigger.action.outText(errorMessage, 5) -- Display the error message in-game for visibility end end -- Use the populated groupNames table in mist.flagFunc.group_alive_less_than mist.flagFunc.group_alive_less_than { units = table.concat(groupNames, ","), -- Combine groupNames with commas flag = 100, percent = 20, toggle = true, interval = 60, } Thank you in advance for any and all help on this *edit I just went back to the PDF documentation, and noticed that the description states: mist.flagFunc.group_alive_less_than mist.flagFunc.group_alive_less_than (table vars) vars has the following recognized fields (required entries in blue, optional in green): { groupName = string groupName, flag = number/string flag, percent = number percent, stopflag = number/string stopflag, interval = number interval, toggle = boolean toggle, } but the example reads: mist.flagFunc.group_alive_less_than { units = 'myGroup, flag = 100, percent = 20, toggle = true, } so should I use 'groupName' or 'units' for the variable?
×
×
  • Create New...