This could be solved by allowing people to set whether or not a weapon is droppable; you'd turn that off at the beginning of a reload, and back on at the end. (Some weapons, like the fists, obviously ought to have that flag permanently off. Seriously, dropping your fists?)lizardcommando wrote:The dropweapon function fucks up if you try to drop a weapon while reloading.
DropWeapon
Moderator: GZDoom Developers
Re: DropWeapon
- lizardcommando
- Posts: 1489
- Joined: Thu Sep 07, 2006 12:24 pm
- Location: Boringland, California
Re: DropWeapon
I figured that deciding which weapon is droppable or not depends on whether or not it has a SPAWN state defined. For example, I didn't add one for my starting pistol in my mod, but I went back and put in a SPAWN state and I tested it again and it works.
Now, I went back to play around with the dropweapon key again and it still fucks up when I try to drop certain weapons. In my case, it would be the Infantry Rifle that fucks up when I try to use the dropweapon command. Now, the weird thing is that if I summon that weapon through the console or give me a weapon through the console, the dropweapon command won't fuck up. Maybe it's because of my shoddy DECORATE coding or something. I'm not really sure.
Now, I went back to play around with the dropweapon key again and it still fucks up when I try to drop certain weapons. In my case, it would be the Infantry Rifle that fucks up when I try to use the dropweapon command. Now, the weird thing is that if I summon that weapon through the console or give me a weapon through the console, the dropweapon command won't fuck up. Maybe it's because of my shoddy DECORATE coding or something. I'm not really sure.
Re: DropWeapon
The thing is, that shouldn't be the sole determination for droppable weapons.lizardcommando wrote:I figured that deciding which weapon is droppable or not depends on whether or not it has a SPAWN state defined. For example, I didn't add one for my starting pistol in my mod, but I went back and put in a SPAWN state and I tested it again and it works.
Let's take, as an example, a weapon whose function would solely be to permanently upgrade the fists (call it "muscle implants" if you like). As an item that can be collected, but that makes no sense to drop once "installed", it should have a Spawn state but not be droppable. (The reverse - droppable, but without a Spawn state - only makes sense for ephemeral weapons that basically vanish when dropped.)
Re: DropWeapon
That's why there is an Undroppable flag.
- Macil
- Posts: 2529
- Joined: Mon Mar 22, 2004 7:00 pm
- Preferred Pronouns: He/Him
- Location: California, USA. Previously known as "Agent ME".
- Contact:
Re: DropWeapon
How does the [wiki=Classes:Fist]Fist[/wiki] weapon stop the player from dropping it? I just checked and it doesn't use the INVENTORY.UNDROPPABLE flag.randy wrote:That's why there is an Undroppable flag.
Re: DropWeapon
It doesn't. I've been able to drop it.Agent ME wrote:How does the [wiki=Classes:Fist]Fist[/wiki] weapon stop the player from dropping it? I just checked and it doesn't use the INVENTORY.UNDROPPABLE flag.randy wrote:That's why there is an Undroppable flag.

- Macil
- Posts: 2529
- Joined: Mon Mar 22, 2004 7:00 pm
- Preferred Pronouns: He/Him
- Location: California, USA. Previously known as "Agent ME".
- Contact:
Re: DropWeapon
I'm unable to drop it, either using "drop fist" or "weapdrop" while it's selected.
Re: DropWeapon
I was pretty sure there must be something of the sort.randy wrote:That's why there is an Undroppable flag.
So, the solution to lizardcommando's problem:
Add two 0-duration parts to the reload - one with A_ChangeFlag("INVENTORY.UNDROPPABLE", 1) at the beginning, and one with the same, only 0 instead of 1, at the end. The weapon now cannot be dropped while reloading, assuming this is handled properly.
- lizardcommando
- Posts: 1489
- Joined: Thu Sep 07, 2006 12:24 pm
- Location: Boringland, California
Re: DropWeapon
I don't think that's what is causing the problem. I tried to drop the Infantry Rifle when I was just standing in one spot, not reloading or shooting or moving or anything, and it still fucks up like how I described it earlier. The odd thing is that if I use IDFA/IDKFA cheat or summon/give console cheats, I am able to drop this weapon without any problem.
- Macil
- Posts: 2529
- Joined: Mon Mar 22, 2004 7:00 pm
- Preferred Pronouns: He/Him
- Location: California, USA. Previously known as "Agent ME".
- Contact:
Re: DropWeapon
Sounds like some sort of problem with the weapon code itself. I don't think there's anything special about the weapon after being dropped as opposed to just being spawned (other than the dropped flag and maybe ammo difference).
Re: DropWeapon
I'm not sure that'd work. A_ChangeFlag, A_SetTranslucent, and similar functions assume it was the player that called the function (thus, flags are changed on the player, not the weapon).MDenham wrote:Add two 0-duration parts to the reload - one with A_ChangeFlag("INVENTORY.UNDROPPABLE", 1) at the beginning, and one with the same, only 0 instead of 1, at the end.
However... That flag is for weapons and inventory items, so it might work.
Re: DropWeapon
If it doesn't, we have a legitimate new feature request to carry on from this.Ghastly_dragon wrote:I'm not sure that'd work. A_ChangeFlag, A_SetTranslucent, and similar functions assume it was the player that called the function (thus, flags are changed on the player, not the weapon).MDenham wrote:Add two 0-duration parts to the reload - one with A_ChangeFlag("INVENTORY.UNDROPPABLE", 1) at the beginning, and one with the same, only 0 instead of 1, at the end.
However... That flag is for weapons and inventory items, so it might work.

- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: DropWeapon
... which will get WFDS'd as soon as it is spotted.
Re: DropWeapon
How flexible is DoomScript supposed to be? I'm getting the idea that I could pretty much rewrite the entire game from scratch and then load it in real time without compiling. O_o
Re: DropWeapon
Depends; I might actually write up a code submission for that (I mean, I almost said feature suggestion/bug report at first, as for the INVENTORY.* flags, it's pretty obviously not supposed to be applied to the player, and then figured "you know, it's closer to a new feature", which was probably wrong anyway).Graf Zahl wrote:... which will get WFDS'd as soon as it is spotted.