creating a powerup that removes the existing powerup color

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!)
ahmehmet
Posts: 2
Joined: Sat Feb 19, 2022 2:30 pm
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

creating a powerup that removes the existing powerup color

Post by ahmehmet »

Hello, i'm quite new here. So i hope i'm doing nothing wrong and what i am saying is understandable. (I know my English isn't that good)
When you grab a powerup which has a powerup color, it changes the color of your screen and what i want to do is creating a new powerup (or custominventory) that removes those colors. But the effects of the powerup should remain. So removing the powerup itself isn't the thing that i want. For example if i grab this thing after grabbing an invulnerabilitysphere and radsuit i should be invulnerable and (almost) immune to damaging floors but the screen color should be the default one not white or green. Can i do that?
malon3
Posts: 103
Joined: Fri Dec 26, 2008 4:41 pm

Re: creating a powerup that removes the existing powerup col

Post by malon3 »

Code: Select all

ACTOR InvulnerabilitySphere : PowerupGiver
{
  +COUNTITEM
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.BIGPOWERUP
  Inventory.MaxAmount 0
  Powerup.Type "Invulnerable"
  Powerup.Color InverseMap
  Inventory.PickupMessage "$GOTINVUL" // "Invulnerability!"
  States
  {
  Spawn:
    PINV ABCD 6 Bright
    Loop
  }
}
there's a section called "powerup.color" just remove that
ahmehmet
Posts: 2
Joined: Sat Feb 19, 2022 2:30 pm
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia (Modern GZDoom)

Re: creating a powerup that removes the existing powerup col

Post by ahmehmet »

I think you get me wrong. You are just altering the Invuln to a non-colored version. What I want is creating a new powerup which deletes its colormap. let's call this powerup as colorresettersphere. Invuln should be the same as it is, but if I grab a colorresettersphere after grabbing an invuln, it should clear the colormap of it. (but only the color, I should still be invulnerable till the powerup duration expires.) If no colorresettersphere grabbed at all, invuln should look the same as it is now. (InverseMap). Lastly, even if I grab a colorresettersphere after grabbing more powerups than one, it should work just as the same. (It should delete all the colormaps of the powerups that I have.)

Return to “Scripting”