[No] Add BT_NEXTWEAPON & BT_PREVWEAPON

Moderator: GZDoom Developers

Add BT_NEXTWEAPON & BT_PREVWEAPON

Postby Molly Greendale » Sun Dec 30, 2018 5:21 pm

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.
Molly Greendale
 

Re: Add BT_NEXTWEAPON & BT_PREVWEAPON

Postby Arctangent » Sun Dec 30, 2018 5:58 pm

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.
User avatar
Arctangent
squawky
 
Joined: 06 Nov 2014
Discord: SquawkyAtan#2371

Re: Add BT_NEXTWEAPON & BT_PREVWEAPON

Postby Molly Greendale » Sun Dec 30, 2018 6:11 pm

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.
Molly Greendale
 


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests