Make Ghost enemies immune to splash damage.

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!)
Post Reply
User avatar
Doominer441
Posts: 200
Joined: Thu Oct 24, 2013 9:04 pm

Make Ghost enemies immune to splash damage.

Post by Doominer441 »

Hello, I was wondering if there was a way to prevent +THRUGHOST flagged actors from being harmed by splash damage. In my mod I want there to be only one weapon which can harm ghost enemies, but my explosive weapon seems to still hurt them, throwing off the entire gameplay dynamic I'm trying to create. I've looked but there doesn't seem to be a flag or parameter to pass which stops this from happening. Am I just overlooking something or am I shit out of luck?
peewee_RotA
Posts: 382
Joined: Fri Feb 07, 2014 6:45 am

Re: Make Ghost enemies immune to splash damage.

Post by peewee_RotA »

Can you just set +NORADIUSDMG?

If you can't change the actors, you could always do this in a world event when they spawn

Something like

Code: Select all

class GhostSpawnerEventHandler: EventHandler
{
    override void WorldThingSpawned(WorldEvent e)
    {        
        // Check that the Actor is valid and a monster
        if (e.thing)
        {
            if (e.thing.bIsMonster)
            {
                if (e.thing.bGHOST)
                {
                	e.thing.bNORADIUSDMG = true;
                }
            }
        }
    }
}
Make sure you register the event handler in mapinfo

Code: Select all

gameinfo
{
	// ...
	AddEventHandlers = "BossMakerEventHandler"
}
Post Reply

Return to “Scripting”