Help Please: Trying to Design a Dance Mechanic

Discussion in 'Javascript/Plugin Support' started by dace21, Aug 14, 2019.

  1. dace21

    dace21 Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    English
    Hi there,

    I've been dabbling with RM for a long time, but never really sat down with it until just recently when I decided to begin designing a project that took place in a universe I've been building for a time through several mediums (board games, stories, art, etc.).

    While designing some of the skills, I thought it a good idea to incorporate a "Dance" mechanic wherein the user falls into a Dancing State and provides buffs to their allies.
    This is what it looks like:
    [​IMG]

    So, I looked online, downloaded Yanfly's Auto Passive States and the Passive Auras plugin for it to help with that. And things were working good.
    I created an origin and aura state and the buff worked (hallelujah!)

    I also created a state called "Dancing" which essentially shuts down that character until they finish their dance or take damage, thus also ending the aura buffs on all allies.

    However, I ran into 3 problems:
    1. Whenever my character uses this skill, they also get said buff, which I don't want happening. I'd like for only allies to receive the buff.
    2. My dancing state is not working quite like i'd intended. Like, at all. It just sort of sits there and counts itself down, doing nothing. As stated before, it's supposed to restrict that actor from acting, and be force removed when they take damage or when the number of rounds ends (thus ending the dance).
    3. apparently now said dance is also not activating it's skill. Or it is and it's deactivating immediately, which might be due to a flawed scripting in the notetag?
    [​IMG]
    The highlighted area is where the passive state is missing.

    The Skill I have activating my Origin[​IMG]

    The Origin State
    [​IMG]

    The Aura State
    [​IMG]

    All my current active (and inactive) plugins.
    Please Note that I also added in YEP_Z_PassiveCases as well just in case that might've helped.
    [​IMG]

    If anyone could please help, I'd be really grateful. I've been working on javascript, but I'm not fluent enough to solve this myself yet... I want to know where I went wrong so I can improve. Thank you all. If there's any way that I can provide anything else from my end, please let me know.
     

    Attached Files:

    #1
  2. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,076
    Likes Received:
    3,407
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    I would probably forego the use of Passive States and just use <Custom Apply Effect> and <Custom Apply Effect> notetags on the "origin" state (the one that the Dancer gets) to apply a "buffed by dancing" state to the rest of the party.

    Origin State: Cannot Move, Removed by Damage (or 5 turns), No Features
    Buffed by Dancing State: HP Regen or Stat Boost or whatever
    Skill simply applies the Origin State to the user (the dancer); notetags will handle the rest

    For the origin state, your notetags would look something like this. My syntax might be off. If these tags don't work, maybe someone can correct them or you can look through Yanfly's Tips & Tricks videos for similar effects. Be sure to replace x with the ID of the Origin State and y with the ID of the Buffed State. If the var members line throws an error, try changing it to var members = this.friendsUnit().aliveMembers(); and if that also doesn't work just use var members = $gameParty.members(); (which will limit this skill to being used only by characters, not enemies).

    <Custom Apply Effect>
    var members = this.friendsUnit();
    for (var m = 0; m < members.length; m++) {
    if (!(members[m].isStateAffected(x))) {
    members[m].addState(y);
    }
    }
    </Custom Apply Effect>

    <Custom Remove Effect>
    var members = this.friendsUnit();
    for (var m = 0; m < members.length; m++) {
    members[m].removeState(y);
    }
    </Custom Remove Effect>
     
    #2
  3. ramza

    ramza Lunatic Coder Veteran

    Messages:
    531
    Likes Received:
    290
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    You can forego the use of an actual passive state entirely. The state applied by the dance as the origin isn't passive, it's active. Make the origin state also make the actor immune to the aura state, and they won't get it at all.

    Your origin state should have restriction set to "Cannot Move" and remove by restriction should be off. Remove the passive conditions from the aura state entirely, as it isn't passive so it shouldn't have passive conditions.
     
    #3
  4. dace21

    dace21 Warper Member

    Messages:
    2
    Likes Received:
    0
    First Language:
    English
    This is pretty well what I needed to happen!
    Thanks so much.
    I will say, I'm still having a couple of bugs with it though.
    Firstly, when I activate the skill, or when it is removed, it takes an action for it to register that the aura has left the party. Is there a way to make it so that when the dancer is damaged or has the origin state removed for any other reason, the auras also immediately get removed?
    Secondly, my dancer is still under the influence of the buff.

    Apart from that, she doesn't act while dancing, and provides the buffs to allies and has them removed like I wanted. This is awesome!

    Thanks again, Ramza, Wavelength!
     
    #4

Share This Page