Changing WeaponReady flags

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
andreboomer
Posts: 21
Joined: Wed Feb 16, 2022 9:04 pm
Graphics Processor: nVidia with Vulkan support

Changing WeaponReady flags

Post by andreboomer »

I have figured out how easy it is to change flags through null checking. But for example, a WeaponReady flag is not identified through the method:
TNT1 A 0
{
invoker.BALLOWZOOM = true;
}
Which I'm guessing is due to Allow Zoom being attached to the A_WeaponReady(); function. Is there a way I can manipulate these flags depending on a player's inventory?
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Changing WeaponReady flags

Post by Blue Shadow »

Code: Select all

Ready:
    BLAH A 1
    {
        int wrflags = 0;
        if (FindInventory("BlueCard") wrflags |= WRF_ALLOWRELOAD;
        A_WeaponReady(wrflags);
    }
    Loop; 
If the player has a blue keycard in the inventory, the Reload state sequence is entered if the reload key is pressed.
Guest

Re: Changing WeaponReady flags

Post by Guest »

Thanks for the reply. One more thing, how could I do the same thing but instead of with inventory through getplayer input?
Also, would this need to become a virtual function? If I were to implement this?
Post Reply

Return to “Scripting”