Jay's Dual Tech system

Discussion in 'JS Plugin Releases (RMMV)' started by HeroicJay, Oct 27, 2015.

  1. HeroicJay

    HeroicJay Veteran Veteran

    Messages:
    315
    Likes Received:
    173
    First Language:
    English
    Primarily Uses:
    RMMV
    A dual tech allows two characters to join forces and combine their skills into one more powerful skill. However, the use of one requires you to spend the cost of both characters' composite skills, so it can get quite MP (or TP) costly!

    To use it, just enter the following into the Note box of any skill:

    <Dual:Actor1ID,Actor1Skill,Actor2ID,Actor2Skill[,HitRate]>


    You can add more actors (up to ten, though you'll need an extra plugin to use more than four in battle, of course) by just listing them after Actor2's details and before HitRate.


    <Dual:Actor1ID,Actor1Skill,Actor2ID,Actor2Skill,Actor3ID,Actor3Skill,...[,HitRate]>


    Make sure the parameters (other than HitRate, if you use it) always come in pairs; one for the actor ID and one for the skill.

    The ActorIDs should be their database ID numbers; the Skills can either be skill names or ID numbers. So:

    <Dual:1,Fire,2,Ice>

    will work, so long as actor #1 learns Fire and actor #2 learns Ice.


    "HitRate" is optional, and accepts the following values:


    "user" - Uses the hit rate for the actor that used the skill.


    "first" or "actor1" - Uses the hit rate for the actor defined by Actor1ID.


    "second" or "actor2" - Uses the hit rate for the actor defined by Actor2ID.


    (You can go up to actor10, but only "first" and "second" are defined by written-out ordinal numbers.)


    "highest" - Between all actors, select the highest hit rate.


    "lowest" - Between all actors, select the lowest hit rate.


    NOTE: I have disabled the "sum" HitRate, since it doesn't really make a lot of sense even for two characters, and certainly not for more than that.


    If you don't set a HitRate, the hit rate will be the same as if you set it to "user". Magical and Certain Hit skills ignore hit rates anyway, so you may as well not bother with HitRate for those.

    For the damage formulae of dual and triple tech skills, you may refer to the actors with "c", "d", etc., with "c" being the first actor defined in the tag, "d" the second, and so on up to "l" (lowercase L). "a" still works for the one who initiated the skill, and "b" is, as always, the target.

    THINGS TO NOTE:

    For the time being, this dualtech script only uses the turn of one character (in fact, both associated characters can use the dualtech skill in the same turn, if they both can and you can afford the cost!)

    As dualtechs are (at least at present) tied to specific actors, you'll have to make new versions for different pairings, even if they know the same skills.

    Each party member has to learn the dualtech ability on their own. So if you want both party members calling it, teach both of them the dualtech skill. If you want one character to always initiate it, give it only to that one. However, the dualtech will only appear when the composite spells are learned and both characters are in the party, so feel free to teach every single one at level 1 if you don't want to have special unlock conditions for them.


    If you want to break the dependency of a dualtech on another tech, set it as a component to itself. This can be done for either or both of the actors defined in the skill. If you do this, the actor will use any MP or TP costs (or any other costs from plugins) associated with the dualtech skill in the database. Otherwise, the actor will ignore those costs and only spend the cost of the component skill.

    You can also teach the skill to a character not defined in the tag, which will (for that actor alone) treat the user as a part of the tech, and the user's "component" will be the tech itself. If you do this, however, it is not recommended to define the tech as a component for itself for any other actor.

    It lists the actors' names in the skill cost, which can get really, really unwieldy. To combat this, if you define Game_Actor.icon() to return icon IDs for each actor, you'll get icons instead. Down below, I have a small snippet of code that can do this for you (but there are other, more flexible ways to do it.) Or you can use the cycle parameters, mentioned below.

    This script is now fully compatible with Yanfly's SkillCore 1.01 and SkillCooldowns 1.02a! For compatibility purposes, please put this plugin below all plugins that modify skill cost or skill cost display in any fashion (plugins that do this that I'm aware of are the two aforementioned Yanfly plugins and Unconnected42's Ammunition plugin.)


    If you are using skill costs that come from a universal resource pool (in other words, something the entire party can access like money or items, not something individual like HP, MP, or TP) it is heavily recommended that you do not give the same type of cost to multiple actors for the same dualtech! (For instance, it is not recommended that Actor 1 uses a skill that uses up one Potion and Actor 2 uses a skill that uses up two Potions. If you have exactly two Potions, the plugin will actually let you use the skill and wind up with negative one Potions.) If the cost for each actor comes from a different pool (like Actor 1 uses a Potion, and Actor 2 uses a Hi-Potion), that's okay, whether it's universal or not. Or, if you have a plugin that allows you to define extra restrictions beyond cost, you can simply set the dualtech to require you to have three Potions in your inventory (for the above example).


    You don't need to worry about this one unless you're a plugin creator yourself: If you write a plugin that modifies Window_SkillList.drawSkillCost, please have it return the width of the remaining space after drawing the cost in order to maintain compatibility with this plugin. The function returns nothing in the base engine (which the plugin accounts for... by treating no return value as though it was looking at the base engine's version of drawSkillCost). To see an example of what I mean, Yanfly's plugins already do that.



    I have added parameters with version 1.0.3 to allow the skill windows to cycle through the actors involved in a dualtech instead of displaying them all at once. For very short skill costs and icons, this is probably not useful, but for long skill costs coupled with names, it can save a lot of space!

    This script does not, in any way, modify animations. I would recommend using a plugin like Yanfly's Action Sequence if you're using a side-view system.


    NEW!!


    If you do not wish to show the user of the skill when the user does not have any cost (MP, TP, or otherwise), you can set the "Always Show User" parameter to false. This will only hide the user of the skill, no one else, and only when they have no cost of any sort. This is compatible with Cycle Actors if you're using that.

    Screenshots:


    Spoiler




    How it looks (with Game_Actor.icon() defined and appropriate icons included):
    [​IMG]

    The skill being used. Note that both Therese and Marsha lost MP.
    [​IMG]

    How it should look in the database. Actor 2 (Therese) is the first one defined in the "Dual" tag, so she's "c" in the formula. Marsha is "d". Whoever initiates the command is "a".
    [​IMG]

    Whoops, Therese forgot to bring her axe this time! Power Slash requires an axe, so even though we're in Marsha's command window, and even though Fire Slash itself has no weapon requirements, Fire Slash won't be available.
    [​IMG]

    Whoops, Marsha forgot to bring her Therese this time! Without Therese, the skill doesn't even appear on Marsha's skill list.
    [​IMG]

    Turn Linking under Yanfly's CTB and ATB!

    Yep, it's that update that kept not happening, and it's here! Well, for Yanfly's CTB and ATB, at any rate. This is in beta, so be forewarned of (and please report) any bugs.

    In order to use turn linking, make the first parameter of the Dual tag "Linked", like so:

    <Dual:Linked,1,Move1,2,Move2,HitRate>

    If the dualtech is linked, then it takes everyone's turn to use it, and it will only activate once everyone has had a turn from the moment the first member activates the skill. If, for any reason, the skill becomes unusable before everyone is ready, it's canceled and everyone gets their turns back.

    In CTB, the characters who are waiting for the other actors to get ready disappear from the CTB list; this is expected behavior (in best case, they'd somehow get stacked with the other party members, but I'm pleased enough it's working as well as it is for now.) As the last actor gets their turn, their icon will switch over to the FIRST actor, who uses the dualtech (that's just kinda how it worked out, but could be changed in the future.) After the skill is used, everyone should be returned to the CTB list as normal.

    The Plugin!

    I'm no longer supporting this version; give me a bit before I give an update here.
     
    Last edited: Apr 5, 2019
    #1
    Lord Balen, Archeia, Kazami and 29 others like this.
  2. vinilodeon

    vinilodeon Villager Member

    Messages:
    11
    Likes Received:
    0
    Location:
    Switzerland
    First Language:
    German
    not working for me.. The skill is invisible
     
    #2
  3. HeroicJay

    HeroicJay Veteran Veteran

    Messages:
    315
    Likes Received:
    173
    First Language:
    English
    Primarily Uses:
    RMMV
    Not enough info to diagnose the problem.

    1) Can you take a screenshot of the dualtech skill you set up?

    2) Are both characters involved in the active party and capable of using the component skills?

    3) Did you remember to teach the dualtech skill to at least one of your characters?
     
    Last edited by a moderator: Oct 27, 2015
    #3
  4. vinilodeon

    vinilodeon Villager Member

    Messages:
    11
    Likes Received:
    0
    Location:
    Switzerland
    First Language:
    German
    1)  http://postimg.org/image/k4hgpju9v/

    2) Yes

    3) Sure, for both.. If i remove the <Dual:1,190,2,181> the skill is visible again

    Thanks
     
    #4
  5. HeroicJay

    HeroicJay Veteran Veteran

    Messages:
    315
    Likes Received:
    173
    First Language:
    English
    Primarily Uses:
    RMMV
    Hm, that's weird. What are all the skills known by actors with ID 1 and 2?
     
    #5
  6. vinilodeon

    vinilodeon Villager Member

    Messages:
    11
    Likes Received:
    0
    Location:
    Switzerland
    First Language:
    German
    Actor 1: 190 - Blade and 185 - Fire Blade

    Actor 2: 181 - Fireball and 185 - Fire Blade

    I'm using all Yanfly plugins. Would it be maybe incompatible?
     
    #6
  7. HeroicJay

    HeroicJay Veteran Veteran

    Messages:
    315
    Likes Received:
    173
    First Language:
    English
    Primarily Uses:
    RMMV
    For my main project, I'm using several Yanfly plugins myself, though not all of them. Let me set up a dummy project with all of the Yanfly plugins active myself.

    ...

    Every single Yanfly plugin and (both in and out of battle) I'm seeing the skill. How about this: what order are your plugins placed in? A screenshot will do.
     
    Last edited by a moderator: Oct 27, 2015
    #7
  8. vinilodeon

    vinilodeon Villager Member

    Messages:
    11
    Likes Received:
    0
    Location:
    Switzerland
    First Language:
    German
    Well so

    http://postimg.org/image/l32boe3oj/
     
    #8
  9. HeroicJay

    HeroicJay Veteran Veteran

    Messages:
    315
    Likes Received:
    173
    First Language:
    English
    Primarily Uses:
    RMMV
    Oooooooh, I already have a bad feeling about it being ABOVE BattleAICore and SkillCore. Core plugins really should go to the top. Let me bump mine up a bunch of places and see if that repros.

    ...

    But no. It doesn't display correctly when I put it above everything but CoreEngine and BattleEngineCore, but it still displays. I'm stumped.

    Er, you did remember that actors ID 1 and 2 are ID 1 and 2 in the database, not the party order? That's about the only thing left I can think of at this point.
     
    Last edited by a moderator: Oct 27, 2015
    #9
  10. vinilodeon

    vinilodeon Villager Member

    Messages:
    11
    Likes Received:
    0
    Location:
    Switzerland
    First Language:
    German
    I cut the script and paste at top, bottom and middle.. not working already
     
    #10
  11. HeroicJay

    HeroicJay Veteran Veteran

    Messages:
    315
    Likes Received:
    173
    First Language:
    English
    Primarily Uses:
    RMMV
    Okay, he actually sent me his game, and I found the issue: if you "teach" a skill through the Traits menu, the game's system doesn't count it as being "learned" per se. Therefore, even though the skills were completely usable, they weren't being counted as "learned" and, thus, the dualtech was unusable.

    While at least that does clear up the issue, I do consider that a flaw in the design, so I will be looking into fixing that.

    And have; I've updated to version 1.0.1. Now skills added through Traits or States or anything else that rhymes with those two words should be able to contribute properly to dualtechs.

    (I'd still like to fix that skill cost display issue - I saw enough of vinilodeon's game to know that he's hitting it big time - but one thing at a time.)
     
    Last edited by a moderator: Oct 27, 2015
    #11
    vinilodeon likes this.
  12. Lionheart_84

    Lionheart_84 Veteran Veteran

    Messages:
    463
    Likes Received:
    42
    First Language:
    Italian
    Great plugin ... but I do not understand how to bring up the icons of the actor .... :unsure:
     
    #12
  13. vinilodeon

    vinilodeon Villager Member

    Messages:
    11
    Likes Received:
    0
    Location:
    Switzerland
    First Language:
    German
    This script is really awesome when combined with yanfly scripts :D
    Thx a lot


     
    #13
  14. Jenza

    Jenza Veteran Veteran

    Messages:
    40
    Likes Received:
    7
    First Language:
    English
    Oh that is cool!

    Gives me plenty of ideas!
     
    #14
    Adlw and vinilodeon like this.
  15. Kipplentoast

    Kipplentoast Villager Member

    Messages:
    10
    Likes Received:
    5
    First Language:
    English
    I'm with you there, not quite sure how to define the Game_Actor.icon() to return icon IDs. any chance someone can explain this?

    Other than that, this is an amazing script and i am so excited to utilize it, once my Actors names stop displaying over the costs.
     
    Last edited by a moderator: Oct 28, 2015
    #15
  16. HeroicJay

    HeroicJay Veteran Veteran

    Messages:
    315
    Likes Received:
    173
    First Language:
    English
    Primarily Uses:
    RMMV
    It's actually pretty simple. There are multiple ways to do it, and this one is probably easiest (though it limits you to one icon per actor for the entire game, so it will be inadequate if you want to change sprites partway through):

    Game_Actor.prototype.icon = function() { if (this.actor().meta.icon) return Number(this.actor().meta.icon); else return 0;}I'm not at my RPG Maker computer right now to test, but that should work. Then just plop icons that resemble your characters into system\IconSet.png, and put <icon:#> in each actor's Note box, with the number being the icon ID for that actor.
     
    Last edited by a moderator: Oct 28, 2015
    #16
    Kipplentoast likes this.
  17. Kipplentoast

    Kipplentoast Villager Member

    Messages:
    10
    Likes Received:
    5
    First Language:
    English
    Thanks for the quick response, Jay, and i am definitely not trying to get you to do all the work for me, but where am I supposed to place that snippet?

    I attempted to just plop it into my project as it's own tiny plugin and put it above your developed plugin, which didn't work... but I wanted to make sure I gave it a quick test before begging for more hand holding. I know next to nothing about Java, so I'm hesitant to go inserting that code snippet willy-nilly.
     
    #17
  18. HeroicJay

    HeroicJay Veteran Veteran

    Messages:
    315
    Likes Received:
    173
    First Language:
    English
    Primarily Uses:
    RMMV
    No, that's my mistake. Sorry. That's why you shouldn't write code when you can't test it. :p I fixed it above; try it now.

    And just putting it wherever in the plugins directory is fine; I just screwed up in writing it.

    Anyway, so my text width dilemma. I suppose the simple solution would write two versions: one for Yanfly's Skill Core and one for the default, and just say it's not compatible with any other skill cost displays at present? I'd prefer something more generic, but for right now it's the best solution I have. Ugh, but even that one seems a bit invasive to the Yanfly code to do right. :( I just wish I had a simple way of calling the width of text that's already been placed...

    EDIT: So here's the thing. I now have a version that works, but it duplicates a good chunk of Yanfly's code (though also fixing what I believe to be a bug in said code), just because I don't have any better solutions.  I think that's probably a bit of a gray area at best where legality is concerned, and as such I am so far not pasting it here.
     
    Last edited by a moderator: Oct 28, 2015
    #18
  19. Lionheart_84

    Lionheart_84 Veteran Veteran

    Messages:
    463
    Likes Received:
    42
    First Language:
    Italian
    I can not even appear among the icons of the characters ... How do you ???
     
    Last edited by a moderator: Oct 28, 2015
    #19
  20. HeroicJay

    HeroicJay Veteran Veteran

    Messages:
    315
    Likes Received:
    173
    First Language:
    English
    Primarily Uses:
    RMMV
    Do what I said in this post:

     
    #20

Share This Page