Lecode Tactical Battle System 0.77.2B

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
813
First Language
English
Primarily Uses
RMMV
I dint use the default atk, too much headache
Instead i use the extra skill and put that on each weapon, so each weapon gets its own skill.
Then i remove attack from commands available

Did Yanflys weapon unleash work before?
Yea that was pretty much the solution I ended going with too. Haven't tested the actual "unleash" part of yanfly's plugin tho. I really hope it works cuz it's a core feature of my game. I assume as long as a skill has the "normal attack" state/trait then it should trigger...I hope.
Edit: For some reason...
<letbs_commands>
skill[8]
</letbs_commands>
...only works when I put it on the actor and has no effect when I put it on a weapon. :/

Then I tried only leaving [extra] in the commands plugin options and got "ReferenceError: extra is not defined", even tho I had a state on that had...
<letbs_commands>
skill[8]
</letbs_commands>

So basically, it's not recognizing [extra] at all...

I just tested it on the completely stock demo project, the same thing. Doesn't read [extra] at all...

EDIT: Solved! It appears you have to put...
<letbs_commands>
move 82, [extra], skills 79, items 182, scan 75, pass 75
</letbs_commands>
...in the actor notetag. Simply putting it in the plugin options have no effect for some reason.

Edit2: So I made a workaround to the attackTimesAdd thing. Basically I remembered I created a conditional for my passive -20% hit chance state for dual wielders:
JavaScript:
if (user.equips()[0] && user.equips()[1] && !user.isWtypeEquipped(5) && !user.isWtypeEquipped(6) && !user.isWtypeEquipped(7)) {
So my question is, what's the correct syntax to put this into sequence form? Is this correct?

JavaScript:
"if: entity('user').user.equips()[0] && entity('user').user.equips()[1] && !entity('user').user.isWtypeEquipped(5) && !entity('user').user.isWtypeEquipped(6) && !entity('user').user.isWtypeEquipped(7)",
Or do I need to change all instances of "user" to "battler()"?
Edit3: This is my actual full conditional for the sequence lol, it works perfectly!
Code:
"if: entity('user').battler().isStateAffected(16) || entity('user').battler().isStateAffected(22) || (entity('user').battler().equips()[0] && entity('user').battler().equips()[1] && !entity('user').battler().isWtypeEquipped(5) && !entity('user').battler().isWtypeEquipped(6) && !entity('user').battler().isWtypeEquipped(7))",
"effects: {aoe}_battlers, current_obj, obj_anim",
"wait: 10",
"effects: {aoe}_battlers, current_obj, obj_anim",
"else",
"effects: {aoe}_battlers, current_obj, obj_anim",
"end_if",
DUAL WIELDING FINALLY WORKS AS INTENDED!!:kaocry:
 
Last edited:

eaufidrane

Villager
Member
Joined
May 11, 2020
Messages
27
Reaction score
0
First Language
english
Primarily Uses
RMMV
hello guys ! can somebody help me to fix the error? i really need a help
i dont know how to fix this kind of issue. i cannot procces a battle to other maps that i wanted to have a battle on it

but the first battle is working fine
what seems to be the problem?
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
hello guys ! can somebody help me to fix the error? i really need a help
i dont know how to fix this kind of issue. i cannot procces a battle to other maps that i wanted to have a battle on it

but the first battle is working fine
what seems to be the problem?
How is the battle map set up.
You say Actor and Enemy entities are configured.
1. Did you copy these from the demo map, or make them yourself? in the latter, send a screenshot of the events
2. Are these on the BATTLE map or the transitional map

Do the enemies you are pulling have configured sprites?
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
813
First Language
English
Primarily Uses
RMMV
Crap, weapon unleashes don't work at all... @Pharonix are you using YEP_WeaponUnleash as well? If so, have you found a fix?

Hmm, maybe I could have it give a state and then do a conditional w/ some RNG thrown in to simulate a weapon unleash in the sequences... It would be quite tedious though.
 
Last edited:

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
I don't use weapon unleash, nor do i actually know what it does.
I can only inference that theres a special ability in the weapon or something.
Care to fill me in? Otherwise I'll need to go back and look at yanfly videos.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
813
First Language
English
Primarily Uses
RMMV
It basically just gives the weapon a x% chance to proc a skill of your choosing when you normal attack. Its other feature was allowing you to change the character's normal attack to something else, but that feature is not necessary w/ LTBS commands. Here's an example notetag of a weapon unleash:
<Weapon Unleash 100%: 8>
you can choose the % proc chance and the skill ID of the skill that will be cast when it procs. In short, it's a % chance to change your normal attack into something else. It can also be used on shields for a block unleash.
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
Hmm, I see.

I'll need to add in Weapon Unleash then, and add some console debugging to see if its even proccing, or if something else is going on.
With my new code, it would be entirely possible to do this
EDIT: In regards to sequence building I should say. This will take some time to properly test the unleash and see what the heck is going on.
I feel like it might be something to do with Sequences but I'm not entirely sure
I would need to know how its being use in conjunction with skills/sequences
End EDIT.


Should the skill be proc'd on all hits? or only on the standard attack?
 
Last edited:

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
813
First Language
English
Primarily Uses
RMMV
I believe it should proc on all skills w/ the Normal Attack trait. And of course, I only set it at a 100% proc rate for testing purposes. It should be much lower in actual gameplay.
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
I have no idea if what I just Pm'd you will work, but if it does, it will likely revolutionize this plugin.
 

eaufidrane

Villager
Member
Joined
May 11, 2020
Messages
27
Reaction score
0
First Language
english
Primarily Uses
RMMV
How is the battle map set up.
You say Actor and Enemy entities are configured.
1. Did you copy these from the demo map, or make them yourself? in the latter, send a screenshot of the events
2. Are these on the BATTLE map or the transitional map

Do the enemies you are pulling have configured sprites?

sorry but what do u mean how is the battle map set up?
i always set it up in a usual way like
when i talk to someone then transfer the hero to the battle field like the old pattern we have and place some letbs win conditions.

like i said the battle works fine on the demo map but when i try to create a map and procces a battle on that map and then this error occurs.
i didnt change anything even the enemies in that battle so i believe that the sprite has nothing to do with this error

so what should i do next to determine the error?
 

Calluses

Bee
Veteran
Joined
Mar 17, 2019
Messages
36
Reaction score
57
First Language
English
Primarily Uses
RMMV
so what should i do next to determine the error?
I'm not too sure if you've already done it, but making a new map and trying again might be a good idea. Make sure to use the same events and battle troop, with the same actors in the party. The only thing you should change is in the event that transports you to the demo map, change the transition to the new map. If none of this works, or this is how you already did it, then it might be a problem with the map-size, or an entirely different error. I can remember having this problem a long while back but can't remember how I fixed it.

Good luck though, hopefully someone finds out what's wrong.
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
The Bandit Troop Event loads a TBS Trigger.
Try removing this, or cloning the troop and removing it from the clone and try using that.
1593013056056.png

Or make sure there's an event #10 on the battle map.
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
Good News Everyone.

I've finally started getting around to creating a general utility plugin for LeTBS.
This will include multiple features and functionality changes and tweaks that should help you guys out, as
well as some bug fixes.

The one thing I am not sure of is the compatibility with 77.2B, as I use 77 base, but in theory, it should work fine.

I will update this comment with a link when its ready.
If there's any of my fixes you absolutely want from earlier posts, please let me know.
I have a ton of code to go through at the moment, but thankfully 70% or so of my changes to my javascript files were documented.

I have done preliminary testing of my own and am waiting for @Frostorm to do some of his own testing, but if it works, this plugin will include support for, and instructions on implementing YEP_WeaponUnleash in LeTBS, as the current code does not support this.
The fixes inside do change quite a bit, but hopefully I'll have everything labelled as to what they do, so they'll be easy to comment out if you don't want that particular fix.


I have 2 plugins in the works right now.
I will update these change logs as I add more to them.


General Mod Utility
JavaScript:
/*
* ============================================================================
 * What it Does:
 * ============================================================================
 *
 * PHX Mod Plugin For LeTBS to add features and fixes for LeTBS
 * Place Under all other LeTBS plugins in your plugin manager
 *
 *
 * makes changes to getObjectSequenceData, makeScope, and adds support for YEP_WeaponUnleash
 *
 *
 *
 *
 * ============================================================================
 * getObjectSequenceData:
 * ============================================================================
 *
 * This allows the use of e.function() in sequence calls, as well as handle functions with parameters
 * This allows you to create skills that rely on a function to return which sequence should run.
 * Example:
 *
 * sequence: e.vorpal();
 * In my code, e.vorpal is a TBSEntity.prototype.vorpal = function () {} type function
 * and checks a rate of 10% 3 times, and increases the number of hits for each success.
 * this function returns "vorpal2" (the default) if none of the checks pass, and vorpal3, vorpal4 or vorpal5 based
 * on how many "hits" the skill should make.
 *
 *
 * ============================================================================
 * makeScope:
 * ============================================================================
 *
 * The changes made here are very simple.
 * With these changes, LeTBS now handles support for calling functions like
 * e.customSquare() and e.customSquare(param,goes,here) inside the scope.
 * That return strings for scope size, so you can do things like:
 * scope: square(e.customSquare())
 * where e.customSquare is a TBSEntity function such as
 *
 *  TBSEntity.prototype.customSquare = function () {
 *     if(this.getMovePoints()>2)
 *     {return 5;}
 *     else
 *     {return 3;}
 * };
 * This function returns 5 if the user's movement Points is greater than 2, otherwise it returns 3.
 * This is just an example, but this shows that you can now, with my code, adjust scopes with functions
 * based on states, or variables, etc.
 * you could even use things like this.battler() to call the actual battler, then use
 * this.battler().isStateAffected(id)
 * this would allow you to adjust scope if the user is affected with a state.
 *
 * ============================================================================
 * weaponUnleash:
 * ============================================================================
 *
 * Requires Yanfly's YEP_WeaponUnleash.js plugin to work. comment it out if you do not want to use
 *
 * Function is called as a sequence like so:
 *
 * sequence: e.weaponUnleash("atk", true)
 *
 * This function takes in 2 parameters seq, and isWeapon.
 *
 * seq: this is the default sequence that should be used if weapon unleash fails
 *
 * isWeapon: this boolean is used to separate weapon-unleashes from guard-unleashes. If this is true,
 * the unleash code checks for weapon unleash, if false, it checks guard unleash.
 *
 * How to Use:
 *
 * Weapon Notetag: normal Yanfly Weapon Unleash Tag
 * <Weapon Unleash 100%: 1911>
 * <Weapon Unleash chance: skillId>
 *
 *
 * Skill Notetag: use the regular sequence: sequenceId line in <LeTBS></LeTBS> like you would normally
 * "atk" is to be replaced by the sequence that should play normally, leave true for weapon skills and make it false for * * guard skills
 * sequence: e.weaponUnleash("atk", true)
 * sequence: e.weaponUnleash("dagger_attack", true)
 *
 * Setting Up "Unleash Skills"
 *
 * Weapon Unleashes this way end up using the new skill's sequence and the current one's damage formula
 * This can be Problematic for some users, so creating a skill to handle the "Unleash" as an interim works best
 *
 * For Example: My Dragon Dagger can unleash "Accel Rave" which slashes the enemy 12 times. This skill however is
 * skill 105, and I do not want to use the base dagger attack formula.
 * Therefore, my Dragon Dagger instead unleashes skill 1911 - "Dagger Unleash"
 *
 * Dagger Unleash is set up like a regular skill, but no damage formula and it calls the sequence "dagger_unleash"
 * via sequence: dagger_unleash
 *
 * dagger_unleash sequence is very simple, as all it does is force the user to use a different skill.
 * by doing this, the user of the dragon dagger's unleash uses the forced skill's damage formula and sequence,
 * thereby effectively Unleashing the Power of the Weapon
 *
 * Unleash Sequence:
 *    "dagger_unleash": [
 *       "use_skill: user, 105",
 *   ],
 * All this does is force the user to use skill 105, which is my skill ID for Accel Rave.
 *
 * This may all seem unnecessarily complex, but Yanfly's Weapon Unleash, as is, is incompatible, but by modifying how
 * LeTBS handles functions as sequences, we can do amazing things.
 *
 *
 *
 * ============================================================================
 * Other Fixes:
 * ============================================================================
 *
 *
 * ===========
 * Positioning
 * ===========
 * Added support for variable-based actor cells
 * <Var Cell: x> / <Var Cell: 5>
 * Loads the value stored in Variable x, and loads that actor. Useful for Battles where you "split"
 * the party.
 *
 * Added support for switch-based actor cells
 * <Switch Cell: x>
 * Loads Switch x, and if it is on, pulls that actor in.
 * Good for Permadeath and merc recruiting where you don't want mercenaries in the party, but want them
 * in battle.
 *
 * Added support for leader-based actor cells (Party Leader auto-positioning
 * <Leader Cell
 * Loads the Party leader into the cell.
 *
 * Added support for neutral positioning cells that can be used by enemies or actors
 * <Entity Cell>
 * Denotes a "Neutral" cell, where an enemy or ally can begin. If left unoccupied by enemy positioning
 * it allows the player to place a character there. Uses the Neutral Color Parameter
 *
 * Added custom color for neutral positioning
 *
 * Added logic to determine of all player entities are placed in the pre-positioning phase.
 * If this is the case, the battle is immediately started, eliminating the need for the player
 * to "Confirm" they are ready. Eliminates a bug where you could "Cancel" on a pre-placed unit.
 * Causing the game to crash.
 *
 * Fixes issues when trying to use moveable events for positioning. Before it was using the Game Map event location,
 * and not the actual event location.
 * ===========
 *
 * Charmed
 *
 * Fixed "Charm" System.
 * Lecode used isAlly and isEnemy to determine which side the enemy/
 * target was on, rather than using isAlly to determine if the target
 * was an actual Ally of the user.
 *
 * This resulted in crazy situations where the ally and enemy arrays
 * for a confused user were identical, resulting in the AI getting confused.
 * Any confused AI will continue to beat up their own allies, until the
 * confusion wears off, the user dies, or all their allies are dead.
 *
 * In these cases, the user will then proceed to attack the actual enemy.
 * I believe that if the confused enemy has healing skills, he will heal
 * and/or resurrect their teammates. This can cause even more hilarious
 * situations where an enemy kills/revives/kills again their teammates.
 *
 *
 *
 * //Scopes
 * Added support for "exclude_free_cells" in the AOE. previously
 * this boolean did exist, but there was never a function to filter
 * out cells without an entity in it. This also greatly reduces lag
 *
 * Added support for Scope_Select if Actor is afflicted with a specific State
 * scope_select: AstateId stateID
 *
 * Added support for Scope_Select if Enemy Unit is afflicted with a specific State*
 * scope_select: EstateId stateID
 *
 * Added support for Scope_Select if A Team Member is afflicted with a specific State*
 * scope_select: AllystateId stateID
 *
 * Added support for Scope_Select if An Enemy Team Member (enemies if player, player if enemies)*
 * is afflicted with a specific State*
 * scope_select: EnemystateId stateID
 *
 * Added support for Scope_Select if An Enemy Team Member (enemies if player, player if enemies)*
 * is afflicted with a specific State*
 * scope_select: StateId stateID
 *
 * Added support for Scope_Select if Actor Knows a specific Skill*
 * scope_select: AskillId skillID
 *
 * Added support for Scope_Select if Enemy Knows a specific Skill*
 * scope_select: EskillId skillID
 *
 *
 * //Distance
 * Added Support to keep track of distance between user and target. This allows you to create
 * skills that get stronger/weaker the further/closer you are.
 * When using advanced damage formulas, use a._cellDistance to pull in the distance between the
 * user of the skill, and the targeted cell.
 */

Counter System
JavaScript:
/*
 * ===========
 * Counter System
 * ===========
 * Repaired Counter System for 0.77
 * Added support for Yanfly Counter Control
 * Added support for Counter Conditions, Counter Distance
 * Counter is selected by determining "Best Counters"
 
 * First, the skill's Counter Conditions are checked.
 ** If no counter condition is set, it is evaluated as true -
 ** otherwise it evaluates the counter condition. If false, it
    it does not add the skill to any array, if true, proceed to next step.           
 * Second, it checks Counter distance (If unavailable, assumes "0") of all Counter Skills
   for the "countering" entity.
 * If Counter Distance = Distance between attacker and the entity that counters
   or the Counter Distance = 0, then that counter skill is added to the "Best" counters
 * If Counter Distance is greater than or equal to the distance between the two entities,
   then it is considered a "good" or otherwise "valid" counter.
 * If the "Best" counters has a length > 0 then it is returned, otherwise, it checks if
   the "Good" counters array has a length of > 0, if so, that one is returned.
 * If neither array has elements, it returns an empty array, and the character does NOT counter.
 
 * After the Counter SKills array is determined, it randomly selects one.
 * This counter is then checked to see what "Type" of counter it is.
 * Using an array of "Defensive Counters" (Will later be updated to use a notetag) it checks if the skill
   selected is a Defensive Counter and returns such, otherwise it returns "Offensive".
 ** CheckCounter is also used by getBestCounter(), which uses it to determine if the counter is Invalid
 ** Here, it is simply used to determine if it is defensive or offensive.
 
 * If the skill is defensive, the cursor is set to the countering entity, and the action is performed.
 ** A popup will display with "Defensive Counter" and "Skill Name"
 * If the skill is offensive, the cursor is set to the entity to BE countered, and the action is performed.
 ** A popup will display with "Offensive Counter" and "Skill Name"
 *** Will add support later for other counter types such as:
 **** Support Counter
 **** Magic Counter
 **** Physical Counter
 **** Elemental Counters
 ***** Fire,Ice,Thunder,Water,Wind,Earth,Light,Dark
 
 ****TO-DO****
 * Check if counters affect allies.
 * Add notetag to prevent ally counters
 * Add notetag to allow ally counters
 * Add notetag for specialiszed counters
 ** Nearest Enemy
 ** Nearest Ally
 ** ETC
 *
 *
 * ******NOTE TAGS******
 *
 * ***ACTOR NOTETAGS***
 * <Default Counter: x>
 * where x is the skillID to counter with.
 *
 * ***SKILL NOTETAGS***
 * Dagger Counter Attack
 * <Counter Name:Dagger>
 * <Counter Type:Offensive>
 * <Counter Type Display:Offensive Counter>
 * <Counter Distance: 1>
 *
 *
 * ***PASSIVE SKILL COUNTER ***
 * Auto-Potion: Make this a Passive Skill, and it will be detected by the counter system
 * So long as it is equipped (if using skill equip core) or learned.
 *
 * <Counter Name: Auto-Potion>
 * <Custom Counter Condition>
 * $gameParty.numItems($dataItems[1]) > 0
 * </Custom Counter Condition>
 * <Counter Distance: 0>
 *
*/
 
Last edited:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,711
Reaction score
863
First Language
Chinese
Primarily Uses
N/A
I wonder if there are plans to support Attack Times+ as well, like applying the following change:
JavaScript:
TBSSequenceManager.prototype.readTargets = function (data, deepRead) {
    if (deepRead == null) deepRead = true;
    if (data instanceof Array) return data;
    if (deepRead) {
        var cells = this.readCellTargets(data, false);
        if (cells.length > 0) {
            return BattleManagerTBS.getEntitiesInScope(cells);
        }
    }

    var targets = [];
    var cursorCell = this.baseCursorCell();
    var aoe = [];
    if (data.match(/\{(.+)\}/i)) {
        var aoeKey = RegExp.$1;
        if (aoeKey === "aoe") {
            aoe = this.baseAoE();
        } else if (aoeKey === "cursor") {
            aoe = [cursorCell];
        } else {
            var param = {
                user: this.getUser(),
                dir: this.getUser().getDirectionTo(cursorCell),
                need_check_los: false,
                exclude_center: false,
                line_of_sight: false
            };
            aoe = BattleManagerTBS.getScopeFromData(aoeKey, cursorCell, param);
        }
    }
    var aoeTargets = BattleManagerTBS.getEntitiesInScope(aoe);
    var aoeAllyTargets = aoeTargets.filter(function (entity) {
        return this.isAlly(entity.battler());
    }.bind(this));
    var aoeEnemyTargets = aoeTargets.filter(function (entity) {
        return this.isEnemy(entity.battler());
    }.bind(this));
    var aoeDeadTargets = aoeTargets.filter(function (entity) {
        return entity.battler().isDead();
    });
    var aoeDeadAllyTargets = aoeAllyTargets.filter(function (entity) {
        return entity.battler().isDead();
    });
    var aoeDeadEnemyTargets = aoeEnemyTargets.filter(function (entity) {
        return entity.battler().isDead();
    });
    var cursorTarget = [cursorCell.getEntity()];
    var cursorAllyTarget = (cursorTarget[0] && this.isAlly(cursorTarget[0].battler())) ? cursorTarget : [];
    var cursorEnemyTarget = (cursorTarget[0] && this.isEnemy(cursorTarget[0].battler())) ? cursorTarget : [];
    var cursorDeadTarget = (cursorTarget[0] && cursorTarget[0].battler().isDead()) ? cursorTarget : [];
    var cursorDeadAllyTarget = (cursorAllyTarget[0] > 0 && cursorAllyTarget[0].battler().isDead()) ? cursorAllyTarget : [];
    var cursorDeadEnemyTarget = (cursorEnemyTarget[0] > 0 && cursorEnemyTarget[0].battler().isDead()) ? cursorEnemyTarget : [];

    if (data.match(/^user$/i)) {    //user
        targets = [this.getUser()];
    } else if (data.match(/^all$/i)) {  //all
        BattleManagerTBS.allEntities().forEach(function (entity) {
            targets.push(entity);
        });
    } else if (data.match(/^allies$/i)) {   //allies
        BattleManagerTBS.allEntities().forEach(function (entity) {
            if (this.isAlly(entity.battler()))
                targets.push(entity);
        }.bind(this));
    } else if (data.match(/^enemies$/i)) {  //enemies
        BattleManagerTBS.allEntities().forEach(function (entity) {
            if (this.isEnemy(entity.battler()))
                targets.push(entity);
        }.bind(this));
    } else if (data.match(/^active_entity$/i)) { //active_entity
        targets = [BattleManagerTBS.activeEntity()];
    } else if (data.match(/^cursor_battler$/i)) { //cursor_battler
        targets = cursorTarget;
    } else if (data.match(/^cursor_ally$/i)) { //cursor_ally
        targets = cursorAllyTarget;
    } else if (data.match(/^cursor_enemy$/i)) { //cursor_enemy
        targets = cursorEnemyTarget;
    } else if (data.match(/^saved\((.+)\)$/i) && this._savedEntities[RegExp.$1]) { //saved(x)
        targets = this._savedEntities[RegExp.$1];
    } else if (data.match(/^\{.+\}_battlers$/i)) { //{x}_battlers
        targets = aoeTargets;
    } else if (data.match(/^\{.+\}_allies$/i)) {
        targets = aoeAllyTargets;
    } else if (data.match(/^\{.+\}_enemies$/i)) {
        targets = aoeEnemyTargets;
    } else if (data.match(/^(\d+)_battlers_in_\{.+\}$/i)) {
        targets = LeUtilities.getXRandomValuesInArray(aoeTargets, Number(RegExp.$1));
    } else if (data.match(/^(\d+)_allies_in_\{.+\}$/i)) {
        targets = LeUtilities.getXRandomValuesInArray(aoeAllyTargets, Number(RegExp.$1));
    } else if (data.match(/^(\d+)_enemies_in_\{.+\}$/i)) {
        targets = LeUtilities.getXRandomValuesInArray(aoeEnemyTargets, Number(RegExp.$1));
    } else if (data.match(/^\{.+\}_dead_battlers$/i)) {
        targets = aoeDeadTargets;
    } else if (data.match(/^\{.+\}_dead_allies$/i)) {
        targets = aoeDeadAllyTargets;
    } else if (data.match(/^\{.+\}_dead_enemies$/i)) {
        targets = aoeDeadEnemyTargets;
    } else if (data.match(/^(\d+)_dead_battlers_in_\{.+\}$/i)) {
        targets = LeUtilities.getXRandomValuesInArray(aoeDeadTargets, Number(RegExp.$1));
    } else if (data.match(/^(\d+)_dead_allies_in_\{.+\}$/i)) {
        targets = LeUtilities.getXRandomValuesInArray(aoeDeadAllyTargets, Number(RegExp.$1));
    } else if (data.match(/^(\d+)_dead_enemies_in_\{.+\}$/i)) {
        targets = LeUtilities.getXRandomValuesInArray(aoeDeadEnemyTargets, Number(RegExp.$1));
    } else if (data.match(/^cursor_dead_battler/i)) {
        targets = cursorDeadTarget;
    } else if (data.match(/^cursor_dead_ally$/i)) {
        targets = cursorDeadAllyTarget;
    } else if (data.match(/^cursor_dead_enemy$/i)) {
        targets = cursorDeadEnemyTarget;
    } else if (data.match(/^battler_toward_user$/i)) {
        var cell = this.getUser().getForwardCell();
        if (cell) {
            var target = cell.getEntity();
            if (target)
                targets = [target];
        }
    }

    // Edited to support skill/item repeats and Attack Times+ as well
    // return targets;
    var repeatedTargets = [];
    var repeats = 1;
    if (BattleManagerTBS._activeAction.item()) {
        repeats = BattleManagerTBS._activeAction.item().repeats;
    }
    if (BattleManagerTBS._activeAction.isAttack()) {
        repeats += this.getUser().battler().attackTimesAdd();
    }
    repeats = Math.floor(repeats);
    for (var i = 0; i < targets.length; i++) {
        var target = targets[i];
        if (target) {
            for (var j = 0; j < repeats; j++) {
                repeatedTargets.push(target);
            }
        }
    }
    return repeatedTargets;
    // Using repeatTargets should also work but not using that's just to play safe
};
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
813
First Language
English
Primarily Uses
RMMV
I just noticed, does <custom execution> for skills not work in LTBS?

I want to create a simple if/else if state effect.
 
Last edited:

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
I just noticed, does <custom execution> for skills not work in LTBS?

I want to create a simple if/else if state effect.
Custom Execution works.

I use it for my slew of thieving skills
Which does require my yanfly steal snatch patch, and you to set the steal timeout to 0.
It also does not fix Snatch (which lets you choose the item),

I use custom execution to update variables 1000+ActorID.
To keep track of number of steals, Which ties into passives and special abilities that add buffs/damage based on number of steals


<Custom Execution>
var vID = $gameParty.members().indexOf(user);
var vID = 1000+vID
var newval = $gameVariables.value(vID)
newval +=1
$gameVariables.setValue(vID, newval);

if(newval>=100)
{
user.unlockTpMode(26);
}

if(user.tpMode().name==="Kleptomaniac")
{user.gainTP(15*user.tcr)}

</Custom Execution>
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
813
First Language
English
Primarily Uses
RMMV
My Defend skill isn't applying the states it should (it works in non LTBS mode)
JavaScript:
<Custom Execution>
if (user.isWtypeEquipped(7) || (!user.isDualWield() && user.isWtypeEquipped(5))) {
  user.addState(3);
}
if (user.isWtypeEquipped(6) {
  user.addState(2);
}
</Custom Execution>
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
My Defend skill isn't applying the states it should (it works in non LTBS mode)
JavaScript:
<Custom Execution>
if (user.isWtypeEquipped(7) || (!user.isDualWield() && user.isWtypeEquipped(5))) {
  user.addState(3);
}
if (user.isWtypeEquipped(6) {
  user.addState(2);
}
</Custom Execution>
I think It doesn't work for you bc you're missing a parenthesis after WtypeEquipped(6))
you never closed the if statement, this likely broke it.
All I know is it kept throwing ILLEGAL at me until I added the parenthesis.

This works for me both before all LeTBS Tags, and After
<Custom Execution>
if (user.isWtypeEquipped(25) || (!user.isDualWield() && user.isWtypeEquipped(22))) {
user.addState(42);
}
if (user.isWtypeEquipped(23)) {
user.addState(43);

}
</Custom Execution>
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
813
First Language
English
Primarily Uses
RMMV
Eureka! It works, ty!
Lol, omg it's always some stupid little mistake like that... -.-

Edit: Btw, is there a way to disable the "Option" & "Escape" choices? Better yet the entire window that they are in, you know when you right-click out of your usual list of commands.
 
Last edited:

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
Lol, omg it's always some stupid little mistake like that... -.-
Believe me, I know.
99% of the time, its a parenthesis, a bracket, or a semicolon.
I've gotten really good at making sure I'm not missing parenthesis, mainly thanks to LISP.
my final project in AI literally had 87 closing parentheses. It was mad.

As for my plugins, I think they're mostly done, just going through some other fixes.
Not sure if I should add in @DoubleX's fix or not, or if I should add in my own fix.

I don't use "repeating" skills, because it makes more sense to just use a sequence that calls the effect twice.

I do plan on adding my sequence creator functionality at some point, which will allow the dynamic creation of sequences.
However, My Plugins do modify the readTargets function, so adding his in will be immediate.

Although instead of going through the entire target list 1 by 1 and then adding itself each time per repeat, its just easier to concat the array to itself since you don't need to do a second check that target is valid, since it had to be valid to be in the original array

repeatedTargets = [];
//Get number of Repeats etc.

for (var j = 0; j < repeats; j++) {
repeatedTargets = repeatedTargets.concat(array);
}
return repeatedTargets;
 

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

Latest Threads

Latest Posts

Latest Profile Posts

TMW the air quality is so bad, your hair changes color every time you wash it. :LZYyuck:
Finished two animations today. :kaojoy:
Sigony wrote on Ksi's profile.
Just wanna say that I love your videos.
When are you fighting Floyd Mayweather?
A game is a lot like pasta.
Pasta is technically edible after a few minutes of boiling, if a bit chewy, not very nice.
If you cook it with patience, perhaps with some oil, at a rolling boil in salted water, drain it and add a nice sauce with some roasted vegetables, and present it on a beautiful plate, with beautiful cutlery on a beautiful table in a beautiful restaurant with beautiful sounds and scents; VERY NICE.

Forum statistics

Threads
102,998
Messages
996,610
Members
134,474
Latest member
Spartanbuddy
Top