ZScript: A way to detect if extreme death'd

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

ZScript: A way to detect if extreme death'd

Postby Major Cooke » Fri Jun 29, 2018 12:39 am

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.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: ZScript: A way to detect if extreme death'd

Postby Apeirogon » Fri Jun 29, 2018 3:24 am

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...
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: ZScript: A way to detect if extreme death'd

Postby Major Cooke » Fri Jun 29, 2018 10:06 am

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.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: ZScript: A way to detect if extreme death'd

Postby Matt » Fri Jun 29, 2018 11:28 am

I usually use if(health<-gibhealth)

As for specific types, could WorldThingDamaged + giving a dummy inventory item / spawning a thinker work?
User avatar
Matt
Putting the XD into *xdeath since 2007
 
 
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: ZScript: A way to detect if extreme death'd

Postby Apeirogon » Fri Jun 29, 2018 11:54 am

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.
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: ZScript: A way to detect if extreme death'd

Postby Marisa Kirisame » Sat Jun 30, 2018 6:30 am

Note that gibhealth is int.min unless directly specified in the actor defaults.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: ZScript: A way to detect if extreme death'd

Postby Lud » Sat Jun 30, 2018 8:07 am

Time to post this.
Lud
 
Joined: 11 Feb 2016

Re: ZScript: A way to detect if extreme death'd

Postby Matt » Sat Jun 30, 2018 4:09 pm

......why did I think this was in the scripting help board rather than feature suggestions
User avatar
Matt
Putting the XD into *xdeath since 2007
 
 
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: ZScript: A way to detect if extreme death'd

Postby Marisa Kirisame » Sat Jun 30, 2018 5:07 pm

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?
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Re: ZScript: A way to detect if extreme death'd

Postby Xaser » Sat Jun 30, 2018 5:59 pm

Marisa Kirisame wrote:Anyway, the idea of appending .Extreme to the damage might not be very good since it'd potentially break existing mods.

This would definitely break multiple things of mine.
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: ZScript: A way to detect if extreme death'd

Postby Matt » Sat Jun 30, 2018 6:14 pm

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.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
 
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: ZScript: A way to detect if extreme death'd

Postby Major Cooke » Sun Jul 01, 2018 7:50 am

Works too!
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: ZScript: A way to detect if extreme death'd

Postby Cacodemon345 » Thu Jul 12, 2018 4:35 am

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.
Cacodemon345
 
Joined: 22 Dec 2017
Discord: Cacodemon345#9151

Re: ZScript: A way to detect if extreme death'd

Postby Graf Zahl » Thu Jul 12, 2018 10:50 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Feature Suggestions

Who is online

Users browsing this forum: Google [Bot] and 1 guest