Holster Weapon

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Zenon
Posts: 534
Joined: Thu Apr 20, 2006 6:05 pm
Graphics Processor: nVidia with Vulkan support
Location: New Zealand

Holster Weapon

Post by Zenon »

Just thought it would be a neat idea to have a holster weapon function
It could be implemented someway in a mod or something

On an unrelated note, does anybody else find it awkward talking to a friendly NPC while holding a gun up to their face?
Spoiler:
User avatar
Rachael
Posts: 13608
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Holster Weapon

Post by Rachael »

I think the best way to do this is to have a "null weapon" which can be defined by the mod, itself. I am not sure how much merit this would really have as an engine feature.
User avatar
AFADoomer
Posts: 1334
Joined: Tue Jul 15, 2003 4:18 pm

Re: Holster Weapon

Post by AFADoomer »

We use something like this in Blade of Agony:

Code: Select all

class NullWeapon : Weapon
{
    Default
    {
        +INVENTORY.UNDROPPABLE
        +WEAPON.NOALERT
        Weapon.SelectionOrder 99999; // Make this absolutely last in weapon priority
    }

    States
    {
        Select:
            TNT1 A 1 A_Raise;
            Loop;
        Deselect:
            TNT1 A 1 A_Lower;
            Loop;
        Fire:
        Ready:
            TNT1 A 1 A_WeaponReady(WRF_NOFIRE);
            Loop;
    }
} 
(ours has some extra handling built in, but this is the core part that does what you're asking about)

Then, in the player class, we have it assigned to weapon slot 0. So pressing zero, or switching to NullWeapon in ACS lowers your weapon.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Holster Weapon

Post by Marisa the Magician »

Actually, just setting the owner's pending weapon to null works too.
User avatar
AFADoomer
Posts: 1334
Joined: Tue Jul 15, 2003 4:18 pm

Re: Holster Weapon

Post by AFADoomer »

Good point. That would be far easier.

Does that allow the player to switch back to another weapon, though? It's been a while since I checked, so I could be mis-remembering, but I thought that caused issues with weapon switching...
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia

Re: Holster Weapon

Post by Marisa the Magician »

Yes, it does.

Return to “Feature Suggestions [GZDoom]”