Weapon upgrading

Moderator: GZDoom Developers

Post Reply
Asclepius
Posts: 2
Joined: Tue Apr 27, 2010 4:44 am

Weapon upgrading

Post by Asclepius »

Basically, a way to make it easier to create weapons which are intended to upgrade (i.e. replace) weaker weapons that the player possesses. For instance, let's say you want there to be 4 different types of pistol, with increasing damage. When the player finds a weaker pistol than the one he currently possesses, obviously we wouldn't want him to gain that weapon, and when he finds a stronger one, we want to get rid of the original, which is now obsolete and simply serves to clutter up the weapon slot. I propose this could be done with an "Upgradefor" property:

Upgradefor "Weapon1", "Weapon2", "Weapon3" etc

When a player picks up the weapon, he will automatically lose Weapon1, Weapon2 etc. In addition, as long as he has the weapon, should he find Weapon1 or Weapon2, etc, then picking them up will not give the player those weapons, only the ammo.
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: Weapon upgrading

Post by Amuscaria »

You can use a single weapon with multiple states (one for each upgrade) and then jump to the correct state based on an item you can pick up. Limit this item to 1, so you can't have multiples of them.

For example, you have 1 item for pistol1, pistol2, pistol 3, etc. Given you have pistol1 at the begining, you jump the the states which dictates the pistol for pistol1. Assuming pistol2 is meant to be stronger than pistol1, when you pick pistol2 up, you will jump to another state that dictates the behavior for pistol2. You can set up the subsequent items so that pistol2 gives both the item for pistol2 and pistol1. And that the higher level items have a higher priority when changing states so you skip over the weaker weapons. This should keep you from getting pistol2 when you already have pistol3, and so on.

There are obviously many ways to do this, this may not be the best way.

You can just have several weapons that has a higher weapon switch priority than the weapon ones.

Or that you can have custom pickup items that only gives you the weapon when you don't already have a better weapon.
User avatar
Zhs2
Posts: 1301
Joined: Fri Nov 07, 2008 3:29 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Maryland, USA, but probably also in someone's mod somewhere
Contact:

Re: Weapon upgrading

Post by Zhs2 »

Post Reply

Return to “Closed Feature Suggestions [GZDoom]”