Force Players to have only 2 Weapons

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
blood
Posts: 139
Joined: Thu Aug 25, 2011 3:17 pm

Force Players to have only 2 Weapons

Post by blood »

Hi there, I'm looking for a way to force player to have only 2 weapons, like it is in other popular FPS games, I really don't know how it's possible, so if any of you got an idea, send it here, thanks !
RaveYard
Posts: 198
Joined: Fri Apr 12, 2013 10:51 am

Re: Force Players to have only 2 Weapons

Post by RaveYard »

Here is an idea I had for two years.

All weapon pickups would be replaced with "CustomInventory" objects that would give you the actual weapon and then it would activate a script which would count all the weapons you have.
If you have max limit of weapons then the script gives player some kind of inventory which would then be used in the customInventory to prevent player from picking up more weapons.

Ofcourse, this would also prevent picking up weapons for ammo when you hit limit of weapons, so you have to check if you have any other weapon which uses same ammo type as the weapon you are trying to pick.
User avatar
Athel
Posts: 777
Joined: Wed Aug 21, 2013 11:31 am
Location: New Jersey

Re: Force Players to have only 2 Weapons

Post by Athel »

^Ninja'd! :-(, EDIT: though his way would have worked better but still.

Make a new player class (or replace your existing player class) and have it only use two weapon slots. For instance, in your case it would be:

Code: Select all

Actor ModernDoomPlayer: DoomPlayer replaces DoomPlayer
{
Player.WeaponSlot 1, "Fist"
Player.WeaponSlot 2, "Shotgun"
Player.StartItem "Fist", 1
}
This makes the player start with his fist, and limits him to his fist and shotgun.
This would make the player have two weapons, his fist and his shotgun.

Now, if you want it to switch weapons (I hope so), I believe you'dhave to use dummy items. MMy method is a cheap way and others will work much better, but this is an idea.
blood
Posts: 139
Joined: Thu Aug 25, 2011 3:17 pm

Re: Force Players to have only 2 Weapons

Post by blood »

I checked all mode that used weapons with that way, and of course it would use too much coding for the simple mode I'm doing, I prefer to forgot it, thanks for the help.
User avatar
belcrane
Posts: 1
Joined: Tue May 26, 2015 7:18 am

Re: Force Players to have only 2 Weapons

Post by belcrane »

I think that would be a good idea because it would make the game fair and easy.
Locked

Return to “Editing (Archive)”