ZScript: A way to detect if extreme death'd
Moderator: GZDoom Developers
- Major Cooke
- Posts: 8170
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
ZScript: A way to detect if extreme death'd
I'm having trouble finding a way to make monsters detect and drop items based on if they died extremely or not, but the thing is, I'm trying to avoid using xdeath states because not every monster has them. In order to maintain compatibility and affect all monsters from my mod and NOT from my mod alike, there seems to be no apparent way to do this and even checking for the damagetype is potentially folly.
I wonder, could "DamageTypeReceived" be appended with a ".Extreme" after it?
So if a rocket has a damagetype "Nunchuck" and it has the +EXTREMEDEATH flag, the DamageTypeReceived for the victim becomes "Nunchuck.Extreme" or something along those lines. That way people can tell if a monster died to extreme damage irregardless of having an xdeath state or not.
I wonder, could "DamageTypeReceived" be appended with a ".Extreme" after it?
So if a rocket has a damagetype "Nunchuck" and it has the +EXTREMEDEATH flag, the DamageTypeReceived for the victim becomes "Nunchuck.Extreme" or something along those lines. That way people can tell if a monster died to extreme damage irregardless of having an xdeath state or not.
Re: ZScript: A way to detect if extreme death'd
Checks, if projectile have "in gibs" flag, and if its true, check have monster more hp than attack, and if no return "send to home in a closed coffin", dont work?
That was a question...
That was a question...
- Major Cooke
- Posts: 8170
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: ZScript: A way to detect if extreme death'd
Using WorldThingDied does work, but some exceptions do occur such as if the inflictor is null. Missiles disappearing before the event can be called are a problem, especially in mods that have nothing to do with my own which can jack up the system.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: ZScript: A way to detect if extreme death'd
I usually use if(health<-gibhealth)
As for specific types, could WorldThingDamaged + giving a dummy inventory item / spawning a thinker work?
As for specific types, could WorldThingDamaged + giving a dummy inventory item / spawning a thinker work?
Re: ZScript: A way to detect if extreme death'd
You can forcibly extend life of projectile actor, by adding fev ticks to it (x)death state, to be sure that event can read informations from it, giving to projectile some inventory item.
- Marisa the Magician
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Re: ZScript: A way to detect if extreme death'd
Note that gibhealth is int.min unless directly specified in the actor defaults.
Re: ZScript: A way to detect if extreme death'd
Time to post this.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: ZScript: A way to detect if extreme death'd
......why did I think this was in the scripting help board rather than feature suggestions
- Marisa the Magician
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Re: ZScript: A way to detect if extreme death'd
Anyway, the idea of appending .Extreme to the damage might not be very good since it'd potentially break existing mods. You know, since we have a KILLED actor flag already, why not have a GIBBED one too?
Re: ZScript: A way to detect if extreme death'd
This would definitely break multiple things of mine.Marisa Kirisame wrote:Anyway, the idea of appending .Extreme to the damage might not be very good since it'd potentially break existing mods.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: ZScript: A way to detect if extreme death'd
I think a gibbed flag would be the cleanest, most easy to use and access solution.
Mucking around with more damage types and whatnot would probably break some things for me in the future even if they didn't now.
Mucking around with more damage types and whatnot would probably break some things for me in the future even if they didn't now.
- Major Cooke
- Posts: 8170
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
-
- Posts: 419
- Joined: Fri Dec 22, 2017 1:53 am
- Graphics Processor: ATI/AMD (Modern GZDoom)
- Contact:
Re: ZScript: A way to detect if extreme death'd
If the GIBBED flag's going to be implemented, make it so that it gets set before WorldThingDamaged is called, so that it works better. Otherwise, it is going to be less useful should the flag be set after WorldThingDied is called.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript: A way to detect if extreme death'd
It could only be set right before calling WorldThingDied. The act of damaging does not know anything about how the actor will die, only the act of dying itself can know.