[RMXP] TRYING TO RIG BUTTONS IN XP

Posts

Pages: 1
My friend and I are trying to make a game and one of the things we REALLY want to do is set it up so that pressing a button on your keyboard can switch the player's equipped weapon while on the map (Not in combat). The only tutorials I've been able to find for this are for VX Ace and MV.
Hi there! Here is a sample of the code I use for my current project in RMXP:

(I feel like something could potentially be removed from my code to make it more efficient, but for now it gets results!)



(The comment in green there is just so I remember what I was doing!)

As you can see, it is set to Parallel with the Switch being Dash Ready. So, this event will only trigger when:

- The set Switch (in this case Dash Ready) is ON
- The correct button (in this case Button Y) is pressed

I noticed that if I had too much code in the same Common Event as the button press, then I would get quite a bit of lag at times. The solution that I discovered was to break down the different spells into their own separate Common Events and call the appropriate one when the proper conditions are met.

If you look at the Common Events list on the left, you'll see I have a separate Common Event for each button that can be pressed (except for Strafe where I combined two of them). Each has their own unique switch to control usage.

As for the actual act of weapon switching, I have a few ideas if you need them.

(My example is for an active battle system game, if that makes any difference)

Hope this helps!

Let me know if you have any other questions!!
Pages: 1