DoubleX RMMV Linked Battlers

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,469
Reaction score
545
First Language
Chinese
Primarily Uses
N/A
Note


This plugin's available for commercial use


Purpose


Lets users set some states to let their owners share some stats


Games using this plugin


None so far


Notetags

* # State Notetags:
* 1. <linked battlers: LBCX, LBSX, LBWX>
* - Sets all owners of this state meeting LBCX to share stats
* included in LBSX with weight LBWX applied to each of them when
* any included stat of any included battler changes
* - Only the 1st applicable notetag of the state with the highest
* priority will be applied to the stat change of the linked battler
* - If a linked battler can't take all of that battler's share of the
* original stat change due to hitting the min/max stat value, thost
* not being taken by that battler will be shared by the rest of the
* linked battlers also
* - The battler originally having a stat to be changed is the last
* linked battler taking the change not shared by any other ones
* - LBCX can be set in Linked Battler Condition Functions
* - LBSX can be set in Linked Battler Stat Functions
* - LBWX can be set in Linked Battler Weight Functions




Plugin Calls

* # Configuration manipulations
* 1. DoubleX_RMMV.Linked_Battlers.prop
* - Returns the property prop under DoubleX_RMMV.Linked_Battlers
* 2. DoubleX_RMMV.Linked_Battlers.prop = function
* - Sets the property prop under DoubleX_RMMV.Linked_Battlers as
* function which will be bound to the battler upon use
* - No DoubleX_RMMV.Linked_Battlers.prop change will be saved
* # State manipulations
* All meta.linkedBattlers changes can be saved if
* DoubleX RMMV Dynamic Data is used
* 1. meta.linkedBattlers
* - Returns an Array of all LBCX-LBSX-LBWX triples, each in the form
* of [LBCX, LBSX, LBWX]
* 2. meta.linkedBattlers = [[LBCX, LBSX, LBWX], [LBCX, LBSX, LBWX], ...]
* - Resets the Array of all LBCX-LBSX-LBWX triples, each in the form
* of [LBCX, LBSX, LBWX], stored sequentially in that Array
* 3. meta.linkedBattlers = [LBCX, LBSX, LBWX]
* - Sets the (i + 1)th LBCX-LBSX-LBWX triple as LBCX-LBSX-LBWX









 





Configurations













/*------------------------------------------------------------------------
* Linked Battler Condition Functions
* - Setups LBCX used by <linked battlers: LBCX, LBSX, LBWX>
*------------------------------------------------------------------------*/
/* LBCX are used in functions included in LINKED_STATS
* LBCX are functions that will be bound to battler calling them upon use
* LBCX names can only use alphanumeric characters
* Each linked battler besides the caller can be referenced by battler
* The caller will always pass LBCX even when it's supposed to fail
* The below LBCX are examples added to help you set your LBCX
* You can freely use, rewrite and/or delete these examples
*/

// Sets the linked battler condition to include all linked battlers
LBC1: function(battler) { return true; },

/* Sets the linked battler condition to include all and no linked battlers
* if switch with id x is on and off respectively
*/
LBC2: function(battler) { return $gameSwitches.value(x); },

// Adds new LBCX here


/*------------------------------------------------------------------------
* Linked Battler Stat Functions
* - Setups LBSX used by <linked battlers: LBCX, LBSX, LBWX>
*------------------------------------------------------------------------*/
/* LBSX are used in functions included in LINKED_STATS
* LBSX are functions that will be bound to battlers upon use
* LBSX names can only use alphanumeric characters
* It must return an Array, which should include all strings of getter
* functions of each stat to be included
* The below LBSX are examples added to help you set your LBSX
* You can freely use, rewrite and/or delete these examples
*/

// Sets the linked battler stat to include hp, mp and tp
LBS1: function() { return ["hp", "mp", "tp"]; },

// Sets the linked battler stat to include nothing
LBS2: function() { return []; },

// Adds new LBSX here


/*------------------------------------------------------------------------
* Linked Battler Weight Functions
* - Setups LBWX used by <linked battlers: LBCX, LBSX, LBWX>
*------------------------------------------------------------------------*/
/* LBWX are used in functions included in LINKED_STATS
* LBWX are functions that will be bound to battlers upon use
* LBWX names can only use alphanumeric characters
* It must return a Number
* No stat change will take place for any linked battler if the sum of all
* weights of all linked battlers is 0
* Each linked battler besides the caller can be referenced by battler
* The below LBWX are examples added to help you set your LBWX
* You can freely use, rewrite and/or delete these examples
*/

// Sets the linked battler weight to be the same for all linked battlers
LBW1: function(battler) { return 1; },

/* Sets the linked battler weight to be multiplied by x if the linked
* battler is the one having a stat to be changed
*/
LBW2: function(battler) { return battler === this ? x : 1; },

// Adds new LBWX here


/* Sets the battler functions to be used by linked battlers
* Its property names must be the battler stat getter function names
* Its values must be Arrays, each containing the battler stat setter
* function name, the index of the argument as the original new stat value
* in the stat setter function argument list, and each linked battler's
* min/max stat value
* All battler functions as min/max stat value must be referenced by this
* All the included battler stat getter functions will be extended
*/
LINKED_STATS: {

/* General form:
* FunctionClass: {
* getter: ["setter", statArgIndex, "statMin", "statMax"]
* }
*/

Game_BattlerBase: {
/* General form:
* getter: ["setter", statArgIndex, "statMin", "statMax"]
*/
hp: ["setHp", 0, "0", "this.mhp"],
mp: ["setMp", 0, "0", "this.mmp"],
tp: ["setTp", 0, "0", "this.maxTp()"]
// Adds new functions here

}

// Adds new classes here


}









 





Prerequisites





1. Some Javascript coding proficiency to fully utilize this plugin





 





Terms Of Use





You shall keep this plugin's Plugin Info part's contents intact





You shalln't claim that this plugin's written by anyone other than DoubleX or his aliases





None of the above applies to DoubleX or his/her aliases





 





Changelog













 *      v1.00d(GMT 1500 29-1-2016):                                           
 *      1. Fixed undefined g in Proto[func[0]] bug                            
 *      2. Fixed passing getter instead of its name to linkedBattlersStateId  
 *      3. Fixed calling getter via this[getter] instead of this.getter       
 *      4. Fixed state.linkedBattlers instead of state.meta.linkedBattlers bug
 *      5. Fixed adding 2 Arrays instead of concatenating them bug            
 *      6. Fixed undefined battler isStateAdded bug                           
 *      7. Fixed linked battlers' stats being possible to be non-integer bug  
 *      8. Only the target will collapse when some others die at the same time *      v1.00c(GMT 1400 31-12-2015):                                          
 *      1. Fixed writing getter contents directly instead of using String bug
 *      v1.00b(GMT 1100 28-12-2015):                                          
 *      1. Fixed unintentionally declaring global variable in strict mode bug
 *      2. Fixed using new Function and class instead of eval and prototype  
* v1.00a(GMT 1400 23-12-2015):
* 1. 1st version of this plugin finished









 





View attachment DoubleX RMMV Linked Battlers v100d.rar
 
Last edited by a moderator:

Fernyfer775

Veteran
Veteran
Joined
Oct 6, 2013
Messages
1,310
Reaction score
812
First Language
English
Just to make sure I understand this correctly. With this, I can essentially create a monster/enemy with let's say, 3-4 different body parts, but they're all linked as part of the MAIN enemy? Like, a squid monster for example?
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,469
Reaction score
545
First Language
Chinese
Primarily Uses
N/A
Just to make sure I understand this correctly. With this, I can essentially create a monster/enemy with let's say, 3-4 different body parts, but they're all linked as part of the MAIN enemy? Like, a squid monster for example?
Yes, and if their mhp/mmp/maximum tp/etc are also the same, then their hp/mp/tp will be always the same too :)
 

DustyCat Media

Indie Game Purrfector
Veteran
Joined
Oct 15, 2012
Messages
115
Reaction score
71
First Language
English
Awesome. I plan a huge boss for my first level composed of multiple body parts. :D  ..Thanks!
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,469
Reaction score
545
First Language
Chinese
Primarily Uses
N/A
Updates

Code:
 *      v1.00b(GMT 1100 28-12-2015):                                           *      1. Fixed unintentionally declaring global variable in strict mode bug *      2. Fixed using new Function and class instead of eval and prototype  
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,469
Reaction score
545
First Language
Chinese
Primarily Uses
N/A
Updates

Code:
 *      v1.00c(GMT 1400 31-12-2015):                                           *      1. Fixed writing getter contents directly instead of using String bug
 

Shiroi Akuma

Shut up and take my Monet    ( ͡° ͜ʖ ͡°)
Veteran
Joined
May 11, 2015
Messages
350
Reaction score
275
First Language
German
Primarily Uses
N/A
Did anyone try this plugin already out? Are the movements also linked? I use Yanfly Action Sequences II, so if the main part is moving will the linked battler move along with it, so that they are synchronized? Or does it affect only HP/TP/MP?
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,469
Reaction score
545
First Language
Chinese
Primarily Uses
N/A
Did anyone try this plugin already out? Are the movements also linked? I use Yanfly Action Sequences II, so if the main part is moving will the linked battler move along with it, so that they are synchronized? Or does it affect only HP/TP/MP?
Right now it doesn't affect movements at all :)
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,469
Reaction score
545
First Language
Chinese
Primarily Uses
N/A
Updates

Code:
 *      v1.00d(GMT 1500 29-1-2016):                                           
 *      1. Fixed undefined g in Proto[func[0]] bug                            
 *      2. Fixed passing getter instead of its name to linkedBattlersStateId  
 *      3. Fixed calling getter via this[getter] instead of this.getter       
 *      4. Fixed state.linkedBattlers instead of state.meta.linkedBattlers bug
 *      5. Fixed adding 2 Arrays instead of concatenating them bug            
 *      6. Fixed undefined battler isStateAdded bug                           
 *      7. Fixed linked battlers' stats being possible to be non-integer bug  
 *      8. Only the target will collapse when some others die at the same time
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,469
Reaction score
545
First Language
Chinese
Primarily Uses
N/A
Hm...


I wonder if I can somehow use this with Yanfly's Absorption Barrier Plug-In, so that there can be some sort of shared shield between fighters...
I've checked how that plugin works, and I think that it's better for Yanfly to add the linked barriers features, because:


1. If my linked battlers were to work with his/her barrier plugin, I'll have to write a compatibility fix involving really complicated and convoluted logic, in which I don't think I'm up to the task yet.


2. On the user level, this at least involves adding a user configuration determining whether the damage redistributed to barriers will also have to go through the penetration calculation, and I think that it's better to be conforming with Yanfly's style.


So even if I were to do the job, I'd make an addon to Yanfly's barrier plugin, and ask for his/her permissions instead :)
 
Last edited by a moderator:

Jmsme131

Villager
Member
Joined
Mar 2, 2017
Messages
6
Reaction score
2
First Language
english
Primarily Uses
RMMV
This is exactly what I've been looking for! Thanks!
 

Jmsme131

Villager
Member
Joined
Mar 2, 2017
Messages
6
Reaction score
2
First Language
english
Primarily Uses
RMMV
One question: I cannot seem to get all linked battlers to collapse once HP is 0 only the last target. Any suggestions?
Looking through the changelogs I see this is intentional I think?
 
Last edited:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,469
Reaction score
545
First Language
Chinese
Primarily Uses
N/A
One question: I cannot seem to get all linked battlers to collapse once HP is 0 only the last target. Any suggestions?
Looking through the changelogs I see this is intentional I think?
This is a known bug where I still haven't managed to find a way to fix it. Thanks for reminding me about this issue :)
 

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

Latest Threads

Latest Profile Posts

Well it's been almost a whole year since I joined RMW, so i figured I should update my status.
This is my updated status.
Here's a sample of some pixel edits I made.

Maybe for use as sidewalks.
If there are any mods or admins online, could you please see about the re-translation pages for RPG Maker MV? They are all down :rsad:
Werewolf cons: you lose control of yourself once a month and could accidentally kill your friends. Vampire cons: no garlic bread. The choice is simple. Werewolf for sure.
2 huge market drops in 2 days. So glad I sold my non-dividend stocks about 2 weeks ago. And if the dividend ones drop heavily, hey more cheap stocks for me!

Forum statistics

Threads
94,527
Messages
921,608
Members
124,378
Latest member
friskyomega
Top