Ready to Rumble: A Plugin for Controller Vibration

Discussion in 'JS Plugin Releases (RMMV)' started by BreakerZero, Jul 20, 2019.

  1. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Ready to Rumble version 1.6
    Created by BreakerZero with consultation from OS87 and Waterguy
    A paid license is required for all new users, so please do not recirculate the plugin. Credit is required for any released games.

    About the plugin
    A lot of games these days offer a rumble mode that activates in response to certain game events (an explosion set off during a major plot twist, getting knocked out during a fight, or simply taking a hard fall to the ground) and this plugin has been designed to bring that experience to RPG Maker MV.

    Release history:
    v1.0: Initial RTM
    v1.1: Unanticipated bugfix
    v1.2: Added control switch assignment to change rumble mode status
    v1.3: Small change to accommodate the possibility of a crash when a gamepad is disconnected. Also set the maximum supported values to eliminate possibility of the effect not working if set too high or too low.
    v1.4: Replaces control switch with option menu function, and directs the effect to the most recenty-used gamepad. A very special thanks to YoraeRasante for this update.
    v1.5: Added verification to detect the availability of a supported gamepad. As of this update, the functions will not be available if gamepad detection fails.
    v1.6: Development license now required as I am joining other creators in moving to a paid distribution model.

    Getting Started
    Because there's no guarantee that the launcher that ships with MV will have the necessary functions that allow the plugin to work, so as a precaution on this you'll want to download the latest version of NWJS, back up the default launcher that ships with MV and patch it over with the NWJS packages. The SDK version should go in your MV install, the redistributable goes in your exported game package. Again, there's no guarantee that the NWJS package shipped with MV has the necessary functions that allow the plugin to work, not to mention that MV ships with the x86 version which is functionally inadequate by modern game development standards (and in fact is now also required on macOS). Don't worry about the prospect of problems, though - as long as your install and project are 1.6.x or newer the official NWJS redistributable and the MV launcher are completely interchangeable. But again, you should back up the default launcher files in case something else happens.)

    Instructions for patching the MV launcher:
    http://bit.ly/2Zaahxb
    Download the latest NWJS redistributable:
    http://bit.ly/2XNqNGu

    Using the plugin
    To activate the rumble feature in a given event or scene, use the following script call:

    Code:
    Rumble(strong,weak,time)
    Strong is the maximum velocity of the effect's magnitude.
    Weak is the exact opposite: the weak end of the effect.
    Time is defined in milliseconds, so 1000::1 and 5000 is 5 seconds. (Get it?)
    Note that neither weak nor strong can go over 1.0, and that magnitude values of 0.1 are completely ignored (and for obvious reasons). Also, the values for weak and strong can be reversed and still work properly.

    For example:
    Code:
    Rumble(1,1,1000)
    Rumble(0.4,0.2,500)
    Rumble(0.3,0.6,5000)
    Q&A

    Why am I being asked to to patch the launcher?

    Primarily because there's no way to guarantee that the one included with MV has the necessary updates that are required for the plugin to work properly. This would have to be done at the distribution level which is a matter for the Kadokawa team. Otherwise they're basically the same.

    Why is the plugin moving to a commercial release model?

    The most important reason in this matter is because of the recent patterns of asset theft within the community, which for the effort and research that was required to make this possible is not worth the risk of being the next potential victim. Yanfly has a detailed explanation of what happened which you can read over here.

    Does this mean that I have to start paying for every project that uses the plugin?

    Not at all - I am only asking that you pay the price to obtain new licensing specifications. You don't have to pay twice for the same thing, and in fact you can link email addresses to your itch profile if necessary to look up prior purchases in a single account. It's a fairly minimal expense, however. As a side note I have also decided after further consultation that existing downloads will in fact be honored despite my prior announcement or whatever the help system may tell you, however it's on the user to maintain compliance regardless of how the plugin was acquired. (Once I receive access to my equipment again I will release a revision 1.7 to reflect the change in support, however the decision is effective immediately and supercedes any other information that may be provided with the plugin.)

    Download Now
    Buy on itch.io
    Buy on Gumroad
     
    Last edited: Nov 6, 2019
    #1
  2. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,509
    Likes Received:
    3,762
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Looks like a really cool feature!

    Do you want designers who use this to credit both yourself and OS87 in their credits?
     
    #2
  3. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Unfair not to.
     
    #3
  4. JohnOminae

    JohnOminae Villager Member

    Messages:
    28
    Likes Received:
    17
    Location:
    [Redacted]
    First Language:
    English
    Primarily Uses:
    RMMV
    THANK YOU BreakerZero! I was literally trying to get this commissioned for the longest time.
    Seriously, thank you very much!
     
    #4
  5. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    v1.0.1 out, please update if you're having issues. I encountered a few undetected irregularities that require a bugfix release.
     
    #5
  6. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,234
    Likes Received:
    259
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Can I make a suggestion?
    Adding the option for the player to turn it on or off in the options menu.
    Because some people may not want it activated at some times.
     
    #6
  7. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Already on the roadmap. Thing is that this is literally my first submission of this kind, so anything that involved is something I'll have to properly analyze first.

    EDIT: I now have a baseline set for the switch function. It's a bit bare for now and you'll have to do some extra work to make a persistent status out of it (file system entries combined with a simple yes/no are the easiest option, and I'm adding a parameter to read the state off a control switch) but I have started to build this out in version 1.0.2 which is set for release later today. EDIT 2: it's up!

    EDIT 3: Obviously a global switch plugin may also work for this if you set the same switch for both purposes. Forgot to mention that earlier in case the file system method is not viable or functional.
     
    Last edited: Jul 25, 2019
    #7
    JohnOminae likes this.
  8. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    1.0.3 is out. I was recently alerted to the possibility of a crash if a gamepad is disconnected during or prior to gameplay which I have addressed in addition to refinements that should hopefully prevent the use of values outside accepted range (such that any excess defaults to supported values instead of being ignored completely).
     
    #8
  9. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,234
    Likes Received:
    259
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Hey BreakerZero, I don't understand, why is 0.1 the minimum? I mean, I understand it having to be higher than 0, but why 0.05 isn't acceptable for example?
     
    #9
  10. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Actually, the minimum is 0.2 as 0.1 doesn't do anything. I'm also enforcing a maximum time limit of 5000 milliseconds for the same reason.
     
    #10
  11. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,234
    Likes Received:
    259
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    @BreakerZero I hope you don't mind, I made an edit of your code... Your actual code is almost intact, though.

    I mainly did two things: one, I aded the option of rumble in the Options menu, so I removed your switch.
    It just makes more sense, and as you said you just didn't add it because you didn't know how...

    And two, I added a check to see which gamepad was the last one used, save its index, and that is the one that will rumble.
    I had to do it because... in your original code the gamepad to rumble is gamepad index 0. I use Switch Joycons as a gamepad through vjoy and a driver by fosse. That means my controller, the actual one with rumble working, is usually, but not always, index 3.
    With my change the gamepad will be detected and saved every time a button is pressed or an analog stick moved, its index will be saved, and it is that index that will be used for the rumble.

    Hope you don't mind. I added a few comments in case you want to see how I did it, but to be honest the options thing I learned from a couple Yanfly plugins anyway :p

    [Removed]

    [EDIT] Oh by the way, I removed the bZero.PlayTime object. I have no idea why it is there in your code, since it is never used...
     
    Last edited: Nov 4, 2019
    #11
  12. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    @Waterguy that was for development purposes which I ended up not having to use. As for the contribution, I will patch over to a new release later this morning.

    EDIT: It's up! The option access change has been patched to official release bringing the version to 1.0.4. If you were using the control switch method from before it has been removed to allow for the updated control mechanism so update your projects accordingly.

    EDIT 2: Change of plans. Temporary rollback initiated due to an unanticipated technical issue with the update.

    EDIT 3: Reuploaded with a change to access detection so that it doesn't trigger when entering the options menu pending further analysis. In the event that detection is resolved this will be restored in a future version.
     
    Last edited: Jul 29, 2019
    #12
  13. Waterguy

    Waterguy Veteran Veteran

    Messages:
    1,234
    Likes Received:
    259
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Sorry, I forgot to add a function on the plugin. It didn't give an error to me because I already had it in another one.
    Sorry for the mistake, hopefully it'll work fine now

    The link I posted earlier should already point to a fixed version. You removed the problem function calls from yours so it's no problem anyway, but just to explain to people it was a function that is in the GamepadConfig plugin that is for free in the rpg makers dlc folder. It is just there to only shows the option if there is a gamepad connected.
     
    Last edited: Jul 31, 2019
    #13
  14. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Didn't have a chance to mention earlier, but 1.0.5 is up. This release includes the auto-detection mechanism and the latest contributions to the plugin structure.
     
    #14
  15. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Small update. I've added the plugin as an attachment in the event that issues should ever arise from the mirror download.

    EDIT: Due to rampant theft in the community I am joining other plugin creators in moving to a paid distribution model. Therefore, this provision has been redacted and no longer applies.
     
    Last edited: Nov 4, 2019
    #15
  16. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Minor description update to account for x64 distribution mandates that are now required for compliance with Apple software developer agreements beginning with macOS Catalina. Please note that functional testing may be required to verify WebGL fallback due to the absence of OpenGL on newer macOS systems.
     
    #16
  17. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Major change in the status of the plugin. Like other creators I am moving the plugin to a distribution structure that will require a paid download and so I have temporarily removed the download links. The reason of course is the same as for other plugin creators: there has been a lot of theft going on, and the research between me and @Waterguy that helped to make this possible is not worth the trouble of keeping the plugin open to all. This may initially come off as a jerk reaction, however as I have just finished reading Yanfly's transition statement/retirement note I am doing this in solidarity. Therefore as I plan for release 2.0 (which will replace the current script call mechanic with a full plugin command implementation) I must unfortunately request that everyone immediately stop circulation of this plugin on penalty of suit. I take this very seriously and regret going to such extreme measures, however owing to the fact that the community as a whole is moving in this direction in light of the incidence I have no other choice in this matter.

    Again, this may come off as rush judgment to some of you, but I have literally just decided after reading the information from Yanfly and Olivia (among others) who have already taken the unfortunate decision to move their plugin development capacity to a for-pay model and I have decided that with all the work that went into this frequently-requested plugin that I will be making the transition as well.

    EDIT: Decision finalized. Payment will be required for all versions of the plugin.

    EDIT 2: The new download links are up. You can pay on either itch or Gumroad to update your license and download the required version of the plugin. This is not a negotiable matter - you must purchase a license for version 1.6 in order to legally use the plugin from now on (and that's not including existing downloads of 1.5 and earlier which beyond an immediate revocation of further recirculation rights are not subject to the new acquisition mandate). Again, this is not something that I do without reason but due to the work that went into this plugin I cannot reasonably support existing downloads without risking the possibility of exposing my work to any further intrusion upon the community.
     
    Last edited: Nov 10, 2019
    #17
  18. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Small update on the status of the transition. Even if the plugin download says that a license upgrade is required, I have decided after further consultation that I will not be enforcing this. You will continue to be able to use existing downloads from before the license change and will not have to pay twice.
     
    #18
  19. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Forgot to update the announcement of the change in licensing to reflect that I have restored legal support for 1.5 and earlier on a restricted provisional condition. This has now been addressed to avoid confusion on the matter.
     
    Last edited: Nov 10, 2019
    #19
  20. BreakerZero

    BreakerZero Veteran Veteran

    Messages:
    631
    Likes Received:
    266
    First Language:
    English (USA)
    Primarily Uses:
    RMMV
    Planning for a 1.7 before I investigate the command structure that I plan to use in the big 2.0 update. It will most likely not have any major changes, but I will advance the number anyway to account for the fact that I will simplify the process of installation by replacing the current plugin download with a package that also downloads and updates the NWJS runtime package.
     
    #20

Share This Page