Simple Hotkey (Evented sample avaliable)

Hello

What I'm looking for is a script that will: A: Get keypress, I can enter whatever key I want just the script it will run and check for whenever the key is pressed. B: Upon triggering the key the script will change the equipped weapon to the next one in the player inventory. C: Loop around.

Alternatively it would be amazing if I could manually tell the script what weapons are ok to loop through, using a script call. Something like "EnableWeapon(X,X,ETC)"

I hope that is clear enough. I also posted a picture of some basic logic down below. 

Basically this is what I need, It would be amazing if it could check what weapons you actually have in your inventory. PadConfig.weaponeq is just a reference to make gamepads avaliable. It's basically saying :RIGHT , If you wonder.

Thanks in advance!
Cheers ^-^

Testings.png
What is the Question? Do you need Help?
What is the Question? Do you need Help?
Yes, I'm not completely lost to scripting but one thing I never quite understood is how to make scripts run without calling them. Such a basic thing 😳 

Essentially anything that could bring me closer to making the above image into a script would be gold! Thanks ^-^
If you want a script, then you should give a description of what you want the script to do - just a picture of a logic sequence is not enough for this as too many questions remain.
If you want a script, then you should give a description of what you want the script to do - just a picture of a logic sequence is not enough for this as too many questions remain.
Updated the main post. Thanks for clarifying that, I thought I was being a good chap. I hope this clear things up a bit ^-^
You could try my Tool Cycler script I made today. I know it says it's an addon for Falcao's ABS, but you can simply disable all other button triggers, and leave the weapon one only.


Since Falcao's ABS is using the same slot for weapons, it should work without any issues, and should do all what you want.


Link is in my signature if you want to check it out.
You could try my Tool Cycler script I made today. I know it says it's an addon for Falcao's ABS, but you can simply disable all other button triggers, and leave the weapon one only.

Since Falcao's ABS is using the same slot for weapons, it should work without any issues, and should do all what you want.

Link is in my signature if you want to check it out.
Worked wonders thank you <3

Since we are at it, any idea what could be wrong with items? I tried putting items on 😀OWN and :UP, changed to: InputType = :default

It doesn't yield any errors just does nothing. 

I'm guessing XAS does not use the same slots for Items.

Thanks again! that was super ^^
Yeah, XAS is using another variable to store the item/skill info, that's why it doesn't work.


I will see if I can make a working version for XAS for you.


Here is a working version for XAS:


http://pastebin.com/SJw5gC42


As a bonus, I found a bug in my original tool cycler for Falcao's ABS thanks to making this for you, so, win-win for both of us! 😀
Yeah, XAS is using another variable to store the item/skill info, that's why it doesn't work.

I will see if I can make a working version for XAS for you.

Here is a working version for XAS:

http://pastebin.com/SJw5gC42

As a bonus, I found a bug in my original tool cycler for Falcao's ABS thanks to making this for you, so, win-win for both of us! 😀
Thanks mate! That worked out phenomenally! Question tho! I'm using a script to enable me to use a controller. I'm doing this atm, entering it in ToolCycler:

    if WolfPad.plugged_in? == true

      Cycles = { [:weapon,😛rev] => :LEFT, [:weapon,:next] => :RIGHT, }

    end

      Cycles = { [:weapon,:next] => :ALT, }

    endBut it doesn't seem like it updates. As in, when I plug in the controller nothing happens. I'm no programmer but I guess that is the point with constants. Any idea how to work around this? Right now the above reads in pseudocode:

If Gamepad is plugged in then do X, if not do Y end

This is the behaviour I'd like for my game. 

Final note: Where do I look for the variable a script stores information within? Do I just look for variable assignments all over the script? or guess my way to their naming convention? 

Thank you again! you are awesome <3
Module constants like the 'Cycles' setting I made in the script run only once at startup and they are never updated until the game is restarted.

So, it is normal that the script won't react to an in-game change of plugging in a gamepad.

You can edit the very last method for what you want. But before you do, make a copy of the 'Cycler' settings in the script, rename it to something else (like 'CyclerGamePad', for example), and set your gamepad settings there. After this, replace the last method in my script with this one:

Spoiler
alias add_cycling_tools7732 update def update if (ToolCycler::EnableSwitch == 0 || $game_switches[ToolCycler::EnableSwitch]) && !$game_message.busy? && !$game_map.interpreter.running? # Edit starts here! if WolfPad.plugged_in? == true # Run the gamepad button checks. ToolCycler::CyclesGamePad.each do |key,button| $game_party.members[0].cycle_tool(key[0],key[1]) if Input.trigger?(button) end else # Run the default button checks. ToolCycler::Cycles.each do |key,button| $game_party.members[0].cycle_tool(key[0],key[1]) if Input.trigger?(button) end end # Edit ends here! end add_cycling_tools7732 end
Can you post a link to that gamepad script? If it uses a different input check method, it will not work with my script even with the above edit.

Basically, scripts are a collection of variables and condition checks, so yeah, if you want to find something in it, you will have to read the whole script. Assuming what variables do in the script by seeing their name is your best bet.
Tested it out and it works perfectly! the script I'm using for the gamepad is:

http://forums.rpgmakerweb.com/index.php?/topic/1284-gamepad-extender-v11-2202015/

Original thread: https://forums.rpgmakerweb.com/threads/simple-hotkey-evented-sample-avaliable.45241/