Control Configuration System - v1.5 (04/07/2017)

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Sixth, Nov 3, 2016.

  1. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    Code:
    #===============================================================================
    # * [ACE] Control Configuration System - Manual And Install Notes
    #===============================================================================
    # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
    # * Version: 1.5
    # * Updated: 04/07/2017
    # * Requires: Neon Black's Keyboard Input (or another keyboard script)
    #        /--> Shaz's Super Simple Mouse - modified (or another mouse script)
    #        \----- Only if you want to enable mouse usage!
    #-------------------------------------------------------------------------------
    # * < Change Log >
    #-------------------------------------------------------------------------------
    # * Version 1.0 (03/11/2016)
    #   - Initial release.
    # * Version 1.1 (04/11/2016)
    #   - If you click on an event while you are directly beside it, you expect it
    #     to be triggered, right? It didn't before, but that should be fixed.
    #     This update is only useful for mouse users.
    #     Only the Main Settings and Main Functions scripts were updated.
    # * Version 1.2 (14/11/2016)
    #   - Now you can save the current key-bind settings from the running game into
    #     a file in your project's folder with a single key press.
    #     This allows you to set up your new key-bind settings in the game instead
    #     of in the script. Once you saved the new settings you made in the game
    #     into this file, you can open the file and copy/paste it directly into
    #     the Main Settings script of this system.
    #     The saved file will be formatted properly, so it is really just a simple
    #     copy/paste job to install the new default control settings from it.
    #     This feature only works in play-test mode!
    # * Version 1.3 (19/11/2016)
    #   - Fixed a bug with the popup window. Now it should open and close properly
    #     in every situation.
    # * Version 1.4 (22/06/2017)
    #   - Fixed some font options.
    #   - Fixed an aliased method which could cause crashes in some rare cases.
    #   - Fixed the direction key update methods. Turns out, it only worked when
    #     using Shaz's Super Simple Mouse System script.
    # * Version 1.5 (04/07/2017)
    #   - Fixed a bug with the clearing of key binds in the menu.
    #   - Fixed a bug with setting key binds in the menu (button rules related).
    #   - Separated some parts of the code into patches instead to allow for easier
    #     compatibility with other input scripts.
    #-------------------------------------------------------------------------------
    # * < Description >
    #-------------------------------------------------------------------------------
    # * The most important note about this script is that this is NOT a
    #   plug and play script at all! It is more like a developer's tool.
    #   While I did change the default input checks, tons of scripts out there uses
    #   those input checks still, and if you want this script to function with them,
    #   you will need to change the input checks in those scripts as well!
    #   Basic scripting knowledge is a must for using this script!
    #   Now, onto the features...
    # * This script will add a control configuration menu for your game, so that
    #   the players can set their own key-binds to what they want to, instead of
    #   using some predefined key-binds the game developer forces on them.
    #   Nothing is worse than an awful keyboard control in a game, right? :P
    # * Ability to:
    #   ~ Make expandable settings. You can make as many key-binds as you want!
    #     Well, not really, since there is a limit on the number of keys on a
    #     keyboard, but you get the idea, right? :D
    #   ~ Set which keys are usable on the keyboard for your game.
    #   ~ Set more than 1 key for a function.
    #     Primary, secondary, tertiary key-binds, and so on, it can be done.
    #   ~ Lock specific key-binds to specific functions. These key-binds can not
    #     be removed or changed ever by the player.
    #   ~ Disable the removal of specific key-binds on specific functions. This
    #     means that at least one key-bind must always be set for the function.
    #   ~ Set up share-able key-binds to your functions, so that one function can
    #     share the same key with other functions (such as "Menu Cursor Up" and
    #     "Move Up", for example).
    #   ~ Make any kind of structure for your settings. You can nest as many hashes
    #     as you want in your settings, categorize them however you want.
    #   ~ Set separate key-bind settings for the menu and for the map functions.
    #     For example, the "Cursor Up" function does not have to share the key(s)
    #     with the "Move Up" function (but it can still be set up that way).
    #   ~ Make the settings dependent on the currently logged in Windows user
    #     (locally), or make them global for all players.
    #   ~ Check the last pressed key manually. Might be useful for some eventing.
    #   ~ Display the correct keys for your functions in message boxes in 3
    #     different ways (text, icon or custom image).
    #   ~ Display your function names in message boxes.
    #   ~ Add a command button for the control configuration menu in your main menu.
    #   ~ Please your players! :P
    # * New things added for Neon Black's Keyboard Input script (requires my patch):
    #   ~ A "key released?" check method.
    #   ~ Mapped all of the keys found on a regular keyboard.
    # * New things added for Shaz's Super Simple Mouse script (requires my patch):
    #   ~ A "mouse key pressed?" check method.
    #   ~ A "mouse key released?" check method.
    #   ~ Changed the "mouse key repeat?" check method to match the timings from
    #     Neon Black's Keyboard Input script. Needed for synchronization.
    #   ~ Added mouse processing for the number input window.
    #   ~ Mouse processing on the save and load scenes has been changed.
    #   ~ Triggering an event right next to the player is possible now with the
    #     mouse movement function (named as :f_move in the key-bind settings).
    #   ~ Added an event command for using custom mouse offsets for event icons
    #     and texts.
    #   ~ Centered the icon and text vertically for custom event icons and texts.
    #   ~ Changed the positioning of event icons/texts when they are too close to
    #     the right side of the screen.
    #   ~ Fixed the compatibility issues with Zeus81's Fullscreen++ script.
    #     The mouse will now correctly track the game window's size, be it in
    #     windowed or full-screen mode, and be it in any scale ratios.
    #     The mouse will be automatically centered when changing screen and scale
    #     modes, as well as when changing scenes with Fullscreen++.
    #   ~ Fixed the compatibility issue that happens when using Source's
    #     Parallel Process Events Execution Bug Fix script. The mouse movement
    #     was forever disabled after triggering an event with that script installed.
    #   ~ Certain selectable windows could cause crashes if they are disposed while
    #     the mouse is active. Added a safe-check to prevent this.
    #   ~ Changed the Mouse_to_Input_Triggers constant in the Mouse module to work
    #     with this control configuration system, it is now an instance variable
    #     which updates itself when the player swaps the mouse buttons on the PC
    #     during the game.
    #   ~ Removed the begin/rescue call from a constantly updated method.
    #     This might increase performance a little (very little, but still :P).
    #   ~ Added compatibility for projects which disable the tilemap drawing
    #     completely.
    #   ~ Added some settings to enable/disable the mouse cursor on all or on
    #     specific scenes. These settings are in the Main Settings script of my
    #     Control Configuration System.
    #   ~ Added an option to forcibly show the system cursor (of Windows) when the
    #     in-game mouse cursor is invisible (when it's disabled with the above
    #     mentioned features).
    #   ~ Added an option to lock the mouse cursor inside the game's window.
    #     This works even in different scale ratios (Fullscreen++ compatibility).
    #     You can also set it to lock in full-screen or windowed mode only if you
    #     need the mouse locked only in one mode.
    #   ~ The in-game mouse button trigger checks will now detect if the mouse
    #     buttons are inverted on your PC or not. So, the left and right mouse click
    #     functions will also be inverted in the game. The displayed key-binds will
    #     also reflect this information.
    # * Extra features (which might not be desireable, but ohh well...):
    #   ~ Changed the dash button's function, so that it simply toggles between
    #     dash and walk modes instead of always needing to press the button for it.
    #   ~ Did the same for the debug through feature. Instead of holding down the
    #     button for it to activate it, now you can simply toggle between normal
    #     collision and debug through modes.
    # * Features disabled by this script:
    #   ~ Old input checks. This leads us to...
    #   ~ Gamepad control. I know. I will try to implement a control mode switch in
    #     the future which will use LoneWolf's Gamepad Extender script, but due to
    #     lack of compatible (any) gamepad, I can't test anything, so this will have
    #     to wait. Adjustable full keyboard control "only" is still better than the
    #     default gamepad control + the very limited amount of keys provided, in my
    #     opinion, so take it with a grain of salt (not sure if I used this
    #     expression in the right sense here :P).
    #-------------------------------------------------------------------------------
    # * < Instructions >
    #-------------------------------------------------------------------------------
    # * Refer to the script's header for usage instructions!
    #-------------------------------------------------------------------------------
    # * < Installation >
    #-------------------------------------------------------------------------------
    # * IMPORTANT: Backup your project before attempting to install this system!
    # * Follow the notes below carefully to install this system! Failing to do that
    #   can result in undesirable effects!
    # * All scripts of this system go below the Materials section but above Main!
    # * The relevant scripts should go in this order:
    #   - Zeus81's Fullscreen++ (if used)
    #   - Yanfly's Core Engine (if used)
    #   - Sixth's Control Configuration System - Main Settings
    #   - Neon Black's Keyboard Input System
    #   - Shaz's Super Simple Mouse Script (if used)
    #   - Sixth's Control Configuration System - Vocab Settings
    #   - Sixth's Control Configuration System - Menu Settings
    #   - Sixth's Control Configuration System - Default Input Check Methods
    #   - Sixth's Control Configuration System - Main Functions
    #   - Sixth's Control Configuration System - Menu Code
    # * The rest of the scripts used by this system can go anywhere on your list.
    # * Depending on what other scripts you use, you might need to change the order
    #   of your scripts for this system! I haven't tested this with many scripts,
    #   so I can't know for sure. Let me know if you find any other mandatory
    #   script placement order for other scripts!
    # * Yanfly's Message System should go above these scripts if used!
    #-------------------------------------------------------------------------------
    # * < Compatibility Info >
    #-------------------------------------------------------------------------------
    # * Added compatibility for Cidiomar's Input System with the v1.5 update.
    #   Now you can use that keyboard script too if you want.
    #   Note that Cidiomar's Input System allows mouse clicks to be used without a
    #   separate mouse script (you will still need a mouse script if you want to
    #   use the mouse cursor itself though).
    # * As mentioned above, this system is using Neon Black's Keyboard Input script
    #   currently. It is possible to use it with other keyboard scripts, but
    #   there is a high chance that extensive modifications would need to be done
    #   in the scripts of this system. If the keyboard script you want to use uses
    #   symbols for the key identifiers (like Neon Black's), than it can be used
    #   without much modification in the real code (although you will still need to
    #   change tons of things in the setting area). If it uses some other type of
    #   identifiers (such as strings or integers), the real code (non-configuration
    #   part) of this system must be changed to match the things from the keyboard
    #   script you use.
    #   Similarly, if the keyboard script you want to use did not patch it's key
    #   press checks into the default input check methods, it will not work with
    #   this system!
    # * The same applies to the mouse script used for this system as the above
    #   mentioned rules for the keyboard script you might use.
    #   Although mouse systems are a bit more complicated and each of them might
    #   be very different from the other, so regardless of what other mouse script
    #   you may want to use (aside from Shaz's), it will need to be edited to work
    #   with this control configuration system for sure.
    # * Gamepads are disabled for now! Notes about this can be found in the
    #   description section a little bit above.
    # * Any scripts overwriting the overwritten methods found in the
    #   Default Input Check Methods script may or may not be incompatible!
    #   The mentioned script must be placed below those scripts, or else this system
    #   will not function properly!
    #-------------------------------------------------------------------------------
    # * < Known Issues >
    #-------------------------------------------------------------------------------
    # * No known issues.
    #-------------------------------------------------------------------------------
    # * < Terms of Use >
    #-------------------------------------------------------------------------------
    # * Free to use for whatever purposes you want.
    # * Credit me (Sixth) in your game, pretty please! :p
    # * Posting modified versions of this script is allowed as long as you notice me
    #   about it with a link to it!
    # * The other scripts (not written by me) used in this demo retain their
    #   original terms of use stated by their authors!
    #===============================================================================
    - Script:
    This system has many scripts, so instead of uploading all of them, lookie below for a handy demo. :p

    - Demo:
    Linky: https://drive.google.com/open?id=0B7RAWk4I_tQ3NDJxQlgtdFJDSTA

    - Addons:
    Title Command Addon:

    The key images found in the "Graphics/Key Images/" folder are made by me. Some keys are not included there (like the mouse buttons, for example)!
    Those are just examples and are not meant to be used in any projects! Kindly make your own to use in your project(s), thanks!
    The default cursor icon is made by me. You can use that if you wish, although it's nothing special, really.

    - Screenshots:
    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    NOTE:
    Some functions you see on these screenshots are not really implemented!
    They are just examples for adding new functions/key-bind settings for your project.

    - Author's Notes:

    Whenever I see a game with bad default key-binds and without any way of changing them, I think...
    "Why didn't they make a control configuration system? It's the 21st century, right? >.>"
    I can't say it was easy to make this system, but I finally finished it, and if I can, certainly those developers with much more resources than I have can too.
    Yet they don't. And I am mad at them! -.-

    In any case, this system will surely cheer your players up, regardless if you got a good default key-bind configuration or not.
    Except if you plan to have gamepad usage in your game. That is not possible with this script, and I am not sure if I will add that in the future or not.
    For now, this will stay as a keyboard + mouse control configuration system.

    If you use this system, I recommend using a script to disable the built-in F1 "Options" key for obvious reasons.
    There are multiple scripts floating out there for this, so finding one shouldn't be hard.

    Read the instructions and setting details carefully in the scripts!
    The first thing I wrote in the script's header is that this is NOT a plug-and-play system!
    Unless you plan to use the default menus and functions only, in which case, you are good to go if you are satisfied with my settings in the script.
    Otherwise, you will have to edit the settings to fit your project's need.

    Scripting knowledge is a must for making this compatible with non-default RPG Maker projects!
    In case you need help in this regard, you can ask me, although I can't promise that I can do the changes for you for free (kinda busy with commissions, sorry).

    Okay, tea time! *-*
     
    Last edited: Jul 5, 2017
    #1
    BlueMage, Ebanyle, UpAbove and 3 others like this.
  2. Jatopian

    Jatopian Veteran Veteran

    Messages:
    44
    Likes Received:
    13
    First Language:
    English
    A reasonable attitude, in my opinion.
    So does this interfere with gamepad usage? Or merely doesn't offer a way to configure it? I hope it's the latter; as you say, it is the 21st century.
    But I don't want to take away people's ability to mute the music, start the game in fullscreen, configure gamepad, etc. And I'm not sure the reasons are as obvious as you say.
     
    #2
  3. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    By itself, it won't interfere with anything unless you install the Default Input Check Methods part of this script series. That is the one overwriting the default input check methods in every default class.
    You can add gamepad support by extending the input check methods I made in that script with another check to see if the player selected gamepad or keyboard+mouse control (perhaps from a setting menu), and based on that check, you can either use the input checks for the gamepad (but you will have to make these for yourself, and they are not configurable with this script) or for the keyboard+mouse (using the same checks from the mentioned script).
    Just note that this script is far from plug-and-play, especially if you have a lot of custom scripts using input checks, since you will have to replace all of those input checks with the new ones from this script, and you will have to make new function settings for them too if needed, otherwise the player's configuration would not work.

    The reason why I made this script is because I wanted to separate the keyboard+mouse controls from gamepad controls completely, and to enable all keys on the keyboard. That I did, even if I killed off gamepad usage. :p

    Ever since they started forcing down stick controls on my throat, I hate gamepads. I don't want to walk around with those awful sticks, and I certainly don't want to control the camera with it either. It's just not my thing. For that reason, I never even yearned for a gamepad, and I can't really make a gamepad control addon without one of them, right?

    Regardless, I am kinda tempted to add gamepad configuration too for a while now, just to make it a complete control configuration tool. I remember starting to make one, but couldn't test it, so I abandoned it at one point.
    But it will have to wait now, since I am a bit busy with commission work.
    On the bright side, I got a gamepad now, and I even used it already... for at least 10 minutes. :D

    There are many scripts out there adding those setting options with an in-game menu, which is much better than that default F1 menu.
    The obvious reason is because those control settings will not work with this control system (if you properly replaced all input checks from your custom scripts too). The input checks and key triggers are processed with the checks from this script's control system, not from that default control setting, which makes those settings (well, 90% of them anyway, and the rest can be added in-game with scripts) useless, so there is no point in keeping them.
     
    #3
  4. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,647
    Likes Received:
    365
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    I was surprised to know that this was out for over a year and never heard of it.
    I'm very tempted to try to implement it, but like you say I would have to replace all the inputs in my game, and as you have figured out, I use a lot of scripts. This would be maybe as much time as Luna engine took for me. lol.
    If you do put gamepad control in, then it would be complete. I'm one that prefers a gamepad for some games as the keyboard controls are not intuitive for me. Especially when you have to press buttons really fast like in MOG's script for battle input, or when a game uses a lot of keys for different functions. For the games that just use ok and cancel, then the keyboard is perfect.
     
    #4
  5. KingHazeel

    KingHazeel Veteran Veteran

    Messages:
    125
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    Huh. Surprised I didn't see this before. Are we able to make custom bindings? I notice there's several unused inputs and shift toggles a different run mechanic than we'd normal see. Is there a way we could attach the map shortcut to a script call for our mini map? Or attach skills to the Skill Bar for Pearl ABS?

    EDIT: Playing around with it. I notice what seems to be a bug where the field confirm skill doesn't work to interacting with NPCs. Instead this is tied to the Menu confirm button.

    Also noticing that if I change the configuration, save, and then come back, the configuration will be set to default...but that's probably me misunderstanding something.

    Lastly, if I don't use run mode, how would I properly configure the run button to be changed?
     
    Last edited: Mar 3, 2019
    #5
  6. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    @KingHazeel
    You will have to check the instructions and key settings provided. All the answers are there, I assure you.

    I will just note the most important thing here (again):
    This is NOT a plug-and-play script collection! You will need coding knowledge to implement the new input checks in other custom scripts, or else the key configuration will not work for those custom scripts. You either do this yourself, or ask someone who can do it for you.
    That said, I could help you with it, but only if you read and understand the instructions on how to configure the setting area of this script, that's the whole reason I wrote all those green letters in these scripts.
     
    #6
  7. KingHazeel

    KingHazeel Veteran Veteran

    Messages:
    125
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    Yeah, sorry, I was kinda just overwhelmed by the sheer number of scripts and was looking for examples of how to use it. Now I did notice the save system call to keep the binds, I was just sorta confused by it. In the example, the developer is using script calls to change the input settings and then saving it, but I'm wondering why it doesn't automatically save it when the player changes the script.

    As for setting the inputs based on other scripts, my understanding...is little. I know nothing of Ruby. I can remove unfavorable parts of the script I don't like and edit things around based on other parts of the script that I'm copying, but this is really just monkeying around and crudely making changes based on what script I can understand (which you are good at doing BTW). In this case, I was trying to see if there were examples of setting buttons based on other scripts that I could try to mimic.

    That said, if it's simply unrealistic to try and use this script without genuine understanding of Ruby, then I understand and thank you for your time.
     
    #7
  8. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    The script named as "Default Input Check Methods" is basically a giant example of how to use the new input check methods. I did mention this in the "Manual & Install Notes" documentation.
    You just have to replace all of the input check methods in your scripts with the new ones.
    The old ones are like:
    Code:
    Input.trigger?(:key_symbol)
    Input.repeat?(:key_symbol)
    Input.press?(:key_symbol)
    The new ones are like:
    Code:
    Input.trigger_ex?($system[:path_key1][:path_key2] ... [:function_symbol])
    Input.repeat_ex?($system[:path_key1][:path_key2] ... [:function_symbol])
    Input.press_ex?($system[:path_key1][:path_key2] ... [:function_symbol])
    And this is exactly what I did in the mentioned script (along with some other minor changes, but the important thing is how I changed the input checks). If you want examples, check that script, check which methods I changed and how, look up the original methods in the default scripts of the engine and compare them with my methods. Skip the Input module part, that one is actually a hidden module and you won't be able to see the original methods there, but the rest are all out in the open.

    If you mean that the player change the keybinds in the game, but when you restart the game it resets those changes... Well...
    The very first setting in the "Main Settings" script. I even put a big "WARNING" note there.
    If you mean something else, than I will need more details, because I can't reproduce any kind of error with changing keybinds in the game.

    It's not that hard, really. But everything I can explain about this script and how to use it is already written in green letters in the relevant scripts for this system, including examples for most (if not all) things related to changing keybinds and input checks.
    What I did just now in this post is repeat myself. I get that there are a lot of instructions to read through and in multiple scripts, but it's there for anyone who takes the time to read and understand it.

    To answer some of the questions that are not part of my green letters from your previous post...

    The field confirm button works for me, it triggers events how it should. Maybe it's a compatibility issue with another script in your project?

    For the run key, you can simply remove the function setting tied to the run toggle key and remove the run key from the menu settings too. This should disable that feature for good. Whatever other thing you want to do with your custom scripts, you can do it by adding new function key settings in the relevant setting areas. Once you set them up, you can use them in your input checks in the custom scripts you use.

    Phew, this became a long one. o_O
     
    #8
  9. KingHazeel

    KingHazeel Veteran Veteran

    Messages:
    125
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    1) Oh! I missed the warning because...I assumed that everything with Cidiomar or Neon Black's name was just imported, untouched, and should be left alone. ...That was dumb. ^^;

    2) I tested again and you were right--the confirm works as it should. I was probably just reading the inputs wrong.

    3) OK I managed to get the normal run function running:

    class Game_Player < Game_Character
    def dash?
    return false if @move_route_forcing
    return false if $game_map.disable_dash?
    return false if vehicle
    return Input.press_ex?($system[: p1][:mmode])
    end
    end

    It's basically the default dash function with one line replaced. I assume the same basic principle applies for other functions. So I figured I'd just import Falcao ABS into the demo to try it out. I find Falcao's trigger function for tools

    def trigger_tool?(key, type)
    return true if type == :keys && PearlKey.trigger?(key)
    return true if @mouse_exist && Mouse.trigger?(0) && type == :mouse &&
    @mouse_over == key
    return false
    end

    I can already tall this is going to be harder...it requires arguments for Falcao's own key system. Hopefully I'll figure something out though. Of course, maybe I can set a button to be the weapon/item/skill button. I.e. :skill = Key::Skill[0]

    Thanks for your patience, by the way!
     
    Last edited: Mar 8, 2019
    #9
  10. KingHazeel

    KingHazeel Veteran Veteran

    Messages:
    125
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    OK I may need some help. Finally managed to get back to this and there were a couple of methods I tried. This is the first one:

    Code:
    class Game_Player < Game_Character
      def update_tool_usage
        return if PearlSkillBar.hidden?
        return unless normal_walk?
        unless actor.equips[0].nil?
          use_weapon(actor.equips[0].id) if Input.press_ex?($system[: p1][:f_move])
          use_weapon(actor.equips[0].id) if trigger_tool?(1, :mouse)
        end
        unless actor.equips[1].nil?
          use_armor(actor.equips[1].id) if trigger_tool?(Key::Armor[0], :keys)
          use_armor(actor.equips[1].id) if trigger_tool?(2, :mouse)
        end
        unless actor.assigned_item.nil?
          use_item(actor.assigned_item.id) if trigger_tool?(Key::Item[0], :keys)
          use_item(actor.assigned_item.id) if trigger_tool?(3, :mouse)
        end
        unless actor.assigned_item2.nil?
          use_item(actor.assigned_item2.id) if trigger_tool?(Key::Item2[0], :keys)
          use_item(actor.assigned_item2.id) if trigger_tool?(4, :mouse)
        end
        unless actor.assigned_skill.nil?
          use_skill(actor.assigned_skill.id) if trigger_tool?(Key::Skill[0], :keys)
          use_skill(actor.assigned_skill.id) if trigger_tool?(5, :mouse)
        end
        unless actor.assigned_skill2.nil?
          use_skill(actor.assigned_skill2.id) if trigger_tool?(Key::Skill2[0],:keys)
          use_skill(actor.assigned_skill2.id) if trigger_tool?(6, :mouse)
        end
        unless actor.assigned_skill3.nil?
          use_skill(actor.assigned_skill3.id) if trigger_tool?(Key::Skill3[0],:keys)
          use_skill(actor.assigned_skill3.id) if trigger_tool?(7, :mouse)
        end
        unless actor.assigned_skill4.nil?
          use_skill(actor.assigned_skill4.id) if trigger_tool?(Key::Skill4[0],:keys)
          use_skill(actor.assigned_skill4.id) if trigger_tool?(8, :mouse)
        end
        update_followers_trigger unless $game_map.interpreter.running?
      end
    end
    Just copied and pasted Falcao's update tool script and replaced the first weapon usage condition with an available unused input. Using this, I was able to activate the weapon once, but after that it wouldn't work anymore. The second method I tried was this:

    Code:
    module Key
     
    # Type            Key                                       Display name  
      Weapon   =  [$system[: p1][f_move],      'F']            # Weapon usage
     
    end
    Replacing his normal keys with Input keys, but that just gave me the error "undefined method []". I don't know if it's possible to simply replace the keys this way though given that I don't understand Falcao's script and Ruby that well, it seemed like a simpler solution than trying every single piece of Falcao's script that needed to be changed and praying I didn't miss something. Is there a simple method to replace his keys or is it not going to be that easy?

    As for the first method, I thought maybe the result of trigger_tool from this command was used later, but from what I can tell, it just returns true or false and this result isn't referred to again.
     
    Last edited: Mar 23, 2019
    #10
  11. Sixth

    Sixth Veteran Veteran

    Messages:
    2,130
    Likes Received:
    798
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    This should work, except you should use trigger_ex? instead of press_ex?.
    I don't know why wouldn't it work after the first usage, but maybe check the tool's settings? Maybe it uses an item, and you only have one of them, or it uses some other resources and the actor runs out of those after one usage. Just guessing here, but I don't see why else wouldn't it work after a single usage.

    Your second method won't work, the $system variable is not yet initialized at the time you requested.

    Ohh, and use code tags for code lines in your posts, pretty please! :p
     
    #11
  12. KingHazeel

    KingHazeel Veteran Veteran

    Messages:
    125
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    Really quick before I go to bed:

    1) I tried trigger_ex?, but it led to the same result.

    2) I'm pretty sure it's not the weapon settings. To make sure, I temporarily re-ordered the code so Falcao's was on the bottom. Under these conditions, I can spam the weapon without problem.

    Oh and sorry about the lack of tags. ^^;
     
    #12
  13. KingHazeel

    KingHazeel Veteran Veteran

    Messages:
    125
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    OK I think I solved it, sorta. When I moved Falcao's script below, I tried replacing Falcao's actual code with the one I showed and it allows me to use it frequently. Not sure why it acted up, but if it works, it works.
     
    #13
  14. KingHazeel

    KingHazeel Veteran Veteran

    Messages:
    125
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    EDIT: Nvm, I figured it out. ^^; The normal mouse clicks were missing--which is weird because they seem to have been "half added" in. Probably set up to require a script I wasn't using. But I changed it so they're in for my game now.
     
    Last edited: Apr 28, 2019
    #14
  15. KingHazeel

    KingHazeel Veteran Veteran

    Messages:
    125
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    EDIT: Disregard this...I figured I'd look into it myself. -/////- This was intentional, not a bug. ^^;

    Bleh...sorry if I'm basically spamming at this point, but I thought I'd report a tiiiiny little bug I've noticed. I've found that if you move left or right and try to activate the pause key at the same time, the game has trouble picking it up. Just find an open area without walls, move left and right, and occasionally press the pause button, in this case Escape for the Demo, and it will often not register unless you're rapidly pressing it.

    This doesn't occur for any of the other keys. I can still hold shift and run, I can still use Falcaos skill bar while moving, but for some reason there's an issue with the pause key.
     
    Last edited: May 30, 2019
    #15
  16. dailyminerals

    dailyminerals Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    This seems to break the event driven conditional branch for checking if a given key is pressed. Is there a solution?
     
    #16
  17. KingHazeel

    KingHazeel Veteran Veteran

    Messages:
    125
    Likes Received:
    5
    First Language:
    English
    Primarily Uses:
    RMVXA
    Wouldn't you just create a conditional branch, use script, and put in something like this?

    Input.trigger_ex?($system[: p1][:special])
     
    #17
    dailyminerals and Sixth like this.
  18. dailyminerals

    dailyminerals Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    Well that works. Thanks.
     
    #18

Share This Page