INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

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: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Slasher » Wed Sep 24, 2008 7:36 am

Looks completely broken? What do you mean?


Were they summoned weapons? Did you already have the weapon, and full ammo for that weapon? Also, did you test it with the map I sent you?

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Graf Zahl » Wed Sep 24, 2008 3:14 am

Slasher wrote:And it's not picking them up. I'm using GZDoom r180 to test this. Is this feature in that version? When I have the weapon, and full ammo for it, it just doesn't want to pick it up.
r180 should have it. But I tested it with the latest ZDoom and despite the fact that this thing looks like it's completely broken I could pick up any weapon I encountered.

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Slasher » Wed Sep 24, 2008 1:58 am

Nope, I just tried it again, with this DECORATE:

Code: Select all

ACTOR NewChainSaw : ChainSaw Replaces ChainSaw
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewShotgun : Shotgun Replaces Shotgun
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewSuperShotgun : SuperShotgun Replaces SuperShotgun
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewChaingun : Chaingun Replaces Chaingun
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewRocketLauncher : RocketLauncher Replaces RocketLauncher
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewPlasmaRifle : PlasmaRifle Replaces PlasmaRifle
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewBFG9000 : BFG9000 Replaces BFG9000
{
   +INVENTORY.ALWAYSPICKUP
}
And it's not picking them up. I'm using GZDoom r180 to test this. Is this feature in that version? When I have the weapon, and full ammo for it, it just doesn't want to pick it up.

Does it matter that I'm summoning these weapons with an ACS script?

Graf: I'll PM you the mod I'm making that uses this. I'd rather not display it to the public yet.

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Slasher » Wed Sep 24, 2008 1:44 am

Graf Zahl wrote:Works perfectly. Apparently you forgot to declare the 'replaces originalweapon'. If you summon these new weapons directly they will be picked up.
Oh oops! :oops: Yes, I see my mistake now. Thanks.

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Graf Zahl » Wed Sep 24, 2008 1:22 am

Works perfectly. Apparently you forgot to declare the 'replaces originalweapon'. If you summon these new weapons directly they will be picked up.

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Slasher » Tue Sep 23, 2008 5:25 pm

I'm bumping this because it's related to this thread. If you feel I should create a bug report, I shall.

@ Graf: You added this so the INVENTORY.ALWAYSPICKUP flag would allow for weapons to be picked up, no matter what. However, I just tried it with my project and it doesn't seem to work when you try picking up a weapon you already have, and have full ammo for. Is this a bug?

Here's my DECORATE lump:

Code: Select all

ACTOR NewChainSaw : ChainSaw
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewShotgun : Shotgun
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewSuperShotgun : SuperShotgun
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewChaingun : Chaingun
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewRocketLauncher : RocketLauncher
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewPlasmaRifle : PlasmaRifle
{
   +INVENTORY.ALWAYSPICKUP
}

ACTOR NewBFG9000 : BFG9000
{
   +INVENTORY.ALWAYSPICKUP
}

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Slasher » Mon Sep 15, 2008 3:37 am

Wow, cool. I had already set up the format that SnowKate had suggested, but since you added this, and it's less code, I might as well use it. :wink:

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Graf Zahl » Sat Sep 13, 2008 3:33 pm

Added. There was another problem in the TryPickup function and the fix for that made it very easy to have the ALWAYSPICKUP flag work for all inventory items.

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Graf Zahl » Mon Sep 08, 2008 3:01 am

In that case the CustomInventory method is the best thing to do. You won't want any of the special code that is there for handling the weapons' special needs and which made the WeaponGiver class necessary - because CustomInventory doesn't have it.

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Slasher » Mon Sep 08, 2008 1:34 am

Correct. Absolutely must not stay. Thanks for the help, I'll try it out.

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Kate » Mon Sep 08, 2008 1:33 am

If I understand correctly, yes. You won't want the weapon to stay in that case.

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Slasher » Mon Sep 08, 2008 1:26 am

This is basically what I want:

A random weapon is spawned. The player MUST pick it up, whatever it is, before anything else happens. They may already have this weapon, but they must pick it up if it is spawned.

So based on that information, your suggestion will work?

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Kate » Mon Sep 08, 2008 1:23 am

It will work fine in multiplayer, it just won't stay, as in when someone picks it up, it will go away forever unless respawning is on, then it will go away, and come back after a while. From what it sounds like, if you want the weapon to always be picked up you won't want it to stay anyway, otherwise it will have really bad consequences (infinite ammo, anyone?) so that will work fine.

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Slasher » Mon Sep 08, 2008 12:37 am

It must work in multiplayer, the project I'm working on is mainly for multiplayer...

Re: INVENTORY.ALWAYSPICKUP Doesn't work on Weapons

by Kate » Mon Sep 08, 2008 12:30 am

Use a [wiki=Classes:CustomInventory]CustomInventory[/wiki] item:

Code: Select all

actor FooGun: Weapon
{
    ... stuff
}

actor FooPickup: CustomInventory
{
    +INVENTORY.ALWAYSPICKUP
    States
    {
    Spawn:
        FOOG A -1
        Stop
    Pickup:
        TNT1 A 0 A_GiveInventory ("FooGun", 1)
        Stop
    }
}
It won't stay in multiplayer, however.

Top