Wrecking Crew Posted March 10, 2013 Posted March 10, 2013 Hi, I am setting triggers to assess damage to ships. I have five triggers that are to detect Group Alive Less Than using a one-ship group. The current triggers are looking for 99%, 98%, 97%, 96% and 95%, plus one more trigger for Group Dead. Each trigger has a message that gives the flag value - 99-95, and Dead. I dive an A-10C onto the ship and use the cannon that is loaded with training rounds - so I can see the tracers at night. (My testing is in the daylight.) What I see in the triggered messages is that as I put bursts into the cargo ship I will get the group dead message before I see any of the other five messages. For instance I will see the Dead message and then it gets immediately replaced with a message '98'. I want to see one of the 99 to 95 messages before the Dead message (these 99-95 can be any values, I tried 98, 70, 60, 50, 30 and a few other values, too). These triggers are supposed to warn pilots off of these ships before the pilots identify the ships by passing close to them - w/in 50 or so meters. Some ships are friendly and others are not, but the pilot needs to get up close and do a Mark-1 Eyeball inspection to find out. I don't want the pilots shooting up the ships from a distance before they have been identified. But the problem I'm seeing is that the ship is dead before it is damaged by even 1%. A simple mission is attached. --- I saw recently where Grimes(?) showed how to display a flag's value in a triggered text message but cannot find that post. Can someone point me there? TIA. --- :-) The other thing I'd like to do is mix cannon HE with the tracers for nighttime... ? WC [ATTACH]78283[/ATTACH] 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.
Eddie Posted March 10, 2013 Posted March 10, 2013 Triggers are only evaluated once a second, so if the damage happens in a time span of less than one second, as it will, then all the trigger conditions will become true during the same evaluation run. As for tracer, there shouldn't really be tracers when training rounds are loaded, let alone HEI or CM. The A-10 does not use tracer.
Wrecking Crew Posted March 10, 2013 Author Posted March 10, 2013 I'm firing small bursts at the ship (of tracers) and coming back around for more passes. You'd think that I'd see at least the 95 percent message before I'd see the dead message. It seems odd that the Dead message would show first - after I make several passes of gun runs - and then have the Dead message be followed by a 98 message. It's like the ship is killed before it has 1% of assessed damage. WC 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.
Wrecking Crew Posted March 10, 2013 Author Posted March 10, 2013 ^^^ In addition, these 99-95 triggers are set such only one can be triggered at a time in the evaluation pass. WC 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.
Wrecking Crew Posted March 10, 2013 Author Posted March 10, 2013 I got to 0.5M slant range to the ship and went into Active Pause. I fired 10 round bursts into the ship at intervals >1 second. At around 990 rounds left the ship started burning. A few bursts after that the Dead message flashed and was followed by 98. It seems that ship damage is not assessed correctly. What am I doing wrong? WC 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.
Eddie Posted March 10, 2013 Posted March 10, 2013 Ah, reading your post again, you only have one unit in the group so yes this makes even more sense. Your triggers are detected if the GROUP is at 100% strength or not, not detecting the health of individual units in that group. As your group only has one unit to start with, it is in fact at 100% strength until that unit is destroyed. Try using a unit damaged condition instead.
Wrecking Crew Posted March 10, 2013 Author Posted March 10, 2013 Wow - that is a subtle, and important, distinction! Thanks, Eddie. 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.
Speed Posted March 10, 2013 Posted March 10, 2013 (edited) AFAIK, Group Alive Less Than was not meant to analyze the amount of life a unit has left- just whether it is alive or dead. Even if you follow Eddie's suggestion, Unit Damaged is just a boolean true or false as to whether the unit is damaged or not. You should forget triggers and use Lua. Read through the simulator scripting engine wiki to get an idea of what is available. Replace "cargo ship" with the actual name of your ship unit, then run this on a Continuous trigger: do local ship = Unit.getByName('cargo ship') if ship then local life = ship:getLife() local startingLife = ship:getLife0() trigger.action.outText('Ship\'s current hit points remaining: ' .. tostring(life) .. '\nPercentage of starting hit points: ' .. life/startingLife*100 .. '%', 1) end end Simple huh? You just use Unit.getByName to get the Unit object for your ship, then you just output the values of Unit.getLife and Unit.getLife0 on that ship. EDIT: I forgot to put *100 to convert the life/startingLife to a percent :doh:, fixed now Edited March 10, 2013 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.
Wrecking Crew Posted March 10, 2013 Author Posted March 10, 2013 OK, it is shaping up... By using Unit Damaged Condition the message order is proper and separated - 98 shows and later Dead is displayed. Probably because the cannon is damaging the ship many times in each burst, the message jumps to 98 and now to 95 after I fixed some more logic. I did see something to report - When I changed the first (top-most) trigger from Group Alive <99 to Unit Damaged, the Percent field would not close and the Unit Damaged would not change the Condition type - it remained on the Group Alive Less Than. I had to create a New Condition with Unit Damaged. After that the other trigger's all changed correctly by modifying the Condition type. The other thing is about Flag Increase. Seems the first Flag Increase (by 1) is setting the flag to True and Zero. The second Flag Increase (1) results in the flag's value at 1, and so on. I was expecting the second Flag Increase (1) to have set the flag's value to 2. This is why I want to be able to message the flag values. With a bit more logic I think I'll be able to generate the five messages I want. WC 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.
Wrecking Crew Posted March 10, 2013 Author Posted March 10, 2013 I'll get there, Speed! It shouldn't be too much longer. (Right after I pick up my Procrastinator's Club Card.) WC 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.
Speed Posted March 10, 2013 Posted March 10, 2013 I'll get there, Speed! It shouldn't be too much longer. (Right after I pick up my Procrastinator's Club Card.) WC Well, you can do it the easy way... or you can do it the triggers way :D 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.
Wrecking Crew Posted March 10, 2013 Author Posted March 10, 2013 I know :) It'll be like the difference between MS Access' Queries and VBA. Queries are soo old school anymore! --- OK, all is working to output five messages. In the real mission the Time Since Flag will be set higher to ~60(?). Thanks, guys. WC [ATTACH]78285[/ATTACH] 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.
Wrecking Crew Posted March 10, 2013 Author Posted March 10, 2013 The Unit Damaged being Boolean means I don't need the Flag Increase action any longer. WC 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.
Wrecking Crew Posted March 10, 2013 Author Posted March 10, 2013 LOL, the Conditions are now all the same :-) Only need one Switched Condition trigger, not five Once types. Good thing I know what I'm doing. :smartass: WC 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.
Recommended Posts