DropWeapon

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: DropWeapon

Re: DropWeapon

by MDenham » Tue Feb 03, 2009 7:01 am

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

Re: DropWeapon

by Amuscaria » Tue Feb 03, 2009 6:49 am

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

by Graf Zahl » Tue Feb 03, 2009 5:38 am

... which will get WFDS'd as soon as it is spotted.

Re: DropWeapon

by MDenham » Tue Feb 03, 2009 5:19 am

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

Re: DropWeapon

by Ghastly » Mon Feb 02, 2009 9:31 pm

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.

Re: DropWeapon

by Macil » Mon Feb 02, 2009 9:20 pm

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

by lizardcommando » Mon Feb 02, 2009 8:46 pm

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.

Re: DropWeapon

by MDenham » Mon Feb 02, 2009 8:34 pm

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.

Re: DropWeapon

by Macil » Mon Feb 02, 2009 7:13 pm

I'm unable to drop it, either using "drop fist" or "weapdrop" while it's selected.

Re: DropWeapon

by Ghastly » Mon Feb 02, 2009 6:51 pm

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

Re: DropWeapon

by Macil » Mon Feb 02, 2009 6:40 pm

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.

Re: DropWeapon

by randi » Mon Feb 02, 2009 9:44 am

That's why there is an Undroppable flag.

Re: DropWeapon

by MDenham » Mon Feb 02, 2009 3:16 am

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

Re: DropWeapon

by lizardcommando » Mon Feb 02, 2009 2:54 am

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.

Re: DropWeapon

by MDenham » Mon Feb 02, 2009 2:23 am

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

Top