Jump to content

Message after Cargodrop in Triggerzone


b0rnkilla

Recommended Posts

Hi @ all,

 

I really need some :helpsmilie: from you Guys :(

 

After successfully scripting a dynamic spawn of different cargo types via radiomenu (F10-Menu) and functions which check their status as well as their amount (for limitation reasons), I'm trying to figure out, how to get a message displayed (with "outText"-function), including playername and cargoname, when the cargo will be dropped in a trigger zone. I've been already desperated for a while, because of this.... :noexpression:

 

I tried it with:

mist.flagFunc.units_in_zones

but it looks like, only vehicles,planes,helicopters and ships are part of the "UnitNameTables"... the easiest way would be something similar to "UnitNameTables", but in this case especially for static objects and cargo objects.

 

although.... the function "units_in_zones" only triggers a flag... thats not very helpful in this case, except I would have a function which checks the status of the flag continuously and if the flag is true, the function has to know the helicopter and cargo in the zone... but this could be a problem if more than one helicopters are bringing cargo into the zone at the same time..... aaaaahhhrg :doh:

 

It's easy to figure out the cargo id as well as creating an array which carries all the spawned cargos by name or id, but I'm still searching for a way to create a function which recognizes if the cargo is inside the zone.

 

I don't think that it will be a problem if the cargo is still in the air, because this can be handled by "getPosition" or ":inAir()"

 

One more thing: I don't wanna do this in the Missioneditor,... it has to be done within a lua-script.

 

I need this function later, too.. for some reasons like creating a FARP if some cargo will be dropped in a zone and so on.

 

for example:

 

cargoname "US_SF_Cargo_Fässer 001" - type: barrels_cargo

array "US_SF_Cargo_spawned_OBJ" - includes all spawned cargos by name

helicoptername "Huey 1-1"

playername "John Doe" - or whatever...

 

by the way: I personally dont wanna use CTLD by cribob (you did a great job cribob, but I wanna use my own scripts and functions ^^)

 

looking forward for your :helpsmilie:

 

happy flying :pilotfly:

Link to comment
Share on other sites

  • 7 months later...

Hi, you can make a static objects table with this function : https://wiki.hoggitworld.com/view/DCS_func_getStaticObjects
Filter needed types with StaticObject.getTypeName().
You can use :getPoint() on table's static objects and get their distance to zone(s).point(s) to check if inside ( https://wiki.hoggitworld.com/view/MIST_get2DDist ), and when distance is < to zone.radius you can display a message with data you want.

I think what you want to do is doable.

  • Thanks 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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