Jump to content

Recommended Posts

Posted

I'm trying to create a trigger zone in one of my scripts, and was looking at the hoggitworld wiki, which shows that a trigger zone table has the following format:

ZoneTable Format

 TriggerZone = {
  point = Vec3,
  radius = Distance
}

In the trigger singleton class, I see a method getZone(), but when I used it against a table I created in the format above, it's not recognizing it as a trigger zone.  Is there a method you must use to create a trigger zone, without having to create one manually within the mission via the mission editor?

Posted

Hmm, so I created a simple mission and added a trigger zone, and looking at the .miz file, I see the table is a bit more involved than I thought above:

    ["triggers"] = 
    {
        ["zones"] = 
        {
            [1] = 
            {
                ["radius"] = 12070.08,
                ["zoneId"] = 495,
                ["color"] = 
                {
                    [1] = 1,
                    [2] = 1,
                    [3] = 1,
                    [4] = 0.15,
                }, -- end of ["color"]
                ["properties"] = 
                {
                }, -- end of ["properties"]
                ["hidden"] = false,
                ["y"] = 620280.80453354,
                ["x"] = -290504.63453896,
                ["name"] = "CAS search zone",
                ["heading"] = 0,
                ["type"] = 0,
            }, -- end of [1]
        }, -- end of ["zones"]
    }, -- end of ["triggers"]
 

So, I presume I need to create a table with the properties above and append it to the zones table (which is appears to be in the triggers table).  I'm actually just trying to create a temporary trigger zone (so I can then search for units within it), not a permanent trigger zone.  Any additional thoughts on how best to create a zone via lua/SSE are appreciated.

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...