Jump to content

How to check if a bulding was successfully bombed?


Rongor

Recommended Posts

I so far put a trigger zone around the building and try to tell the damn editor to check for a bomb entering this zone.

As often, the intuitive way to do something in the DCS World mission editor again doesn't work as simple as one would like. :mad:

I placed a continued-triggered-by-"on shot"-event-condition-bomb-inside-zone-for-the-trigger-zone to display a message. Nothing happens when bombing that building in that trigger zone...

Link to comment
Share on other sites

mist.getDeadMapObjsInZones

mist.getDeadMapObjsInPolygonZone

mist.flagFunc.mapobjs_dead_zones

mist.flagFunc.mapobjs_dead_polygon

 

These should still work, there weren't any changes to the way map objects work to my knowledge.

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Link to comment
Share on other sites

How much study does it take to write a single line of Lua

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

?

You must have very little time, indeed :D

 

If you insist on doing it with triggers (aka, "the hard way"), try taking out the "on shot" event from your trigger, that will certainly make it not work. The problem with bomb in zone is that I'm sure it's only checked every second, just like the other triggers. Also keep in mind that the zone probably extends in altitude to infinity. If your zone is too large, you will be counting alot of near-miss trajectories that overshoot the target. If your zone is too small, the bomb won't even be inside it long enough to be detected, on average. And it doesn't even tell you if the map object really died in the first place.

 

However, bomb in zone may in fact work well enough, if the map object isn't too small and hte bomb is moving slowly. I've never used bomb in zone myself though, as Lua affords much superior capabilities.


Edited by Speed

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Link to comment
Share on other sites

I suspect the problem is that he may simply not know what to do with that. I can understand that using scripts, even as simple as this one, is not obvious for people not used to it.

 

So here is how you should do it, Rongor.

 

1°) In your mission, do a MISSION START trigger with action DO SCRIPT FILE (Mistv3_3.lua) (after having downloaded MiST). You can also put it as the initialization script, I guess. This will allow you to use MiST functions

 

2°) Some time after that (like TIME MORE (5) for example), do a ONCE trigger with no conditions, and the DO SCRIPT action, and put the following as the script:

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

This will have the game begin checking if any building in trigger zone "bridge1" (you can change that name if you like) is destroyed, and if it detects that this is so, it will set the flag 51 to true

 

3°) Make your trigger zone "bridge1" so that the bridge is inside, but nothing else

 

4°) Check for flag 51 to become true, which will tell you that the bridge is destroyed

 

I hope that helps


Edited by Robin_Hood
  • Like 1
Link to comment
Share on other sites

I know from experience how daunting the script use is and I think Robin Hood has hit it on the head. Once it clicks in the usage is easy but writing it from scratch- not a chance for me anyway.

 

Rongor there is a world of capability waiting for you in these scripts that do many have put together. If I can learn how to use what's already been made by speed and others you can too.

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Thanks so much guys. It is indeed my problem that I also want to understand what I am scripting and not only enter some code I don't really understand. I absolutely expect me being able to learn this some day but that is exactly the task I will have to invest some time for to really get the hang of it.

 

Last try I did was this so far:

Dh5HNUx.jpg

but it didn't work. The vertically infinite zone is not a problem since I placed it matching to a building I will aim for with the bomb and will eventually be hit. So the bomb will without problems hit the very spot inside the zone and a trigger condition could be met. If I only knew how to tell the mission editor, that once again fails to act as one would intuitively expect.

Will maybe soon then start to get into the Lua stuff and when using that mist thingy I will remember your recommendations. Thanks again for that many inspirations.:thumbup:

Link to comment
Share on other sites

go for it rongor - it took me about 10 minutes to learn how to leverage MIST.... don't let your intimidation stand in your way.

 

check a little bit further down in this forum - you'll see my post

ASUS Tuf Gaming Pro x570 / AMD Ryzen 7 5800X @ 3.8 / XFX Radeon 6900 XT / 64 GB DDR4 3200 

"This was not in the Manual I did not read", cried the Noob" - BMBM, WWIIOL

Link to comment
Share on other sites

I wrote this for another guy in here who was having some trouble stepping into the ease of script use... it requires 0 studying at all and once you get this fundamental step out of the way the rest is easy.

 

You won't be writing your own scripts (well you might at some point but that's up to you)- but you will find ones that work for accomplishing what you want to do and you will be able to manipulate them to do so.

 

It does sort of repeat what robin hood said- but goes into a little more detail. I'm editing it slightly to account for MIST 3.3.

 

Do et!

 

On another note- here's a step by step introduction to MIST 3.3... the guide actually goes through it pretty well but some of it can be overwhelming- no doubt about it. I have only tapped into 10% of what it can actually do, but I'm learning more on an almost daily basis.

 

Okay first step is to go HERE to download. It's a RAR file so you'll likely need to get a copy of "WINRAR" ( or 7zip or whatever) to unzip it somewhere of your choosing. The saved games / DCS folder is a good place to start. It doesn't REALLY matter where it is- but when you are working in the mission editor you'll need to know where to go and get it.

 

Once you have that unpacked and ready to go, you're literally ready to use it. Here's how:

 

You'll get to a point in your mission where you simply can't efficiently use available trigger options to accomplish a task. I mean, I've sat through the ME triggers and inputted a hundred triggers to account for every possibility- or I can use one MIST script that I copy paste in 10 seconds and modify for my purposes. It's LITERALLY that simple in many cases.

 

First, go into the mission editor and make a new "Mission Start" trigger. Condition can be left blank, and the action is "Do Script File" where you'll quickly go to "Open" and choose the MIST 3.3.lua" file that you saved (perhaps in saved games / dcs). When you save the mission, that file will be loaded / stored into the .miz file- so it doesn't need to follow the mission around separately or anything. It's ALWAYS there for your mission. (Leave the trigger in there, though!)

 

Second step. Let's use your example above- map object destroyed in zone. Create a trigger zone around the bridge in question. Call it "bridge." (no quotes) Be careful because case matters- "Bridge" and "bridge" will be two different zones. So too will be "Bridge1" and "Bridge 1."

 

Then start a "Run Once" Trigger with a condition of "time more (10)". Sometimes it can take the MIST functions a few seconds to catch up to the fact that MIST is loaded- so giving 10 seconds at the beginning of the mission to make sure that all is well helps to prevent errors.

 

The action is simply "Do Script." It is here where the seemingly complex task begins- however, if you look into the MIST guide you'll see a

mist.flagFunc.mapobjs_dead_zones on or around page 11. There are a few confusing entries there that might not make sense but take a minute to read what each part of the script represents in its individual components. You can then literally copy and paste the example entry in this case into your "do script" window.

 

mist.flagFunc.mapobjs_dead_zones{ zones = {'bridge1'}, flag = 51 } is EXACTLY what is in there now. So consider your particular case- your zone was called bridge- not bridge1... so go into your "do script" window and delete the 1 out of 'bridge1.'

 

You may have a different flag numbering system- let's say you have it set up with wrecking crew's number system and that flag needs to be (and I have a funny feeling he'll correct me on this) 10013. So instead of "flag = 51" you can edit it to "flag = 10013."

 

Done.

 

No really- that's it.

 

Now when that bridge is destroyed, using whatever munition you can dream of... flag 10013 will be set and whatever action you want to build off that flag can happen.

 

Granted- and I've approached Grimes about this down in THIS thread- not ALL script functions have such elabourate examples that you can copy and paste- but he and a few other guys sound interested in buckling down (once again) to complete each entry with an example that can be modified. That's an ENORMOUS task and I'm not sure when that is going to happen- but until then there are quite a few guys in here who are EXTREMELY helpful provided you demonstrate a willingness to help yourself. Explain what you want to do, describe what you've done... and see if someone can point you in the right direction.

 

Open up the mission editor and have a "test" mission of sorts that you can go in and field test different functions and how they work. You'll be amazed.

 

I'm having a LOT of fun right now with the teleport in zone / random zone ... and group to random zones... these functions allow for various groups to be spawned in (or to travel to) random created zones- helping to add some extended playability by ensuring groups aren't always in the same place each time.

 

They can either travel to random places... you can even have ground troops patrol back and forth the same way aircraft can "switch waypoints" and fly between two points until they're bingo fuel.

 

Anyway- my suggestion is to be brave... go get MIST, load it as a "mission start" trigger in your future missions and flip through the guide seeking out the abilities you want to use.

:book:


Edited by ENO

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

As for making your triggers work, have you tried what Speed suggested, ie. changing your ON SHOT trigger with a NO EVENT ?

 

For one thing, ON SHOT will evaluate the condition when your bombs are dropped, not when they impact, and there is a good chance they will not be dropped inside the zone (unless you drop them from a 90° dive).

Link to comment
Share on other sites

It is indeed my problem that I also want to understand what I am scripting and not only enter some code I don't really understand.

 

When you're using triggers, all you're doing is writing Lua, really. The GUI-based triggers get converted into Lua by the mission editor, and the C++ DCS.exe runs that Lua in an embedded Lua environment. So you're already using a bunch of Lua you don't understand.

 

So there is really no difference between using Lua scripting and using triggers, it's just that with triggers, you can't make a spelling, syntax, or runtime error because everything is pre-defined for you (except for when there's a bug in DCS where the triggers DO generate a Lua error). The tradeoff is that triggers are massively less capable.

 

In this case, Mist is a third-party library that in effect, adds extra triggers for you. You don't have to understand how the complex, world events system works, how to tell a map object apart from a static object or unit, how to get the position in x,y,z, etc. Mist packages that all up into a "neat" little package, so you only have to specify the name of the function, and the values of a few variables.

 

Finally, you "want to understand what I am scripting and not only enter some code I don't really understand"? Real-life computer coders have no quibble at all entering massive amounts of code they don't understand. They are called libraries, and without them, modern software would not be possible.

 

For example, when I write #include <string> at the top of C++ file to add the capability to manipulate C++ character strings to the application I'm building, I don't know how the C++ string library works. I don't need to know how it works, that's the whole point- someone else figured out a good implementation of strings, published it years ago, and now everyone uses it so that we don't have to each spend months developing our own (probably buggy) solutions to the same problem. There is no point in re-inventing the wheel.

 

That's the point of Mist. Someone figured out a solution to detecting objects within polygon-shaped zones, dead map objects, etc., and by including Mist, you don't have to understand how those details work behind the scenes. The point is to save you a bunch of work, allowing you to spend more time developing a quality mission instead of re-inventing the wheel.


Edited by Speed

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Link to comment
Share on other sites

I'd keep it simple and just put an infantry unit standing beside the building you want hit. If the infantry man dies - then you are pretty sure the building was hit. Not ideal but simple.

 

You could put a soldier on each side of the building and if only some of them died then the building could be considered only partially destroyed.

 

Agree that scripting isn't that hard but I opt for simple solutions that are easy to debug when I can.

F-15C-User-Bar-ACM.v2.jpg

MapleFlagMissions - Read Our Blog for Updates

Link to comment
Share on other sites

  • Recently Browsing   0 members

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