SE_SetTrigger parameters (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


vettim89 -> SE_SetTrigger parameters (3/23/2021 11:19:44 PM)

Looking over the Lua documentation there is scant information on how to set up various triggers in the 'add' mode

What is the proper syntax to add a trigger for 'unit enters area'?




KnightHawk75 -> RE: SE_SetTrigger parameters (3/24/2021 12:45:06 AM)

Recently answered here http://www.matrixgames.com/forums/fb.asp?m=4974239 (post#12), though specific to the persons need regarding a 'specific unit' level of specificity in the TargetFilter, omit level of specificity if not needed in the filter options.

Put more plainly:
When mode is "add" and type = "UnitEntersArea" further options are:
TargetFilter = {} where it can contains one or more of following comma delimited as needed in the table if needed, and...IF being used at all.
TARGETSIDE = 'TextSideName ie Blue',
TARGETTYPE = 'TextType ie Facility',
TARGETSUBTYPE = 'interger value of the ie class's subtype 5001',
SPECIFICUNITCLASS = 'integer value of the dbid\class ie 2784',
SPECIFICUNITID = 'Guid of the exact unit(technically could be a string name I think but avoid that)'
Area = { comma delimited list of existing RP names here ie 'MyRP-1','MyRP-2','MyRP-3','MyRP-4'}
ETOA = 'integer of dotnet-ticktime datetime type representing entering time. leave empty to be start scenario time'
LTOA = 'integer of dotnet-ticktime datetime type representing leaving time. leave empty to be end of scenario time.'
NOT = 'boolean if the trigger is to be reversed use true. No need to include unless setting to true.'
ExitArea = 'boolean representing if the trigger is reversed ie true is treated as unit exits area trigger. no need to include unless setting to true.'

BTW - One way to see what the options are when dealing with this is to dump an existing created one, either dumping the table entries, or exporting the mission.

PS: If you need to calculate dotnet-ticktime to and from normal game timestamps you can use the following:
function convertDotNetTickTimeToLuaTimestamp(theDotNetStamp)
   return (tonumber(theDotNetStamp) - 621355968000000000) / 10000000
end

function convertLuaTimestampToDotNetTickTime(theUnixStamp)
   return 621355968000000000 + (tonumber(theUnixStamp) * 10000000)
end



Let me know if something doesn't click\make sense to you.




vettim89 -> RE: SE_SetTrigger parameters (3/24/2021 10:47:50 PM)

so the following code works (somewhat)

local patrol=ScenEdit_UnitX()
BuildCircleOfRPs('Iran',patrol,'1')
local zone={}
counter = 1
while counter <13 do
zone[counter]=patrol.name .. "-" .. counter
counter=counter+1
end
local tname='Iran:SOH Int ('patrol.name')'
ScenEdit_SetTrigger({mode='add', description=tname, type='UnitEntersArea', TargetSide='Neutral', TargetType='ship', area=zone})

The problem is that the trigger created does not set up for TargetSide (reads 'any side') nor TargetType (reads 'any type')

Is this a simple syntax issue??




vettim89 -> RE: SE_SetTrigger parameters (3/25/2021 12:37:07 AM)


quote:

ORIGINAL: vettim89

so the following code works (somewhat)

local patrol=ScenEdit_UnitX()
BuildCircleOfRPs('Iran',patrol,'1')
local zone={}
counter = 1
while counter <13 do
zone[counter]=patrol.name .. "-" .. counter
counter=counter+1
end
local tname='Iran:SOH Int ('patrol.name')'
ScenEdit_SetTrigger({mode='add', description=tname, type='UnitEntersArea', TargetSide='Neutral', TargetType='ship', area=zone})

The problem is that the trigger created does not set up for TargetSide (reads 'any side') nor TargetType (reads 'any type')

Is this a simple syntax issue??

Never mind - saw the error - failed to include the 'TargetFilter" line




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.828125