Jump to content

Triggers Based on Scenery Object Destruction


Sport

Recommended Posts

Is there a way to trigger an event (through a script or the ME) to trigger a flagged condition when a certain scenery object is destroyed? For example, if the target is a specific warehouse in a harbor, how do I alert the players to when that object is destroyed and the mission is accomplished? Same with say a bridge?

 

Thanks in advance

Come check me out on

YouTube!

Twitch!

Have a listen to the Alert 5 Podcast - YOUR source for the latest combat flight simulation news!

Link to comment
Share on other sites

Check your PM

  • Like 1

[sIGPIC][/sIGPIC]

Primary Computer

ASUS Z390-P, i7-9700K CPU @ 5.0Ghz, 32GB Patriot Viper Steel DDR4 @ 3200Mhz, ZOTAC GeForce 1070 Ti AMP Extreme, Samsung 970 EVO M.2 NVMe drives (1Tb & 500 Gb), Windows 10 Professional, Thrustmaster Warthog HOTAS, Thrustmaster Warthog Stick, Thrustmaster Cougar Throttle, Cougar MFDs x3, Saitek Combat Rudder Pedals and TrackIR 5.

 

-={TAC}=-DCS Server

Gigabyte GA-Z68XP-UD3, i7-3770K CPU @ 3.90GHz, 32GB G.SKILL Ripjaws DDR3 @ 1600Mhz, ZOTAC GeForce® GTX 970.

Link to comment
Share on other sites

So the quick and dirty way is to put an infantry guy in/near the building and check a trigger if they die. But its still possible to kill the infantry without destroying the building, so it has some drawbacks.

 

There are two basic ways to do it via scripting, but involve defining an area to check.

 

1. Track death events and check if the object was a world object and is in a trigger zone.

2. Use world.searchObjects to find what you are looking for. Use death events or periodically check if the object is still alive or not.

 

There is a function in mist that specifically is used for this purpose: http://wiki.hoggit.us/view/Mapobjs_dead_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

Link to comment
Share on other sites

So the quick and dirty way is to put an infantry guy in/near the building and check a trigger if they die. But its still possible to kill the infantry without destroying the building, so it has some drawbacks.

 

There are two basic ways to do it via scripting, but involve defining an area to check.

 

1. Track death events and check if the object was a world object and is in a trigger zone.

2. Use world.searchObjects to find what you are looking for. Use death events or periodically check if the object is still alive or not.

 

There is a function in mist that specifically is used for this purpose: http://wiki.hoggit.us/view/Mapobjs_dead_zones

 

So if I understand that correctly, I want to create a trigger zone over the object I want to destroy (building, bridge, etc) and create the script to look like:

mist.flagFunc.mapobjs_dead_zones{  
  zones = {'bridge1'},  
  flag = 10
}

 

 

Where the bridge is within the trigger zone "bridge1" and when destroyed Flag 10 will = True?

 

I need to really read up on MIST and how to use it. My brain struggles with programming language, but its something that I'm going to need to learn if I want to make more dynamic and interesting missions for me and my friends to fly...

Come check me out on

YouTube!

Twitch!

Have a listen to the Alert 5 Podcast - YOUR source for the latest combat flight simulation news!

Link to comment
Share on other sites

Yep. Keep in mind it'll detect any world objects that die in the zone. So you may need to fine tune the trigger zone size to make sure only the bridge is in there.

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

Link to comment
Share on other sites

I use mortars instead of infantry, because they are harder to kill. Can make a group of two or three mortars for a bigger area.

 

Sport - you can define a zone on the outline of the object. Use a single unit/group and set the waypoints around the object. The unit that defines the zone is Blue ZGrp30 Armor.

-- define the zone with a single hidden unit using its waypoints
mist.flagFunc.units_in_polygon{
units = {'[blue][vehicle]','[-g]Blue ZGrp30 Armor'},
zone = mist.getGroupPoints('Blue ZGrp30 Armor'),
flag = 73008,
}

See the Mist Guide around page 32 for more info on polygons.

Visit the Hollo Pointe DCS World server -- an open server with a variety of COOP & H2H missions including Combined Arms. All released missions are available for free download, modification and public hosting, from my Wrecking Crew Projects site.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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