Invulnberabilities conflicting?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Invulnberabilities conflicting?

Post by Ed the Bat »

This is a bit of an extraneous circumstance, but it does affect me to a small degree so I figure it can't hurt to ask about it...

If a player is carrying an invulnerability power, and then an ACS command like this is called:

Code: Select all

 SetPlayerProperty(1,2,PROP_INVULNERABILITY)
...the player will become vulnerable again when the power they were carrying runs out.

My question is, was this intended? Or should I consider this a bug?
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Invulnberabilities conflicting?

Post by Ed the Bat »

UPDATE:
I'm finding that this issue also crops up if a player picks up two different powerups that inherit from PowerInvulnerable. When one of them wears off, the player will no longer be impervious to harm, even though effects such as ColorMap would still be active on any live powerups. This sounds like a bug to me...
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Invulnberabilities conflicting?

Post by FDARI »

I'm not sure to what extent multiple equal powerups are supported, although I know that some powerup types let you specify behaviours, such as merging two powerups into one with either greater duration or greater power.

Are you providing the powerups through powerupgiver, or as raw powerups? (You're mostly supposed to go by powerupgiver I think.)

They probably all use the invulnerability-flag.

It is probably possible to check for the presence of invulnerability-derived powerups when unsetting the flag, but I think it will be really hard to prevent the powerup from unsetting an invulnerability flag that has been set through ACS; you'd need an extra flag for that.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Invulnberabilities conflicting?

Post by Ed the Bat »

That's a good point... These ones are being given in unusual ways. One of them is given by firing a weapon! =O The other one is given by a CustomInventory. I would normally use PowerupGiver, but I needed some other stuff to happen upon pickup that only CustomInventory could do. Hmm... maybe I can create some PowerupGivers and have those given by the weapon and the CustomInventory -- add another layer of complexity for the sake of proper functionality?
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: Invulnberabilities conflicting?

Post by FDARI »

Just to see if it makes a difference, I think. In this case it might not, but it is worth investigating. Also, if it works, it is probably "the right way".
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Invulnberabilities conflicting?

Post by Ed the Bat »

Didn't seem to change things. So like you said, there might be only one flag being checked on my player for invulnerability. I suppose it's just gonna be one of those things to be careful about for the time being.

Thanks for your input, as always!
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Invulnberabilities conflicting?

Post by Gez »

There are two kinds of powerups: that that have ownership of their effect, and those that merely change something in the player.

For example, damage reduction has an effect: when you take damage, the damage code will pass the damage you took through each of your damage protection powerups and each will get to reduce damage. I think I broke my record for amount of the word "damage" used in a single sentence.

That approach makes them work flawlessly when multiple similar powerups are used.

But those that merely change something in the player will tend to be of the form "I'm giving this to you when I start working, I'm taking it away when I stop". This had some problems. For example, this has been fixed some times ago (in 2.4.0 or 2.5.0 I think) but you could have a "partially invisible" player class. That player could pick a partial invisibility sphere, and once that powerup expired, would become fully visible as it never was before.
Locked

Return to “Editing (Archive)”