DropWeapon
Moderator: GZDoom Developers
- DBThanatos
- Posts: 3101
- Joined: Fri Apr 14, 2006 3:17 pm
- Location: in "the darkness that lurks in our mind"
DropWeapon
We have invdrop. But what about a key to drop the weapon that is in use at the moment the key is pressed?
- Remmirath
- Posts: 2562
- Joined: Sun Dec 23, 2007 3:53 am
- Graphics Processor: nVidia with Vulkan support
- Location: My house
- Contact:
Re: DropWeapon
Type bind k "drop shotgun" in the console.
You can do this for all the weapons you want.
Could be a good feature suggestion, though, because we can't drop the weapon currently in use.
You can do this for all the weapons you want.
Could be a good feature suggestion, though, because we can't drop the weapon currently in use.
- DBThanatos
- Posts: 3101
- Joined: Fri Apr 14, 2006 3:17 pm
- Location: in "the darkness that lurks in our mind"
Re: DropWeapon
The problem with specific bindings, is that in doom2 alone you would need to bind 8 different keys to drop the weapons. Now, it doesnt help much with weapon mods, even with small ones. If you dont know the name of the weapon, you need to look for it's actor name in order to do the binding (if that word exist (I believe so
)).

- Pure Hellspawn
- Posts: 281
- Joined: Sun Apr 24, 2005 6:06 pm
- Location: RIT
- Contact:
Re: DropWeapon
You could try using aliases. I once remember doing an experiment with the Icon of Sin to see if I could survive a telefrag (which you can if and only if you have more than 1,000,000 hp).DBThanatos wrote:The problem with specific bindings, is that in doom2 alone you would need to bind 8 different keys to drop the weapons. Now, it doesnt help much with weapon mods, even with small ones. If you dont know the name of the weapon, you need to look for it's actor name in order to do the binding (if that word exist (I believe so)).
Here's what I did:
alias f give health 999
bind p f;f;f;f;f;f;f;f;f;f;f;f;f;f;f;f;f;f;f;f ...
What I think you could do is as follows:
alias a "drop chainsaw"
alias b "drop pistol"
alias c "drop supershotgun"
alias d "drop shotgun"
alias e "drop chaingun"
alias f" drop rocketlauncher"
alias g" drop plasmarifle"
alias h" drop bfg9000"
bind d a;b;c;d;e;f;g;h
Aliases are very helpful in this regard.
Re: DropWeapon
Considering whose asking the question, I have a feeling DBT might be wanting such a feature for mods that have very many weapons (AEoD, anyone?). That's far too many to set up individual binds to drop without going some factor of insane.Pure Hellspawn wrote:Aliases are very helpful in this regard.
- bagheadspidey
- Posts: 1490
- Joined: Sat Oct 20, 2007 10:31 pm
- Contact:
Re: DropWeapon
Is this really possible to do in a generic way that doesn't give the player the ability to keep dropping / picking up a weapon to gain more and more ammo? I'm not sure this is possible to do. Here's why:We have invdrop. But what about a key to drop the weapon that is in use at the moment the key is pressed?
- If the weapon is dropped and no ammo is removed, the player can pick it up again to gain AmmoGive ammo.
- If the weapon is dropped and AmmoGive ammo is removed from player's inventory, that's a little better... but any time the player has less than AmmoGive ammo, he can drop the weapon and pick it up again to restore some ammo.
- If a weapon with no ammo is dropped and all ammo stays in player's inventory, a new weapon inherited from the real weapon with AmmoGive 0 would have to somehow be created on the fly.
Basically there are so many weird corner cases here I'm not sure it could really be done, but I think if you want it to be seriously considered you should explain how the ammo issue could be addressed in a generic enough way for this to work with all weapons. Unless you just want the weapon to be dropped and let modders worry about the ammo thing themselves... but that much is pretty easy to do with acs. Just list all the weapons in an array, loop through it calling checkweapon against each one, and when checkweapon returns true "throw" that weapon using SpawnProjectile and remove it from the inventory.
PS - I know I did a demo mod addon thing to magnum opus that does address the ammo issue, but it uses invisible ammo hacks to work =/
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Re: DropWeapon
You could make a KEYCONF inventory hack that gives you a token item which causes you to throw your weapon (actually a projectile so you don't pick it up right away) and then the projectile spawns a [wiki]Classes:WeaponGiver[/wiki] that gives no ammo.
Re: DropWeapon
Uhh... You do know that would drop every weapon the player is carrying right? The OP was asking for a way to drop only what the player is currently using.Pure Hellspawn wrote:What I think you could do is as follows:
alias a "drop chainsaw"
alias b "drop pistol"
alias c "drop supershotgun"
alias d "drop shotgun"
alias e "drop chaingun"
alias f" drop rocketlauncher"
alias g" drop plasmarifle"
alias h" drop bfg9000"
bind d a;b;c;d;e;f;g;h
Re: DropWeapon
You could write an ACS script for it, and run it with whatever you are playing 

- Project Shadowcat
- Posts: 9369
- Joined: Thu Jul 14, 2005 8:33 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: Blacksburg, SC USA
- Contact:
Re: DropWeapon
Dropped weapons from the console do not drop ammo with it. In addition, the dropped weapon would carry 0 ammo.
- bagheadspidey
- Posts: 1490
- Joined: Sat Oct 20, 2007 10:31 pm
- Contact:
Re: DropWeapon
hmm, I didn't realize that. In that case it sounds like a lot of the stuff I was talking about above has already been handled. I wonder if the same thing applies to stuff dropped with A_DropInventory?Project Dark Fox wrote:Dropped weapons from the console do not drop ammo with it. In addition, the dropped weapon would carry 0 ammo.
An ACS DropInventory equivalent to A_DropInventory would really be nice also... I wonder how easy that would be to do.
-
- Posts: 307
- Joined: Wed Aug 23, 2006 7:58 am
Re: DropWeapon
This patch allows use of a 'weapdrop' command to drop your ready weapon.
See attached.
See attached.
- DBThanatos
- Posts: 3101
- Joined: Fri Apr 14, 2006 3:17 pm
- Location: in "the darkness that lurks in our mind"
Re: DropWeapon
Oh well, I dont know (yet) how to apply said patch 
still, maybe chris would post this into the code submissions subforum?

still, maybe chris would post this into the code submissions subforum?

- DBThanatos
- Posts: 3101
- Joined: Fri Apr 14, 2006 3:17 pm
- Location: in "the darkness that lurks in our mind"
Re: DropWeapon
Sorry for the bump, but I just noticed that this thread was moved into this forum. I wonder if the weapdrop works. Have anyone tried it?
- lizardcommando
- Posts: 1489
- Joined: Thu Sep 07, 2006 12:24 pm
- Location: Boringland, California
Re: DropWeapon
I tested the dropweapon function with my mod for a little bit. It works as far as I can tell.
The dropweapon function fucks up if you try to drop a weapon while reloading. For example, in my mod, if you try to drop a weapon while reloading the Akimbo SMGS or the Infantry rifle, it'll just spawn the weapon's pickup sprites. You won't be able to pick it up. You can spawn as much as you want. It won't do that with the 9MM pistol though. I'm guessing it could do with the fact that the reloading animation is pretty long. That might not be the problem, but who knows.
I tested the dropweapon function with the default Doom weapons and it works perfectly. I haven't tried this with any other mods yet.
The dropweapon function fucks up if you try to drop a weapon while reloading. For example, in my mod, if you try to drop a weapon while reloading the Akimbo SMGS or the Infantry rifle, it'll just spawn the weapon's pickup sprites. You won't be able to pick it up. You can spawn as much as you want. It won't do that with the 9MM pistol though. I'm guessing it could do with the fact that the reloading animation is pretty long. That might not be the problem, but who knows.
I tested the dropweapon function with the default Doom weapons and it works perfectly. I haven't tried this with any other mods yet.