Simple Hotkey (Evented sample avaliable)

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
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
 
Last edited by a moderator:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
What is the Question? Do you need Help?
 

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
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 o_O 

Essentially anything that could bring me closer to making the above image into a script would be gold! Thanks ^-^
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
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.
 

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
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 ^-^
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
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.
 

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
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 :DOWN 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 ^^
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
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! :D
 
Last edited by a moderator:

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
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! :D
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,:prev] => :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
 
Last edited by a moderator:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
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:

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.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

On my journey of character rework: I had this character, she was meant to be just a princess that joins your party. And at long term she was just uninteresting... So I tweaked her to be a rebel agaisn't the royalty before meeting up with the party.

Quick tip for any other ametuer pixel artists! When trying to create a colour palette, enabling Antialiasing can speed up the process of creating different shades! Just place your lightest colour and your darkest colour next to each other, select both pixels, and stretch it out!
Revolutionizing the JRPG Industry: Knocking on Doors.

Take that, murderhobos.
Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.

Forum statistics

Threads
106,054
Messages
1,018,580
Members
137,843
Latest member
Betwixt000
Top