Damage type help

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
powerup1
Posts: 6
Joined: Fri Dec 23, 2022 2:19 pm
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)

Damage type help

Post by powerup1 »

I'm making a fire death script

Code: Select all

[code]Class FlamerHandler : EventHandler
{
    Override void WorldThingDied(WorldEvent e)
    {
        If(e.Inflictor&&e.Inflictor.DamageType == "Fire" || e.inflictor is "ExplosiveBarrel")
        {
			e.Thing.GiveInventory("FireDeathEffect",1);
        }
    }
}
but some mods have weapons/projectile with their own type of fire damage that doesn't get picked up by my code

Code: Select all

class SnailFlames : Actor
{
	Default
	{
		Radius 8;
		Height 8;
		Speed 0;
		DamageFunction (0);
		Projectile;
		+RANDOMIZE
		+BLOODLESSIMPACT
		+RIPPER
		+NOBLOOD
		-SOLID
		+FORCERADIUSDMG
		+THRUACTORS
		+ROLLSPRITE
		+FORCEXYBILLBOARD;
		BounceType "Hexen";
		BounceFactor 0.5;
		RenderStyle "Add";
		Alpha 1;
		Scale 0.4;
		DamageType "FlameFire";
is there a way I can modify my code to include any DamageType that has the word "Fire" in it instead of only one DamageType that's specifically called "Fire"?
User avatar
Laskow
Posts: 84
Joined: Tue Feb 16, 2021 7:35 am
Preferred Pronouns: He/Him

Re: Damage type help

Post by Laskow »

WorldThingDied cannot check the damage type. My old posts might help you. viewtopic.php?t=73516
powerup1
Posts: 6
Joined: Fri Dec 23, 2022 2:19 pm
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)

Re: Damage type help

Post by powerup1 »

works fine for me, its just that I wanted to add more DamageTypes without cluttering up the line

Return to “Scripting”