Any way to change NOALERT flag during gameplay?

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
22alpha22
Posts: 308
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Any way to change NOALERT flag during gameplay?

Post by 22alpha22 »

I was working on the silencer for my Quake II project and was trying to figure out the best way to make a weapon quieter and not alert monsters when the powerup is active. I found the "A_ChangeFlag" action function and figured I could use it to set the weapon's "NOALERT" flag to true when the powerup was active, but ZDoom tells me that the flag is unknown. I figured out an alternate means of achieving the silencer effect for most of the weapons, but it wont work for the machinegun, chaingun, and hyperblaster. For these, the only way I can think of to get the silencer effect is if I can change the NOALERT flag during game play. Can this be done, or do I need to use some hacky ACS to achive the desired effect?
User avatar
Enjay
 
 
Posts: 26962
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Any way to change NOALERT flag during gameplay?

Post by Enjay »

I hope there is a better way to do this but the following might work:

Have all relevant weapons have the +NOALERT flag.
In the firing state sequence, have an inventory check that jumps past the next frame if true.
The next frame would call A_AlertMonsters.
The powerup would give the item that causes the inventory check to jump past the call to A_AlertMonsters.
User avatar
22alpha22
Posts: 308
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Re: Any way to change NOALERT flag during gameplay?

Post by 22alpha22 »

That is exactly the workaround I used for the other weapons.
Spoiler:
Unfortunately, I don't see how this will work with weapons with complex "HOLD" firing states like the chaingun.
Spoiler:
EDIT:
I've just completed a hacky and messy ACS implementation of the silencer for the machinegun by duplicating the machinegun with a silenced version and using ACS to switch to it when the silencer is active.
Spoiler:
Unless anyone knows of a better way to do this, I'm gonna do this for the chaingun and hyperblaster as well.
Last edited by 22alpha22 on Sun Nov 23, 2014 5:02 am, edited 3 times in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Any way to change NOALERT flag during gameplay?

Post by Graf Zahl »

Frankly, the only viable option I see would be to add a PowerSilencer powerup that not only disables alerting monsters but also reduces the weapon's sounds (i.e. anything being played on CHAN_WEAPON.)
User avatar
22alpha22
Posts: 308
Joined: Fri Feb 21, 2014 5:04 pm
Graphics Processor: nVidia with Vulkan support
Location: Montana, USA

Re: Any way to change NOALERT flag during gameplay?

Post by 22alpha22 »

Graf Zahl wrote:Frankly, the only viable option I see would be to add a PowerSilencer powerup that not only disables alerting monsters but also reduces the weapon's sounds (i.e. anything being played on CHAN_WEAPON.)
Well than, until such a feature can be implemented, I'll have to go with messy ACS. Its breakable and doesn't feel authentic to Quake II. Oh well, this sucks. :(
User avatar
Enjay
 
 
Posts: 26962
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Any way to change NOALERT flag during gameplay?

Post by Enjay »

22alpha22 wrote:Well than, until such a feature can be implemented...
It would be a good idea to post about this in the Features Suggestion forum. At least then it would be part of the suggestions list.
Locked

Return to “Editing (Archive)”