PowerWeaponLevel2/Powered_Up Question

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
DeadHeartProductions
Posts: 36
Joined: Sun Apr 09, 2023 10:49 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 7
Graphics Processor: Intel (Modern GZDoom)
Location: Eastern North Southlandia, West Side. Formerly NeoTerraNova

PowerWeaponLevel2/Powered_Up Question

Post by DeadHeartProductions »

Greetings, all. My thanks to anyone that stops by to answer and help. I'm having a small problem that I'm not sure I'm going about the right way.

In short, I would like to have two classes of Power Ups - one that has an effect on melee (increased damage), one that has an effect on weapons (faster reload speed).

I would think that to go about this, one would use the POWERED_UP state of a duplicate weapon, of course, but how do I differentiate between the two weapons? How do I tell the engine that Powerup A is only to affect the Melee Weapons, and Powerup B only to affect the firearms? Or am I not going about the other half of the equation - the weapons themselves - the right way, and I need to put the differentiation there instead?

Thank you to anyone who can offer some advice. I greatly appreciate your time for what seems to me to be a rather simple question.
Jarewill
 
 
Posts: 1854
Joined: Sun Jul 21, 2019 8:54 am

Re: PowerWeaponLevel2/Powered_Up Question

Post by Jarewill »

I think for your case it would be better to inherit your powerups from the base Powerup class and not PowerWeaponLevel2.
Then using A_JumpIfInventory in specific states you can jump to the powered up states (for example how it's presented in the last example here).
If you aren't planning on replacing the sprites, then this might be the best way as you would only need to do this jump in the melee's Fire state and the weapons' Reload state.
User avatar
DeadHeartProductions
Posts: 36
Joined: Sun Apr 09, 2023 10:49 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 7
Graphics Processor: Intel (Modern GZDoom)
Location: Eastern North Southlandia, West Side. Formerly NeoTerraNova

Re: PowerWeaponLevel2/Powered_Up Question

Post by DeadHeartProductions »

Sorry for the late reply. I see what you're saying. Thank you, that's perfect.
Post Reply

Return to “Scripting”