mirror of
https://github.com/mrSkortch/MissionScriptingTools.git
synced 2025-08-15 10:47:23 +00:00
commit
29c93002fa
43
mist.lua
43
mist.lua
@ -8,7 +8,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 3
|
mist.majorVersion = 3
|
||||||
mist.minorVersion = 7
|
mist.minorVersion = 7
|
||||||
mist.build = 50
|
mist.build = 51
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -4003,6 +4003,26 @@ do
|
|||||||
local displayActive = false
|
local displayActive = false
|
||||||
local displayFuncId = 0
|
local displayFuncId = 0
|
||||||
|
|
||||||
|
local caSlots = false
|
||||||
|
|
||||||
|
for index, value in pairs(env.mission.groundControl) do
|
||||||
|
if type(value) == 'table' then
|
||||||
|
for roleName, roleVal in pairs(value) do
|
||||||
|
for rIndex, rVal in pairs(roleVal) do
|
||||||
|
if rIndex == 'red' or rIndex == 'blue' then
|
||||||
|
if env.mission.groundControl[index][roleName][rIndex] > 0 then
|
||||||
|
caSlots = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif type(value) == 'boolean' and value == true then
|
||||||
|
caSlots = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function mistdisplayV4()
|
local function mistdisplayV4()
|
||||||
local activeClients = {}
|
local activeClients = {}
|
||||||
|
|
||||||
@ -4079,12 +4099,13 @@ do
|
|||||||
end
|
end
|
||||||
------- new display
|
------- new display
|
||||||
|
|
||||||
|
if caSlots == true then
|
||||||
if msgTableText['RED'] then
|
if msgTableText['RED'] then
|
||||||
trigger.action.outTextForCoalition(coalition.side.RED, table.concat(msgTableText['RED'].text), msgTableText['RED'].displayTime)
|
trigger.action.outTextForCoalition(coalition.side.RED, table.concat(msgTableText['RED'].text), msgTableText['RED'].displayTime)
|
||||||
end
|
end
|
||||||
if msgTableText['BLUE'] then
|
if msgTableText['BLUE'] then
|
||||||
trigger.action.outTextForCoalition(coalition.side.BLUE, table.concat(msgTableText['BLUE'].text), msgTableText['BLUE'].displayTime)
|
trigger.action.outTextForCoalition(coalition.side.BLUE, table.concat(msgTableText['BLUE'].text), msgTableText['BLUE'].displayTime)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for index, msgData in pairs(msgTableText) do
|
for index, msgData in pairs(msgTableText) do
|
||||||
@ -4176,8 +4197,8 @@ do
|
|||||||
if type(listData) == 'string' then
|
if type(listData) == 'string' then
|
||||||
listData = string.lower(listData)
|
listData = string.lower(listData)
|
||||||
end
|
end
|
||||||
if forIndex == 'coa' and (listData == string.lower(clientData.coalition) or listData == 'all') or forIndex == 'countries' and string.lower(clientData.country) == listData or forIndex == 'units' and string.lower(clientData.unitName) == listData then --
|
if (forIndex == 'coa' and (listData == string.lower(clientData.coalition) or listData == 'all')) or (forIndex == 'countries' and string.lower(clientData.country) == listData) or (forIndex == 'units' and string.lower(clientData.unitName) == listData) then --
|
||||||
newMsgFor = msgSpamFilter(newMsgFor, clientId) -- so units dont get the same message twice if complex rules are given
|
newMsgFor = msgSpamFilter(newMsgFor, clientData.groupId) -- so units dont get the same message twice if complex rules are given
|
||||||
--table.insert(newMsgFor, clientId)
|
--table.insert(newMsgFor, clientId)
|
||||||
elseif forIndex == 'unittypes' then
|
elseif forIndex == 'unittypes' then
|
||||||
for typeId, typeData in pairs(listData) do
|
for typeId, typeData in pairs(listData) do
|
||||||
@ -4187,7 +4208,7 @@ do
|
|||||||
if string.lower(list) == string.lower(clientDataVal) or list == 'all' then
|
if string.lower(list) == string.lower(clientDataVal) or list == 'all' then
|
||||||
if typeData == clientData.type then
|
if typeData == clientData.type then
|
||||||
found = true
|
found = true
|
||||||
newMsgFor = msgSpamFilter(newMsgFor, clientId) -- sends info oto other function to see if client is already recieving the current message.
|
newMsgFor = msgSpamFilter(newMsgFor, clientData.groupId) -- sends info oto other function to see if client is already recieving the current message.
|
||||||
--table.insert(newMsgFor, clientId)
|
--table.insert(newMsgFor, clientId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -4241,7 +4262,7 @@ do
|
|||||||
messageID = messageID + 1
|
messageID = messageID + 1
|
||||||
new.messageID = messageID
|
new.messageID = messageID
|
||||||
|
|
||||||
--mist.debug.writeData(mist.utils.serialize,{'msg', new}, 'newMsg.txt')
|
--mist.debug.writeData(mist.utils.serialize,{'msg', new}, 'newMsg.lua')
|
||||||
|
|
||||||
|
|
||||||
messageList[#messageList + 1] = new
|
messageList[#messageList + 1] = new
|
||||||
|
|||||||
@ -8,7 +8,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 3
|
mist.majorVersion = 3
|
||||||
mist.minorVersion = 7
|
mist.minorVersion = 7
|
||||||
mist.build = 48
|
mist.build = 51
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -3186,7 +3186,7 @@ stopFlag
|
|||||||
|
|
||||||
|
|
||||||
if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == false) then
|
if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == false) then
|
||||||
if Group.getByName(groupName) and Group.getByName(groupName):isExist() == true then
|
if Group.getByName(groupName) and Group.getByName(groupName):isExist() == true and #Group.getByName(groupName):getUnits() > 0 then
|
||||||
if trigger.misc.getUserFlag(flag) == 0 then
|
if trigger.misc.getUserFlag(flag) == 0 then
|
||||||
trigger.action.setUserFlag(flag, true)
|
trigger.action.setUserFlag(flag, true)
|
||||||
end
|
end
|
||||||
@ -3223,7 +3223,7 @@ mist.flagFunc.group_dead = function(vars)
|
|||||||
|
|
||||||
|
|
||||||
if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == false) then
|
if stopflag == -1 or (type(trigger.misc.getUserFlag(stopflag)) == 'number' and trigger.misc.getUserFlag(stopflag) == 0) or (type(trigger.misc.getUserFlag(stopflag)) == 'boolean' and trigger.misc.getUserFlag(stopflag) == false) then
|
||||||
if Group.getByName(groupName) and Group.getByName(groupName):isExist() == false or not Group.getByName(groupName) then
|
if (Group.getByName(groupName) and Group.getByName(groupName):isExist() == false) or (Group.getByName(groupName) and #Group.getByName(groupName):getUnits() < 1) or not Group.getByName(groupName) then
|
||||||
if trigger.misc.getUserFlag(flag) == 0 then
|
if trigger.misc.getUserFlag(flag) == 0 then
|
||||||
trigger.action.setUserFlag(flag, true)
|
trigger.action.setUserFlag(flag, true)
|
||||||
end
|
end
|
||||||
@ -4003,6 +4003,26 @@ do
|
|||||||
local displayActive = false
|
local displayActive = false
|
||||||
local displayFuncId = 0
|
local displayFuncId = 0
|
||||||
|
|
||||||
|
local caSlots = false
|
||||||
|
|
||||||
|
for index, value in pairs(env.mission.groundControl) do
|
||||||
|
if type(value) == 'table' then
|
||||||
|
for roleName, roleVal in pairs(value) do
|
||||||
|
for rIndex, rVal in pairs(roleVal) do
|
||||||
|
if rIndex == 'red' or rIndex == 'blue' then
|
||||||
|
if env.mission.groundControl[index][roleName][rIndex] > 0 then
|
||||||
|
caSlots = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
elseif type(value) == 'boolean' and value == true then
|
||||||
|
caSlots = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function mistdisplayV4()
|
local function mistdisplayV4()
|
||||||
local activeClients = {}
|
local activeClients = {}
|
||||||
|
|
||||||
@ -4079,12 +4099,13 @@ do
|
|||||||
end
|
end
|
||||||
------- new display
|
------- new display
|
||||||
|
|
||||||
|
if caSlots == true then
|
||||||
if msgTableText['RED'] then
|
if msgTableText['RED'] then
|
||||||
trigger.action.outTextForCoalition(coalition.side.RED, table.concat(msgTableText['RED'].text), msgTableText['RED'].displayTime)
|
trigger.action.outTextForCoalition(coalition.side.RED, table.concat(msgTableText['RED'].text), msgTableText['RED'].displayTime)
|
||||||
end
|
end
|
||||||
if msgTableText['BLUE'] then
|
if msgTableText['BLUE'] then
|
||||||
trigger.action.outTextForCoalition(coalition.side.BLUE, table.concat(msgTableText['BLUE'].text), msgTableText['BLUE'].displayTime)
|
trigger.action.outTextForCoalition(coalition.side.BLUE, table.concat(msgTableText['BLUE'].text), msgTableText['BLUE'].displayTime)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for index, msgData in pairs(msgTableText) do
|
for index, msgData in pairs(msgTableText) do
|
||||||
@ -4176,8 +4197,8 @@ do
|
|||||||
if type(listData) == 'string' then
|
if type(listData) == 'string' then
|
||||||
listData = string.lower(listData)
|
listData = string.lower(listData)
|
||||||
end
|
end
|
||||||
if forIndex == 'coa' and (listData == string.lower(clientData.coalition) or listData == 'all') or forIndex == 'countries' and string.lower(clientData.country) == listData or forIndex == 'units' and string.lower(clientData.unitName) == listData then --
|
if (forIndex == 'coa' and (listData == string.lower(clientData.coalition) or listData == 'all')) or (forIndex == 'countries' and string.lower(clientData.country) == listData) or (forIndex == 'units' and string.lower(clientData.unitName) == listData) then --
|
||||||
newMsgFor = msgSpamFilter(newMsgFor, clientId) -- so units dont get the same message twice if complex rules are given
|
newMsgFor = msgSpamFilter(newMsgFor, clientData.groupId) -- so units dont get the same message twice if complex rules are given
|
||||||
--table.insert(newMsgFor, clientId)
|
--table.insert(newMsgFor, clientId)
|
||||||
elseif forIndex == 'unittypes' then
|
elseif forIndex == 'unittypes' then
|
||||||
for typeId, typeData in pairs(listData) do
|
for typeId, typeData in pairs(listData) do
|
||||||
@ -4187,7 +4208,7 @@ do
|
|||||||
if string.lower(list) == string.lower(clientDataVal) or list == 'all' then
|
if string.lower(list) == string.lower(clientDataVal) or list == 'all' then
|
||||||
if typeData == clientData.type then
|
if typeData == clientData.type then
|
||||||
found = true
|
found = true
|
||||||
newMsgFor = msgSpamFilter(newMsgFor, clientId) -- sends info oto other function to see if client is already recieving the current message.
|
newMsgFor = msgSpamFilter(newMsgFor, clientData.groupId) -- sends info oto other function to see if client is already recieving the current message.
|
||||||
--table.insert(newMsgFor, clientId)
|
--table.insert(newMsgFor, clientId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -4241,7 +4262,7 @@ do
|
|||||||
messageID = messageID + 1
|
messageID = messageID + 1
|
||||||
new.messageID = messageID
|
new.messageID = messageID
|
||||||
|
|
||||||
--mist.debug.writeData(mist.utils.serialize,{'msg', new}, 'newMsg.txt')
|
--mist.debug.writeData(mist.utils.serialize,{'msg', new}, 'newMsg.lua')
|
||||||
|
|
||||||
|
|
||||||
messageList[#messageList + 1] = new
|
messageList[#messageList + 1] = new
|
||||||
@ -1,3 +1,10 @@
|
|||||||
|
v51
|
||||||
|
-Fixed bug with message system
|
||||||
|
-Added a check to the message system so combined arms messages wont be sent if CA slots are not in a mission.
|
||||||
|
|
||||||
|
v50
|
||||||
|
-something got deleted from v49 so this fixed it.
|
||||||
|
|
||||||
v49
|
v49
|
||||||
-fixed flagFuncs.group_dead and group_alive issue caused via a DCS bug.
|
-fixed flagFuncs.group_dead and group_alive issue caused via a DCS bug.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user