mirror of
https://github.com/mrSkortch/MissionScriptingTools.git
synced 2025-08-15 10:47:23 +00:00
v43
Minor fixes to getPayload, dynAdd, and dynAddStatic
This commit is contained in:
parent
e18778bc7d
commit
8dc51dbc83
10
mist.lua
10
mist.lua
@ -8,7 +8,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 3
|
mist.majorVersion = 3
|
||||||
mist.minorVersion = 6
|
mist.minorVersion = 6
|
||||||
mist.build = 42
|
mist.build = 43
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -530,7 +530,7 @@ do
|
|||||||
if newObj.x and newObj.y and newObj.type and type(newObj.x) == 'number' and type(newObj.y) == 'number' and type(newObj.type) == 'string' then
|
if newObj.x and newObj.y and newObj.type and type(newObj.x) == 'number' and type(newObj.y) == 'number' and type(newObj.type) == 'string' then
|
||||||
coalition.addStaticObject(country.id[newCountry], newObj)
|
coalition.addStaticObject(country.id[newCountry], newObj)
|
||||||
|
|
||||||
return newObj.name
|
return newObj
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -696,7 +696,7 @@ do
|
|||||||
|
|
||||||
coalition.addGroup(country.id[newCountry], Unit.Category[newCat], newGroup)
|
coalition.addGroup(country.id[newCountry], Unit.Category[newCat], newGroup)
|
||||||
|
|
||||||
return newGroup.name
|
return newGroup
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -5035,7 +5035,7 @@ mist.getPayload = function(unitIdent)
|
|||||||
-- refactor to search by groupId and allow groupId and groupName as inputs
|
-- refactor to search by groupId and allow groupId and groupName as inputs
|
||||||
local unitId = unitIdent
|
local unitId = unitIdent
|
||||||
if type(unitIdent) == 'string' and not tonumber(unitIdent) then
|
if type(unitIdent) == 'string' and not tonumber(unitIdent) then
|
||||||
unitId = mist.DBs.MEunitsById[unitIdent].unitId
|
unitId = mist.DBs.MEunitsByName[unitIdent].unitId
|
||||||
end
|
end
|
||||||
local gpId = mist.DBs.MEunitsById[unitId].groupId
|
local gpId = mist.DBs.MEunitsById[unitId].groupId
|
||||||
|
|
||||||
@ -5048,7 +5048,7 @@ mist.getPayload = function(unitIdent)
|
|||||||
if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" then -- only these types have points
|
if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" then -- only these types have points
|
||||||
if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group!
|
if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group!
|
||||||
for group_num, group_data in pairs(obj_type_data.group) do
|
for group_num, group_data in pairs(obj_type_data.group) do
|
||||||
if group_data and group_data.groupId == groupId then
|
if group_data and group_data.groupId == gpId then
|
||||||
for unitIndex, unitData in pairs(group_data.units) do --group index
|
for unitIndex, unitData in pairs(group_data.units) do --group index
|
||||||
if unitData.unitId == unitId then
|
if unitData.unitId == unitId then
|
||||||
return unitData.payload
|
return unitData.payload
|
||||||
|
|||||||
@ -8,7 +8,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 3
|
mist.majorVersion = 3
|
||||||
mist.minorVersion = 6
|
mist.minorVersion = 6
|
||||||
mist.build = 42
|
mist.build = 43
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -530,7 +530,7 @@ do
|
|||||||
if newObj.x and newObj.y and newObj.type and type(newObj.x) == 'number' and type(newObj.y) == 'number' and type(newObj.type) == 'string' then
|
if newObj.x and newObj.y and newObj.type and type(newObj.x) == 'number' and type(newObj.y) == 'number' and type(newObj.type) == 'string' then
|
||||||
coalition.addStaticObject(country.id[newCountry], newObj)
|
coalition.addStaticObject(country.id[newCountry], newObj)
|
||||||
|
|
||||||
return newObj.name
|
return newObj
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -696,7 +696,7 @@ do
|
|||||||
|
|
||||||
coalition.addGroup(country.id[newCountry], Unit.Category[newCat], newGroup)
|
coalition.addGroup(country.id[newCountry], Unit.Category[newCat], newGroup)
|
||||||
|
|
||||||
return newGroup.name
|
return newGroup
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -5035,7 +5035,7 @@ mist.getPayload = function(unitIdent)
|
|||||||
-- refactor to search by groupId and allow groupId and groupName as inputs
|
-- refactor to search by groupId and allow groupId and groupName as inputs
|
||||||
local unitId = unitIdent
|
local unitId = unitIdent
|
||||||
if type(unitIdent) == 'string' and not tonumber(unitIdent) then
|
if type(unitIdent) == 'string' and not tonumber(unitIdent) then
|
||||||
unitId = mist.DBs.MEunitsById[unitIdent].unitId
|
unitId = mist.DBs.MEunitsByName[unitIdent].unitId
|
||||||
end
|
end
|
||||||
local gpId = mist.DBs.MEunitsById[unitId].groupId
|
local gpId = mist.DBs.MEunitsById[unitId].groupId
|
||||||
|
|
||||||
@ -5048,7 +5048,7 @@ mist.getPayload = function(unitIdent)
|
|||||||
if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" then -- only these types have points
|
if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" then -- only these types have points
|
||||||
if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group!
|
if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group!
|
||||||
for group_num, group_data in pairs(obj_type_data.group) do
|
for group_num, group_data in pairs(obj_type_data.group) do
|
||||||
if group_data and group_data.groupId == groupId then
|
if group_data and group_data.groupId == gpId then
|
||||||
for unitIndex, unitData in pairs(group_data.units) do --group index
|
for unitIndex, unitData in pairs(group_data.units) do --group index
|
||||||
if unitData.unitId == unitId then
|
if unitData.unitId == unitId then
|
||||||
return unitData.payload
|
return unitData.payload
|
||||||
@ -1,4 +1,8 @@
|
|||||||
-- changelog
|
-- changelog
|
||||||
|
v43
|
||||||
|
-fixed issue with getPayload
|
||||||
|
-dynAdd and dynAddStatic now return the full new table and not just its name. The name value is still accessible via returned table.name
|
||||||
|
|
||||||
v42 v3.6 release
|
v42 v3.6 release
|
||||||
-added mist.getRandomPointInZone. Function uses mist.getRandomPointInCircle.
|
-added mist.getRandomPointInZone. Function uses mist.getRandomPointInCircle.
|
||||||
-fixed bug with altitude switching to radio if baro was specified
|
-fixed bug with altitude switching to radio if baro was specified
|
||||||
@ -12,6 +16,8 @@ getGroupPayload
|
|||||||
getGroupPoints
|
getGroupPoints
|
||||||
getGroupRoute
|
getGroupRoute
|
||||||
|
|
||||||
|
--re added the mist named file
|
||||||
|
|
||||||
v38
|
v38
|
||||||
- fixed bug with optional variables for coordinate messages not actually being optional
|
- fixed bug with optional variables for coordinate messages not actually being optional
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user