Jump to content

Scripting API - Event.dead not called if an object isn't immediately dead


Recommended Posts

Yeah just came across of this as well right now

In case of T-55 DCS dead event event.initiator:getCategory() is 1 and in case of T-72 it is 3
3 is static, looks like cooked up T-72 is static

Seems that some units have now that "cooking off" delayed death and they cause this problem.

here is my report in moose thread with video and test mission.

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, Special K said:

the unit type magically changes from UNIT to STATIC.

... so take note if you are processing kill events. Static objects don't respond well to getGroup(). That can wreak havoc on your score-keeping code. 

 

Link to comment
Share on other sites

  • 2 weeks later...

@Pikey, I have a little test mission, where I trigger an explosion of 2 kg TNT at the position of a TPz Fuchs. I didn't and still don't get a dead event when it's cooking even though it is clearly dead and not shown anymore on the F10 map and its lifepoints are 0.

When I increase the explosion power to 5 kg, it is instantly dead and the dead event is triggered.

 

TL;DR not fixed from what I can see

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

@Grimes@BIGNEWY@Apple@Flappie

why are there open beta versions when such a critical bug is patched into the stable version today?
the error is likely to affect every mission out there.


or how do the other mission designers ask if their units have died if not using "event.dead" for any ground vehicle?

tips are welcome.
i had to change large parts of my script for the open beta so that the mission can continue at least rudimentarily.

Link to comment
Share on other sites

1 hour ago, Jakko said:

@Grimes@BIGNEWY@Apple@Flappie

why are there open beta versions when such a critical bug is patched into the stable version today?
the error is likely to affect every mission out there.


or how do the other mission designers ask if their units have died if not using "event.dead" for any ground vehicle?

tips are welcome.
i had to change large parts of my script for the open beta so that the mission can continue at least rudimentarily.

I was previously checking for the Object and Unit categories to score the dead units. I've switched to just checking if whatever died has specific attributes, regardless of category. Seems to work ok so far. Still pretty disappointing that ED pushed this to stable.

Link to comment
Share on other sites

I no longer look at initiator object category, just initiator category. it'll return whether it's a static or unit but that's the best I got. and you have to use an active filter, not filter once. I agree it's very frustrating. I don't want to update all my missions because I don't like doing it this way and if they fix it i'd go back to the old way. but the fix is probably measured in months to years, not days to weeks so best to find workarounds. it shouldn't have made it into stable, but really, what's the point of stable anymore? it's no more or less stable than Open Beta (mostly a compliment for not crashing open beta with the new closed testing procedures, 👍) just delayed. This seems like such a small bug but it's such a huge PITA and really hampers some of the missions i build.

12900K | MSI Z690 | STRIX RTX3090 | 64GB DDR4 3600MHz | NVMe Storage gen3 | Custom Loop | Valve Index

Link to comment
Share on other sites

29 minutes ago, Apple said:

Yes this urgently needs fixing. Still nothing official on this from @BIGNEWY or @Grimes

I said it was reported and I've tried to give it some attention, but other than that I can't do much at all about it unfortunately. 

  • Like 2
  • Thanks 2

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

  • 2 weeks later...

In the server missions I maintain, this breaks the scheduled spawning. Once a given group of targets are killed, they don't respawn. I can use trigger zones to work around this, but it would be much better if ED addressed this problem rather than having to do extensive editing to all of our missions!

  • Like 2

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Just to help out the explanation because the problem wasn't immediately fully understood.

Ground units at least, possibly more kinds are substituted for a "static type unit" when they recieve terminal damage, i.e. when they are on flames, no health and 30 seconds later explode.

A lot of scripts rely on knowing when something has died so it can be respawned or an activity takes place as a result. This is a fundamental scripting trigger and one of the most obviously used. It has been used for over a decade, and over these years many scripts are created to leverage the fact that something 'died' in the mission.

Due to the change of the type of unit that explodes, DCS creates a dead event but its not the same unit type and is missed because it is a static. Depending on the coding, a script can hit or miss this, but at least as far as I know any script created with Moose prior to today (5/6 years worth) will fail to recognise something died in game. We implemented a workaround where we have to examine a static dying and check it wasn't a unit and all sorts of messy and un hygenic workarounds to get it going, but the impact post today remains the years of work people have created using Moose will fail to recognise a dead unit as a result. I dont have an assement for the AGME or Mist or custom SSE scripting related scripts.

What the ask is, is to have things as they were before, that when a unit dies, it doesn't change its type, in order to preserve the thousands of published player scripts that are downloadable on the forums and web site.

Thanks.


Edited by Pikey
tpyo
  • Like 7

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

On 5/5/2022 at 10:08 AM, Pikey said:

What the ask is, is to have things as they were before, that when a unit dies, it doesn't change its type, in order to preserve the thousands of published player scripts that are downloadable on the forums and web site.

I believe the ask is slightly simpler - nobody is opposed to the change of type per se, it's something that could potentially be used later. What we simply ask is that the dead event is invoked for the unit - what happens after (e.g. turn into static) is not important (to me, and I wager for most scripts). If that static unit later also receives a dead event, so much the better, no skin off anyone's nose. Just invoke the dead event just prior to switching it to static.


Edited by cfrag
  • Like 2
Link to comment
Share on other sites

26 minutes ago, cfrag said:

If that static unit later also receives a dead event, so much the better, no skin off anyone's nose. Just invoke the dead event just prior to switching it to static.

 

That also will create issues, if a dead unit is dead twice, once as a unit and once as a static. I have scripts that monitor statics and scripts that monitor units, so that would create just as much of a headache as the current issue. I just want it to report a dead UNIT only. That's what was placed in ME or spawned in scripts, that's what I expect to see the event for.

12900K | MSI Z690 | STRIX RTX3090 | 64GB DDR4 3600MHz | NVMe Storage gen3 | Custom Loop | Valve Index

Link to comment
Share on other sites

53 minutes ago, Astronaut said:

That also will create issues, if a dead unit is dead twice, once as a unit and once as a static.

Actually, that's true - even with some of my own code under the current system where the statics 'inherit' the mob's name. I misspoke. So if new static objects replace the dead mob, they should be named differently, and ideally have a separate category tat identifies them as 'wreck' or similar when their death event is invoked.

  


Edited by cfrag
Link to comment
Share on other sites

I have a custom designed script that kept "drones" (S3-B) flying around, that began crashing the server recently due to reading a "nil" value for a destroyed unit/group health.  I tracked them every few seconds and queried the health of each aircraft and this worked fine for the past few years.  I added some dumps to my log to see what the aircraft table looked like, and it was full of data before the plane got hit and was missing afterwards, as though the plane never had existed.

To work around it, the order of testing would need to change, to assume that if the unit/group doesn't exist, then it has been destroyed.  I just don't know all the places I have script snips that can't be used without rework/retest.

I only tested the single unit S3-B groups, so I don't know how if other vehicle types are removed from tracking the same way, or if this is due to it being a single unit group.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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