Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

SE_SetTrigger parameters

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> SE_SetTrigger parameters Page: [1]
Login
Message << Older Topic   Newer Topic >>
SE_SetTrigger parameters - 3/23/2021 11:19:44 PM   
vettim89


Posts: 3615
Joined: 7/14/2007
From: Toledo, Ohio
Status: offline
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'?


_____________________________

"We have met the enemy and they are ours" - Commodore O.H. Perry
Post #: 1
RE: SE_SetTrigger parameters - 3/24/2021 12:45:06 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
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.


< Message edited by KnightHawk75 -- 3/24/2021 1:12:04 AM >

(in reply to vettim89)
Post #: 2
RE: SE_SetTrigger parameters - 3/24/2021 10:47:50 PM   
vettim89


Posts: 3615
Joined: 7/14/2007
From: Toledo, Ohio
Status: offline
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??

_____________________________

"We have met the enemy and they are ours" - Commodore O.H. Perry

(in reply to vettim89)
Post #: 3
RE: SE_SetTrigger parameters - 3/25/2021 12:37:07 AM   
vettim89


Posts: 3615
Joined: 7/14/2007
From: Toledo, Ohio
Status: offline

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

_____________________________

"We have met the enemy and they are ours" - Commodore O.H. Perry

(in reply to vettim89)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> SE_SetTrigger parameters Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

3.233