DropWeapon

Moderator: GZDoom Developers

User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

DropWeapon

Post by DBThanatos »

We have invdrop. But what about a key to drop the weapon that is in use at the moment the key is pressed?
User avatar
Remmirath
Posts: 2562
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

Re: DropWeapon

Post by Remmirath »

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.
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Re: DropWeapon

Post by DBThanatos »

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 :P)).
User avatar
Pure Hellspawn
Posts: 281
Joined: Sun Apr 24, 2005 6:06 pm
Location: RIT
Contact:

Re: DropWeapon

Post by Pure Hellspawn »

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 :P)).
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).

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.
User avatar
Medricel
Posts: 1138
Joined: Sat Nov 20, 2004 9:47 am

Re: DropWeapon

Post by Medricel »

Pure Hellspawn wrote:Aliases are very helpful in this regard.
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.
User avatar
bagheadspidey
Posts: 1490
Joined: Sat Oct 20, 2007 10:31 pm
Contact:

Re: DropWeapon

Post by bagheadspidey »

We have invdrop. But what about a key to drop the weapon that is in use at the moment the key is pressed?
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:

- 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 =/
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: DropWeapon

Post by XutaWoo »

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.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: DropWeapon

Post by HotWax »

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
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.
User avatar
Spleen
Posts: 497
Joined: Fri Nov 28, 2008 7:07 pm

Re: DropWeapon

Post by Spleen »

You could write an ACS script for it, and run it with whatever you are playing :p
User avatar
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

Post by Project Shadowcat »

Dropped weapons from the console do not drop ammo with it. In addition, the dropped weapon would carry 0 ammo.
User avatar
bagheadspidey
Posts: 1490
Joined: Sat Oct 20, 2007 10:31 pm
Contact:

Re: DropWeapon

Post by bagheadspidey »

Project Dark Fox wrote:Dropped weapons from the console do not drop ammo with it. In addition, the dropped weapon would carry 0 ammo.
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?

An ACS DropInventory equivalent to A_DropInventory would really be nice also... I wonder how easy that would be to do.
Karate Chris
Posts: 307
Joined: Wed Aug 23, 2006 7:58 am

Re: DropWeapon

Post by Karate Chris »

This patch allows use of a 'weapdrop' command to drop your ready weapon.

See attached.
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Re: DropWeapon

Post by DBThanatos »

Oh well, I dont know (yet) how to apply said patch :(

still, maybe chris would post this into the code submissions subforum? ;)
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Re: DropWeapon

Post by DBThanatos »

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?
User avatar
lizardcommando
Posts: 1489
Joined: Thu Sep 07, 2006 12:24 pm
Location: Boringland, California

Re: DropWeapon

Post by lizardcommando »

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.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”