Add BT_NEXTWEAPON & BT_PREVWEAPON

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: Add BT_NEXTWEAPON & BT_PREVWEAPON

Re: Add BT_NEXTWEAPON & BT_PREVWEAPON

by Guest » Sun Dec 30, 2018 5: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.

Re: Add BT_NEXTWEAPON & BT_PREVWEAPON

by Arctangent » Sun Dec 30, 2018 4: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.

Add BT_NEXTWEAPON & BT_PREVWEAPON

by Guest » Sun Dec 30, 2018 4: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.

Top