DropWeapon

Moderator: GZDoom Developers

MDenham
Posts: 161
Joined: Sun Oct 14, 2007 2:23 am

Re: DropWeapon

Post by MDenham »

lizardcommando wrote:The dropweapon function fucks up if you try to drop a weapon while reloading.
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?)
User avatar
lizardcommando
Posts: 1489
Joined: Thu Sep 07, 2006 12:24 pm
Location: Boringland, California

Re: DropWeapon

Post by lizardcommando »

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.
MDenham
Posts: 161
Joined: Sun Oct 14, 2007 2:23 am

Re: DropWeapon

Post by MDenham »

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.
The thing is, that shouldn't be the sole determination for droppable weapons.

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.)
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: DropWeapon

Post by randi »

That's why there is an Undroppable flag.
User avatar
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

Post by Macil »

randy wrote:That's why there is an Undroppable flag.
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.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: DropWeapon

Post by Ghastly »

Agent ME wrote:
randy wrote:That's why there is an Undroppable flag.
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.
It doesn't. I've been able to drop it. :P
User avatar
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

Post by Macil »

I'm unable to drop it, either using "drop fist" or "weapdrop" while it's selected.
MDenham
Posts: 161
Joined: Sun Oct 14, 2007 2:23 am

Re: DropWeapon

Post by MDenham »

randy wrote:That's why there is an Undroppable flag.
I was pretty sure there must be something of the sort.

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

Re: DropWeapon

Post by lizardcommando »

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.
User avatar
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

Post by Macil »

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).
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Re: DropWeapon

Post by Ghastly »

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

However... That flag is for weapons and inventory items, so it might work.
MDenham
Posts: 161
Joined: Sun Oct 14, 2007 2:23 am

Re: DropWeapon

Post by MDenham »

Ghastly_dragon wrote:
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.
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).

However... That flag is for weapons and inventory items, so it might work.
If it doesn't, we have a legitimate new feature request to carry on from this. :-D
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: DropWeapon

Post by Graf Zahl »

... which will get WFDS'd as soon as it is spotted.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: DropWeapon

Post by Amuscaria »

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
MDenham
Posts: 161
Joined: Sun Oct 14, 2007 2:23 am

Re: DropWeapon

Post by MDenham »

Graf Zahl wrote:... which will get WFDS'd as soon as it is spotted.
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).
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”