Add BT_NEXTWEAPON & BT_PREVWEAPON

Moderator: GZDoom Developers

Post Reply
Guest

Add BT_NEXTWEAPON & BT_PREVWEAPON

Post by Guest »

Right now, if there are no other weapons in the player's inventory, modders are kinda out of luck if they want to do something on (attempted) weapon switching. Deselect/Select states aren't entered and none of the related Get*State virtuals are called. One solution would be to add BT_NEXTWEAPON and BT_PREVWEAPON for player.cmd.buttons, if possible. That would also help a lot with mode selection menus that rely on BT_ATTACK/BT_ALTATTACK or BT_ZOOM/BT_RELOAD for cycling left/right respectively, since I assume most people have their mouse's scroll wheel bound to switch weapons.
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: Add BT_NEXTWEAPON & BT_PREVWEAPON

Post by Arctangent »

Weapon selection stuff doesn't actually exist as inputs to the actual playsim - weapons are actually selected entirely by "using" them as items, and both these keys and the weapon slot system are just user-friendly abstractions that're handled and translated before the playsim even gets your input.

If that's a bit confusing, keep in mind that singleplayer, netplay, and demos are all basically the same to the playsim, and the latter two require sending inputs over a network and saving them as permanent data, respectively. So, the input system is separate from the playsim so that the more complicated inputs can be processed ( in the sense of being capped, translated, etc. rather than, say, giving the player the appropriate amount of velocity - that's something the playsim has to handle no matter what ) before being sent, rather than after - since that means only the initial machine has to do that processing, rather than every machine in the netgame or that's playing the demo.
Guest

Re: Add BT_NEXTWEAPON & BT_PREVWEAPON

Post by Guest »

Think I got it. Thanks. I may have found a way to manipulate a weapon via PickNextWeapon()/PickPrevWeapon() on the player, but I'll save that as a last resort hack. That seems to be called when switching even if there's nothing to switch to.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”