Jump to content

Recommended Posts

Posted (edited)

Hello,

I use addGroup function in my missions a lot so every time I play it's different. What I would like to do is to create a trigger that would test if for example one of the spawned groups is inside/outside of a predefined zone.

Let's say I will create a group of tanks with group id 101 and name "Group1" and I want to test if they arrived into Zone1 that I placed in the mission editor. I cannot setup the trigger in mission editor itself as you can only select trigger options, not write them in so is there a way to perhaps spawn the trigger with script in similar way as you can spawn groups with addGroup ? I didn't find any addTrigger command on wiki.

One solution that comes to my mind is to create a repeating trigger in mission editor that will just constantly run a script that I would write that would check the relative zone and group positions using getPosition and if distance from zone center is less than zone radius then setup a flag. Is there perhaps a nicer way of doing this please ?

Edited by lanmancz

[sIGPIC][/sIGPIC]

 

Gigabyte Aorus Z390 Elite, Intel i9 9900K, Fractal Design Kelvin S36, Zotac GTX 1070 8GB AMP Extreme, 32GB DDR4 HyperX CL15 Predator Series @ 3000 MHz, Kingston SSD 240GB (OS), Samsung 970 EVO 1TB M.2 NVMe (sim), Fractal Design Define R5 Black Window, EVGA SuperNOVA 750 G2, Win 10 Home x64, Thrustmaster Warthog HOTAS, Saitek Pro Flight Rudder Pedals, Thrustmaster MFD Cougar Pack, TrackIR (DelanClip), 3x 27" BenQ EW2740L, Oculus Rift S

 

Posted

You would have to write a script that basically does the same thing as the trigger and then periodically check that. It is a pretty straight forward script that you could write on your own that works precisely as you have thought out.

 

Mist has a function that does a lot of the work for you, you just need to give it the variables to check :) http://wiki.hoggit.us/view/Units_in_zones

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

Alright, thanks.

Yeah I need to take a look at mist more closely. I didn't use it so far and rather wrote everything myself but I guess there is no need to reinvent the wheel.

[sIGPIC][/sIGPIC]

 

Gigabyte Aorus Z390 Elite, Intel i9 9900K, Fractal Design Kelvin S36, Zotac GTX 1070 8GB AMP Extreme, 32GB DDR4 HyperX CL15 Predator Series @ 3000 MHz, Kingston SSD 240GB (OS), Samsung 970 EVO 1TB M.2 NVMe (sim), Fractal Design Define R5 Black Window, EVGA SuperNOVA 750 G2, Win 10 Home x64, Thrustmaster Warthog HOTAS, Saitek Pro Flight Rudder Pedals, Thrustmaster MFD Cougar Pack, TrackIR (DelanClip), 3x 27" BenQ EW2740L, Oculus Rift S

 

  • Recently Browsing   0 members

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