mirror of
https://github.com/mrSkortch/MissionScriptingTools.git
synced 2025-08-15 10:47:23 +00:00
v44
fixed a few boneheaded bugs
This commit is contained in:
parent
8dc51dbc83
commit
941ff9708c
16
mist.lua
16
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 = 43
|
mist.build = 44
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -791,6 +791,7 @@ do
|
|||||||
self.f(event)
|
self.f(event)
|
||||||
end
|
end
|
||||||
world.addEventHandler(handler)
|
world.addEventHandler(handler)
|
||||||
|
return handler.id
|
||||||
end
|
end
|
||||||
|
|
||||||
mist.removeEventHandler = function(id)
|
mist.removeEventHandler = function(id)
|
||||||
@ -4021,9 +4022,12 @@ do
|
|||||||
new.addedAt = timer.getTime()
|
new.addedAt = timer.getTime()
|
||||||
|
|
||||||
|
|
||||||
if vars.sound then -- has no function yet, basic idea is to play the sound file for designated players. Had considered a more complex system similar to On Station audio messaging with staggering mesages, but that isn't entirely needed.
|
if vars.sound or vars.fileName then -- has no function yet, basic idea is to play the sound file for designated players. Had considered a more complex system similar to On Station audio messaging with staggering mesages, but that isn't entirely needed.
|
||||||
-- additionally we could have an "outSound" function that will do just the audio alone with no text
|
-- additionally we could have an "outSound" function that will do just the audio alone with no text
|
||||||
new.sound = vars.sound
|
new.sound = vars.sound
|
||||||
|
if vars.fileName then
|
||||||
|
new.sound = vars.fileName
|
||||||
|
end
|
||||||
new.playAudio = true
|
new.playAudio = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -5039,7 +5043,7 @@ mist.getPayload = function(unitIdent)
|
|||||||
end
|
end
|
||||||
local gpId = mist.DBs.MEunitsById[unitId].groupId
|
local gpId = mist.DBs.MEunitsById[unitId].groupId
|
||||||
|
|
||||||
if unitName and type(unitName) == 'string' then
|
if gpId and unitId then
|
||||||
for coa_name, coa_data in pairs(env.mission.coalition) do
|
for coa_name, coa_data in pairs(env.mission.coalition) do
|
||||||
if (coa_name == 'red' or coa_name == 'blue') and type(coa_data) == 'table' then
|
if (coa_name == 'red' or coa_name == 'blue') and type(coa_data) == 'table' then
|
||||||
if coa_data.country then --there is a country table
|
if coa_data.country then --there is a country table
|
||||||
@ -5064,7 +5068,7 @@ mist.getPayload = function(unitIdent)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
env.info('mist.getPayload got ' .. type(unitName))
|
env.info('mist.getPayload got ' .. type(unitIdent))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
env.info('mist.getPayload, payload not found')
|
env.info('mist.getPayload, payload not found')
|
||||||
@ -5205,10 +5209,10 @@ mist.teleportToPoint = function(vars) -- main teleport function that all of tele
|
|||||||
end
|
end
|
||||||
if point then
|
if point then
|
||||||
if (newGroupData.category == 'plane' or newGroupData.category == 'helicopter') and point.z then
|
if (newGroupData.category == 'plane' or newGroupData.category == 'helicopter') and point.z then
|
||||||
if point.y > 0 and point.y > terrain.getHeight({newGroupData.units[unitNum]["x"], newGroupData.units[unitNum]["y"]}) + 10 then
|
if point.y > 0 and point.y > land.getHeight({newGroupData.units[unitNum]["x"], newGroupData.units[unitNum]["y"]}) + 10 then
|
||||||
newGroupData.units[unitNum]["alt"] = point.y
|
newGroupData.units[unitNum]["alt"] = point.y
|
||||||
else
|
else
|
||||||
newGroupData.units[unitNum]["alt"] = terrain.getHeight({newGroupData.units[unitNum]["x"], newGroupData.units[unitNum]["y"]}) + 300
|
newGroupData.units[unitNum]["alt"] = land.getHeight({newGroupData.units[unitNum]["x"], newGroupData.units[unitNum]["y"]}) + 300
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -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 = 43
|
mist.build = 44
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -791,6 +791,7 @@ do
|
|||||||
self.f(event)
|
self.f(event)
|
||||||
end
|
end
|
||||||
world.addEventHandler(handler)
|
world.addEventHandler(handler)
|
||||||
|
return handler.id
|
||||||
end
|
end
|
||||||
|
|
||||||
mist.removeEventHandler = function(id)
|
mist.removeEventHandler = function(id)
|
||||||
@ -4021,9 +4022,12 @@ do
|
|||||||
new.addedAt = timer.getTime()
|
new.addedAt = timer.getTime()
|
||||||
|
|
||||||
|
|
||||||
if vars.sound then -- has no function yet, basic idea is to play the sound file for designated players. Had considered a more complex system similar to On Station audio messaging with staggering mesages, but that isn't entirely needed.
|
if vars.sound or vars.fileName then -- has no function yet, basic idea is to play the sound file for designated players. Had considered a more complex system similar to On Station audio messaging with staggering mesages, but that isn't entirely needed.
|
||||||
-- additionally we could have an "outSound" function that will do just the audio alone with no text
|
-- additionally we could have an "outSound" function that will do just the audio alone with no text
|
||||||
new.sound = vars.sound
|
new.sound = vars.sound
|
||||||
|
if vars.fileName then
|
||||||
|
new.sound = vars.fileName
|
||||||
|
end
|
||||||
new.playAudio = true
|
new.playAudio = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -5039,7 +5043,7 @@ mist.getPayload = function(unitIdent)
|
|||||||
end
|
end
|
||||||
local gpId = mist.DBs.MEunitsById[unitId].groupId
|
local gpId = mist.DBs.MEunitsById[unitId].groupId
|
||||||
|
|
||||||
if unitName and type(unitName) == 'string' then
|
if gpId and unitId then
|
||||||
for coa_name, coa_data in pairs(env.mission.coalition) do
|
for coa_name, coa_data in pairs(env.mission.coalition) do
|
||||||
if (coa_name == 'red' or coa_name == 'blue') and type(coa_data) == 'table' then
|
if (coa_name == 'red' or coa_name == 'blue') and type(coa_data) == 'table' then
|
||||||
if coa_data.country then --there is a country table
|
if coa_data.country then --there is a country table
|
||||||
@ -5064,7 +5068,7 @@ mist.getPayload = function(unitIdent)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
env.info('mist.getPayload got ' .. type(unitName))
|
env.info('mist.getPayload got ' .. type(unitIdent))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
env.info('mist.getPayload, payload not found')
|
env.info('mist.getPayload, payload not found')
|
||||||
@ -5205,10 +5209,10 @@ mist.teleportToPoint = function(vars) -- main teleport function that all of tele
|
|||||||
end
|
end
|
||||||
if point then
|
if point then
|
||||||
if (newGroupData.category == 'plane' or newGroupData.category == 'helicopter') and point.z then
|
if (newGroupData.category == 'plane' or newGroupData.category == 'helicopter') and point.z then
|
||||||
if point.y > 0 and point.y > terrain.getHeight({newGroupData.units[unitNum]["x"], newGroupData.units[unitNum]["y"]}) + 10 then
|
if point.y > 0 and point.y > land.getHeight({newGroupData.units[unitNum]["x"], newGroupData.units[unitNum]["y"]}) + 10 then
|
||||||
newGroupData.units[unitNum]["alt"] = point.y
|
newGroupData.units[unitNum]["alt"] = point.y
|
||||||
else
|
else
|
||||||
newGroupData.units[unitNum]["alt"] = terrain.getHeight({newGroupData.units[unitNum]["x"], newGroupData.units[unitNum]["y"]}) + 300
|
newGroupData.units[unitNum]["alt"] = land.getHeight({newGroupData.units[unitNum]["x"], newGroupData.units[unitNum]["y"]}) + 300
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -1,4 +1,10 @@
|
|||||||
-- changelog
|
-- changelog
|
||||||
|
v44
|
||||||
|
-fxed getPayload for real this time
|
||||||
|
-addEventHandler now correctly returns the Id value
|
||||||
|
-message.add now also accepts variable 'fileName' for the sound file, this is in addition to the .sound variable
|
||||||
|
-fixed issue with teleportToPoint
|
||||||
|
|
||||||
v43
|
v43
|
||||||
-fixed issue with getPayload
|
-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
|
-dynAdd and dynAddStatic now return the full new table and not just its name. The name value is still accessible via returned table.name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user