mirror of
https://github.com/mrSkortch/MissionScriptingTools.git
synced 2025-08-15 10:47:23 +00:00
commit
b5c7b16500
16
mist.lua
16
mist.lua
@ -35,7 +35,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 4
|
mist.majorVersion = 4
|
||||||
mist.minorVersion = 3
|
mist.minorVersion = 3
|
||||||
mist.build = 71
|
mist.build = 72
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@ -2128,6 +2128,7 @@ do
|
|||||||
-- @treturn table @{UnitNameTable}
|
-- @treturn table @{UnitNameTable}
|
||||||
function mist.makeUnitTable(tbl)
|
function mist.makeUnitTable(tbl)
|
||||||
--Assumption: will be passed a table of strings, sequential
|
--Assumption: will be passed a table of strings, sequential
|
||||||
|
log:info(tbl)
|
||||||
local units_by_name = {}
|
local units_by_name = {}
|
||||||
|
|
||||||
local l_munits = mist.DBs.units --local reference for faster execution
|
local l_munits = mist.DBs.units --local reference for faster execution
|
||||||
@ -4522,8 +4523,10 @@ unitTableDef = table or nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef then
|
||||||
units = mist.makeUnitTable(unitTableDef)
|
units = mist.makeUnitTable(unitTableDef)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
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) == 0) 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) == 0) then
|
||||||
local num_in_zone = 0
|
local num_in_zone = 0
|
||||||
@ -4594,8 +4597,10 @@ unitTableDef = table or nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef then
|
||||||
units = mist.makeUnitTable(unitTableDef)
|
units = mist.makeUnitTable(unitTableDef)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@ -4666,13 +4671,18 @@ unitTableDef = table or nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef then
|
||||||
units = mist.makeUnitTable(unitTableDef)
|
units = mist.makeUnitTable(unitTableDef)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if (zone_units.processed and zone_units.processed < mist.getLastDBUpdateTime()) or not zone_units.processed then -- run unit table short cuts
|
if (zone_units.processed and zone_units.processed < mist.getLastDBUpdateTime()) or not zone_units.processed then -- run unit table short cuts
|
||||||
|
if zUnitTableDef then
|
||||||
zone_units = mist.makeUnitTable(zUnitTableDef)
|
zone_units = mist.makeUnitTable(zUnitTableDef)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
local in_zone_units = mist.getUnitsInMovingZones(units, zone_units, radius, zone_type)
|
local in_zone_units = mist.getUnitsInMovingZones(units, zone_units, radius, zone_type)
|
||||||
@ -4745,12 +4755,16 @@ toggle = boolean or nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (unitset1.processed and unitset1.processed < mist.getLastDBUpdateTime()) or not unitset1.processed then -- run unit table short cuts
|
if (unitset1.processed and unitset1.processed < mist.getLastDBUpdateTime()) or not unitset1.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef1 then
|
||||||
unitset1 = mist.makeUnitTable(unitTableDef1)
|
unitset1 = mist.makeUnitTable(unitTableDef1)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if (unitset2.processed and unitset2.processed < mist.getLastDBUpdateTime()) or not unitset2.processed then -- run unit table short cuts
|
if (unitset2.processed and unitset2.processed < mist.getLastDBUpdateTime()) or not unitset2.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef2 then
|
||||||
unitset2 = mist.makeUnitTable(unitTableDef2)
|
unitset2 = mist.makeUnitTable(unitTableDef2)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@ -35,7 +35,7 @@ mist = {}
|
|||||||
-- don't change these
|
-- don't change these
|
||||||
mist.majorVersion = 4
|
mist.majorVersion = 4
|
||||||
mist.minorVersion = 3
|
mist.minorVersion = 3
|
||||||
mist.build = 71
|
mist.build = 72
|
||||||
|
|
||||||
-- forward declaration of log shorthand
|
-- forward declaration of log shorthand
|
||||||
local log
|
local log
|
||||||
@ -2128,6 +2128,7 @@ do
|
|||||||
-- @treturn table @{UnitNameTable}
|
-- @treturn table @{UnitNameTable}
|
||||||
function mist.makeUnitTable(tbl)
|
function mist.makeUnitTable(tbl)
|
||||||
--Assumption: will be passed a table of strings, sequential
|
--Assumption: will be passed a table of strings, sequential
|
||||||
|
log:info(tbl)
|
||||||
local units_by_name = {}
|
local units_by_name = {}
|
||||||
|
|
||||||
local l_munits = mist.DBs.units --local reference for faster execution
|
local l_munits = mist.DBs.units --local reference for faster execution
|
||||||
@ -4522,8 +4523,10 @@ unitTableDef = table or nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef then
|
||||||
units = mist.makeUnitTable(unitTableDef)
|
units = mist.makeUnitTable(unitTableDef)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
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) == 0) 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) == 0) then
|
||||||
local num_in_zone = 0
|
local num_in_zone = 0
|
||||||
@ -4594,8 +4597,10 @@ unitTableDef = table or nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef then
|
||||||
units = mist.makeUnitTable(unitTableDef)
|
units = mist.makeUnitTable(unitTableDef)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@ -4666,13 +4671,18 @@ unitTableDef = table or nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
if (units.processed and units.processed < mist.getLastDBUpdateTime()) or not units.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef then
|
||||||
units = mist.makeUnitTable(unitTableDef)
|
units = mist.makeUnitTable(unitTableDef)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if (zone_units.processed and zone_units.processed < mist.getLastDBUpdateTime()) or not zone_units.processed then -- run unit table short cuts
|
if (zone_units.processed and zone_units.processed < mist.getLastDBUpdateTime()) or not zone_units.processed then -- run unit table short cuts
|
||||||
|
if zUnitTableDef then
|
||||||
zone_units = mist.makeUnitTable(zUnitTableDef)
|
zone_units = mist.makeUnitTable(zUnitTableDef)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
local in_zone_units = mist.getUnitsInMovingZones(units, zone_units, radius, zone_type)
|
local in_zone_units = mist.getUnitsInMovingZones(units, zone_units, radius, zone_type)
|
||||||
@ -4745,12 +4755,16 @@ toggle = boolean or nil
|
|||||||
end
|
end
|
||||||
|
|
||||||
if (unitset1.processed and unitset1.processed < mist.getLastDBUpdateTime()) or not unitset1.processed then -- run unit table short cuts
|
if (unitset1.processed and unitset1.processed < mist.getLastDBUpdateTime()) or not unitset1.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef1 then
|
||||||
unitset1 = mist.makeUnitTable(unitTableDef1)
|
unitset1 = mist.makeUnitTable(unitTableDef1)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if (unitset2.processed and unitset2.processed < mist.getLastDBUpdateTime()) or not unitset2.processed then -- run unit table short cuts
|
if (unitset2.processed and unitset2.processed < mist.getLastDBUpdateTime()) or not unitset2.processed then -- run unit table short cuts
|
||||||
|
if unitTableDef2 then
|
||||||
unitset2 = mist.makeUnitTable(unitTableDef2)
|
unitset2 = mist.makeUnitTable(unitTableDef2)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
@ -1,3 +1,28 @@
|
|||||||
|
v72
|
||||||
|
fixed bug with flagFuncs to correctly check and assign unitTableDef entries.
|
||||||
|
|
||||||
|
v71
|
||||||
|
added shapename DB entry
|
||||||
|
dynAddStatic will now add a shapename if the object type matches a shapename DB entry
|
||||||
|
|
||||||
|
v70
|
||||||
|
Added assorted error checking on a few functions
|
||||||
|
v69
|
||||||
|
- Updated mission used to create DBs. There should no longer be any unit
|
||||||
|
names that are the same as group names.
|
||||||
|
|
||||||
|
Dynamically generated names will now be indexed accordingly to their
|
||||||
|
category. Used to be just a single counter shared between all.
|
||||||
|
|
||||||
|
Several changes and fixes to dynAddStatic
|
||||||
|
-Fixed function wasn't working when given certain params.
|
||||||
|
-fixed country checker to better account for country names with spaces.
|
||||||
|
This fix was applied to dynAdd but not dynAddStatic, I corrected this.
|
||||||
|
-Optimized it slightly. Trimmed the fat of some of the code.
|
||||||
|
|
||||||
|
v68
|
||||||
|
-DB refactor-start
|
||||||
|
|
||||||
v66
|
v66
|
||||||
-Added default setting for logger if no value present
|
-Added default setting for logger if no value present
|
||||||
-Added documentation for logger
|
-Added documentation for logger
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user