xcom Posted March 10, 2014 Posted March 10, 2014 Hi, I've done a very small script that uses mist.flagFunc.units_in_zones. I'm trying to use [red][vehicle] and [blue][vehicle] to get a list of all the blue vehicles and red vehicles into the units array. here is the script - --Script for checking objectivezones local ZoneName = {'Objective1','Objective2','Objective3','Objective4','Objective5','Objective6','Objective7','Objective8','Objective9','Objective10','Objective11','Objective12'} local CoaName = {'red','blue'} for id, data in ipairs(CoaName) do for id, data in pairs(ZoneName) do if CoaName == 'red' then mist.flagFunc.units_in_zones{ units = {'[red][vehicle]'}, zones = {ZoneName}, flag = 100 + id, req_num = 3, toggle = true, } else mist.flagFunc.units_in_zones{ units = {'[blue][vehicle]'}, zones = {ZoneName}, flag = 200 + id, req_num = 3, toggle = true, } end end end I've installed SLMod 7 cuz I understand that the [blue] and [vehicles] might be in the SLMod scripting and not in MIST, is that correct? When I run it as described above I get the following unknown error - Mission script error error in error handling. Thanks for any help! [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
mwd2 Posted March 11, 2014 Posted March 11, 2014 [blue] and [vehicles] are in MiST (from the manual): UnitNameTables Many Mist functions require tables of unit names, which are known in Mist as UnitNameTables. These follow a special set of shortcuts borrowed from Slmod. These shortcuts alleviate the problem of entering huge lists of unit names by hand, and in many cases, they remove the need to even know the names of the units in the first place! These are the unit table “short-cut” commands (there will be examples of how to use them in a moment): Character sequence + name commands: "[-u]<unit name>" - subtract this unit from the table "[g]<group name>" - add this group’s units to the table "[-g]<group name>" - subtract this group’s units from the table "[c]<country name>" - add this country's units to the table "[-c]<country name>" - subtract this country's units from the table Stand-alone identifiers "[all]" – add all units to the table "[-all]" – remove all units from the table "[blue]" - add all blue coalition units to the table 8 "[-blue]" - subtract all blue coalition units from the table "[red]" - add all red coalition units to the table "[-red]" - subtract all red coalition units from the table Compound identifiers: "[c][helicopter]<country name>" - add all of this country's helicopters to the table "[-c][helicopter]<country name>" - subtract all of this country's helicopters from the table "[c][plane]<country name>" - add all of this country's planes to the table "[-c][plane]<country name>" - subtract all of this country's planes from the table "[c][ship]<country name>" - add all of this country's ships to the table "[-c][ship]<country name>" - subtract all of this country's ships from the table "[c][vehicle]<country name>" - add all of this country's vehicles to the table "[-c][vehicle]<country name>" - subtract all of this country's vehicles from the table "[all][helicopter]" - add all helicopters to the table "[-all][helicopter]" - subtract all helicopters from the table "[all][plane]" - add all planes to the table "[-all][plane]" - subtract all planes from the table "[all][ship]" - add all ships to the table "[-all][ship]" - subtract all ships from the table "[all][vehicle]" - add all vehicles to the table "[-all][vehicle]" - subtract all vehicles from the table "[blue][helicopter]" - add all blue coalition helicopters to the table "[-blue][helicopter]" - subtract all blue coalition helicopters from the table "[blue][plane]" - add all blue coalition planes to the table "[-blue][plane]" - subtract all blue coalition planes from the table "[blue][ship]" - add all blue coalition ships to the table "[-blue][ship]" - subtract all blue coalition ships from the table "[blue][vehicle]" - add all blue coalition vehicles to the table "[-blue][vehicle]" - subtract all blue coalition vehicles from the table "[red][helicopter]" - add all red coalition helicopters to the table "[-red][helicopter]" - subtract all red coalition helicopters from the table "[red][plane]" - add all red coalition planes to the table "[-red][plane]" - subtract all red coalition planes from the table "[red][ship]" - add all red coalition ships to the table "[-red][ship]" - subtract all red coalition ships from the table "[red][vehicle]" - add all red coalition vehicles to the table "[-red][vehicle]" - subtract all red coalition vehicles from the table Playing: DCS World Intel i7-13700KF, 64GB DDR5 @5600MHz, RTX 4080 ZOTAC Trinity, WIN 11 64Bit Prof. Squadron "Serious Uglies" / Discord-Server: https://discord.gg/2WccwBh Ghost0815
xcom Posted March 11, 2014 Author Posted March 11, 2014 I know but it also says in the mist manual that it was borrowed from SLMod I was wondering first if that means we don't need slmod installed. In anyhow the script I put in returns an error for some reason. [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
mwd2 Posted March 11, 2014 Posted March 11, 2014 you don`t need SLMOD to use the UnitNameTables! could it be the brackets around {ZoneName}?! Playing: DCS World Intel i7-13700KF, 64GB DDR5 @5600MHz, RTX 4080 ZOTAC Trinity, WIN 11 64Bit Prof. Squadron "Serious Uglies" / Discord-Server: https://discord.gg/2WccwBh Ghost0815
xcom Posted March 11, 2014 Author Posted March 11, 2014 I don't know, I was hoping someone would check the code and say, I can't find anything wrong. [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
mwd2 Posted March 11, 2014 Posted March 11, 2014 mist.flagFunc.units_in_zones{ units = {'[blue][vehicle]'}, [b][color="Red"]zones[/color][/b] = {ZoneName}, flag = 200 + id, req_num = 3, toggle = true, } at the moment you have a table in a table with the zones --> zones = ZoneName, Playing: DCS World Intel i7-13700KF, 64GB DDR5 @5600MHz, RTX 4080 ZOTAC Trinity, WIN 11 64Bit Prof. Squadron "Serious Uglies" / Discord-Server: https://discord.gg/2WccwBh Ghost0815
xcom Posted March 11, 2014 Author Posted March 11, 2014 gotcha, changed the code - --Script for checking objectivezones local ZoneName = {'Objective1','Objective2','Objective3','Objective4','Objective5','Objective6','Objective7','Objective8','Objective9','Objective10','Objective11','Objective12'} local CoaName = {'red','blue'} for id, data in ipairs(CoaName) do for id, data in pairs(ZoneName) do if CoaName == 'red' then mist.flagFunc.units_in_zones{ units = {'[red][vehicle]'}, zones = {ZoneName[id]}, flag = 100 + id, req_num = 3, toggle = true, } else mist.flagFunc.units_in_zones{ units = {'[blue][vehicle]'}, zones = {ZoneName[id]}, flag = 200 + id, req_num = 3, toggle = true, } end end end I'll check if that works, thanks :) [sIGPIC][/sIGPIC] BuddySpike Website | Live Map & Statistics BuddySpike Twitch Channel Buddyspike Discord Buddyspike Facebook
Recommended Posts