zelanius

Mechanics Freak
Regular
Joined
Apr 29, 2020
Messages
177
Reaction score
48
First Language
English
Primarily Uses
RMMV
Just a quick question. Is there plans for a height factor for this plugin (i.e., a z-axis) along with a "jump" stat to allow for height movement? Thanks in advance for any response!

EDIT: Nevermind, I noticed that Lecode is not online anymore. Hope they come back.
 
Last edited:

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
*Fixed* makeScope() & getObjectSequenceData() functions! These are edited versions of @Pharonix's edits to LeCode's original functions. This will allow for custom/conditional scopes & sequences! I merely fixed it so it no longer throws errors, which I experienced w/ the original PHX_LeMod.js. You can use the edited plugin extension, or directly edit LeTBS.js as I have.
JavaScript:
BattleManagerTBS.makeScope = function (data, center, param) { //Edited by Frostorm
    var str, min, size;
    var e = param.user;
    if (e)
        var a = e.battler();

    if (data.match(/(circle|line|square|cross)\((.+)\)/i)) {
        var R1 = RegExp.$2;
        if (RegExp.$2.includes(",")) {
            str = RegExp.$2.split(",");
            size = Math.floor(Number(eval(str[0])));
            min = Math.floor(Number(eval(str[1])));
        } else if (RegExp.$2.match(/(\(.*\))/i)) {
            var R2 = eval(R1);
               if (R2.includes(",")) {
                str = R2.split(",");
                   size = Math.floor(Number(eval(str[0])));
                   min = Math.floor(Number(eval(str[1])));
            } else {
                size = Math.floor(Number(eval(RegExp.$2)));
            }
        } else {
            size = Math.floor(Number(eval(RegExp.$2)));
        }
    }

    if (data.match(/custom\((.+)\)/i)) {
        var scopeData = Lecode.S_TBS.Config.Custom_Scopes[String(RegExp.$1)];
        scope = this.getScopeFromRawData(scopeData, center, param);
    } else if (data.match(/circle\((.+)\)/i)) {
        scope = this.makeCircleScope(center, size, min, param);
    } else if (data.match(/line\((.+)\)/i)) {
        scope = this.makeLineScope(center, size, min, param);
    } else if (data.match(/square\((.+)\)/i)) {
        scope = this.makeSquareScope(center, size, min, param);
    } else if (data.match(/cross\((.+)\)/i)) {
        scope = this.makeCrossScope(center, size, min, param);
    } else if (data.match(/path/i)) {
        scope = this.makePathScope(param);
    } else {
        var cx = center.x;
        var cy = center.y;
        var aoe = eval("[" + data + "]");
        for (var i = 0; i < aoe.length; i++) {
            var cell = this.getCellAt(aoe[i][0], aoe[i][1]);
            if (cell)
                scope.push(cell);
        }
    }
    return LeUtilities.uniqArray(scope);
};
JavaScript:
TBSEntity.prototype.getObjectSequenceData = function (obj) { //Modified by PHX //Edited by Frostorm
    var defaultSeqId = DataManager.isSkill(obj) ? Lecode.S_TBS.defaultSkillSequence : Lecode.S_TBS.defaultItemSequence;
    var e = BattleManagerTBS.activeEntity();
    //Check if the obj has a sequence
    if (obj.TagsLetbs.sequence) {
        //If it does, collect it into a variable, and check if it is a function.
        //Added Regex to check if function has variables
        //var regex =
        objSequence = obj.TagsLetbs.sequence;
        if (objSequence.includes("projectile")) {
            return obj.TagsLetbs.sequence || defaultSeqId;
        } else if (objSequence.includes("()") || objSequence.match(/(\(.*\))/i)) {
            //console.log(objSequence);
            //If it is a function, evaluate it, and return the sequence
            str = eval(objSequence);
            return str;
        }
        return obj.TagsLetbs.sequence || defaultSeqId;
    } else {
    //Return normal stuff. Redundant actually as we check above if obj has a sequence and we return it if it is not a function.
    //But whatever
        console.log("stuff fail");
        return obj.TagsLetbs.sequence || defaultSeqId;
    }
};
 

Attachments

  • PHX_LeMod.js
    41.2 KB · Views: 16

Myers & Sparks

Regular
Regular
Joined
Jan 2, 2017
Messages
175
Reaction score
25
First Language
English
Primarily Uses
RMMV
Just a quick question. Is there plans for a height factor for this plugin (i.e., a z-axis) along with a "jump" stat to allow for height movement? Thanks in advance for any response!

EDIT: Nevermind, I noticed that Lecode is not online anymore. Hope they come back.
At this point we'll be lucky to get a 1.0 version of LETBS
 

Myers & Sparks

Regular
Regular
Joined
Jan 2, 2017
Messages
175
Reaction score
25
First Language
English
Primarily Uses
RMMV
*Fixed* makeScope() & getObjectSequenceData() functions! These are edited versions of @Pharonix's edits to LeCode's original functions. This will allow for custom/conditional scopes & sequences! I merely fixed it so it no longer throws errors, which I experienced w/ the original PHX_LeMod.js. You can use the edited plugin extension, or directly edit LeTBS.js as I have.
JavaScript:
BattleManagerTBS.makeScope = function (data, center, param) { //Edited by Frostorm
    var str, min, size;
    var e = param.user;
    if (e)
        var a = e.battler();

    if (data.match(/(circle|line|square|cross)\((.+)\)/i)) {
        var R1 = RegExp.$2;
        if (RegExp.$2.includes(",")) {
            str = RegExp.$2.split(",");
            size = Math.floor(Number(eval(str[0])));
            min = Math.floor(Number(eval(str[1])));
        } else if (RegExp.$2.match(/(\(.*\))/i)) {
            var R2 = eval(R1);
               if (R2.includes(",")) {
                str = R2.split(",");
                   size = Math.floor(Number(eval(str[0])));
                   min = Math.floor(Number(eval(str[1])));
            } else {
                size = Math.floor(Number(eval(RegExp.$2)));
            }
        } else {
            size = Math.floor(Number(eval(RegExp.$2)));
        }
    }

    if (data.match(/custom\((.+)\)/i)) {
        var scopeData = Lecode.S_TBS.Config.Custom_Scopes[String(RegExp.$1)];
        scope = this.getScopeFromRawData(scopeData, center, param);
    } else if (data.match(/circle\((.+)\)/i)) {
        scope = this.makeCircleScope(center, size, min, param);
    } else if (data.match(/line\((.+)\)/i)) {
        scope = this.makeLineScope(center, size, min, param);
    } else if (data.match(/square\((.+)\)/i)) {
        scope = this.makeSquareScope(center, size, min, param);
    } else if (data.match(/cross\((.+)\)/i)) {
        scope = this.makeCrossScope(center, size, min, param);
    } else if (data.match(/path/i)) {
        scope = this.makePathScope(param);
    } else {
        var cx = center.x;
        var cy = center.y;
        var aoe = eval("[" + data + "]");
        for (var i = 0; i < aoe.length; i++) {
            var cell = this.getCellAt(aoe[i][0], aoe[i][1]);
            if (cell)
                scope.push(cell);
        }
    }
    return LeUtilities.uniqArray(scope);
};
JavaScript:
TBSEntity.prototype.getObjectSequenceData = function (obj) { //Modified by PHX //Edited by Frostorm
    var defaultSeqId = DataManager.isSkill(obj) ? Lecode.S_TBS.defaultSkillSequence : Lecode.S_TBS.defaultItemSequence;
    var e = BattleManagerTBS.activeEntity();
    //Check if the obj has a sequence
    if (obj.TagsLetbs.sequence) {
        //If it does, collect it into a variable, and check if it is a function.
        //Added Regex to check if function has variables
        //var regex =
        objSequence = obj.TagsLetbs.sequence;
        if (objSequence.includes("projectile")) {
            return obj.TagsLetbs.sequence || defaultSeqId;
        } else if (objSequence.includes("()") || objSequence.match(/(\(.*\))/i)) {
            //console.log(objSequence);
            //If it is a function, evaluate it, and return the sequence
            str = eval(objSequence);
            return str;
        }
        return obj.TagsLetbs.sequence || defaultSeqId;
    } else {
    //Return normal stuff. Redundant actually as we check above if obj has a sequence and we return it if it is not a function.
    //But whatever
        console.log("stuff fail");
        return obj.TagsLetbs.sequence || defaultSeqId;
    }
};
what does this mod do?
 

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
what does this mod do?
Are you familiar w/ the features of @Pharonix's PHX_LeMod.js? All I did was tweak his code so that it no longer throws errors under certain circumstances.

These modifications allow you to utilize custom and conditional scopes/sequences. So for example, if you wanted a skill to have a range of circle(3,1) normally, but increases to circle(4,1) when skill X is learned, you can do that!

And regarding the sequences, PHX_LeMod.js was giving me errors whenever I tried anything w/ a "projectile" in it (e.g. "projectile(dagger)" or projectile(bow_arrow)"). This is now fixed.
 

Myers & Sparks

Regular
Regular
Joined
Jan 2, 2017
Messages
175
Reaction score
25
First Language
English
Primarily Uses
RMMV
v1.0? Lol, I'd be ecstatic just to see v0.8! :guffaw:



I mean yeah true. Would love the big monsters that take up multiple cells as well as the sprite overlay it is supposed to have.
Are you familiar w/ the features of @Pharonix's PHX_LeMod.js? All I did was tweak his code so that it no longer throws errors under certain circumstances.

These modifications allow you to utilize custom and conditional scopes/sequences. So for example, if you wanted a skill to have a range of circle(3,1) normally, but increases to circle(4,1) when skill X is learned, you can do that!

And regarding the sequences, PHX_LeMod.js was giving me errors whenever I tried anything w/ a "projectile" in it (e.g. "projectile(dagger)" or projectile(bow_arrow)"). This is now fixed.

Oh the way I ended up doing my skills didnt really require something like that. leveling up individual skills can become messy. One of my classes. Lancer does have a throw spear command that can be improved. but in that case i found a way to get the [extra skill] function to override the throw skill to the improved throw skill. (throw skill replaces basic attack)

Glad you got it working tho
 

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
NVM figured it out 3 seconds later :p Feel free to delete this post
 

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
So I'd like to make some heavy use of the scan command in my game, but there's a problem with it, you can see this in the demo if you drop the resolution down to something lower in YEP_CoreEngine

If you use the scan command, the window it generates isn't aligned properly to the thing being scanned, which can result in half or more of the window being off screen.

You can see this in the demo if you enter the bandit fight and scan a chest that spawn on the far right of the scene, the resulting chest command window will spawn halfway off the left side of the screen!

I'm looking through LeTBS_ScanCommand here but I'm not honestly sure which if these window commands I should even consider editing to fix this behavior and just have the scan command window pop up over the target as the commands window does.
 
Last edited:

moldy

Regular
Regular
Joined
Nov 15, 2015
Messages
283
Reaction score
54
First Language
English
Primarily Uses
Has anyone gotten the target rate status effects to actually work? I use the focused_by_ai_for_offense: priority tags in the state notebox and they just don't seem to do anything....
 

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
Target rate doesn't do anything in LeTBS (it's not supposed to). Here's the page on AI, if u haven't read it already.
 
Last edited:

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
Has anyone got sprite overlays working in the current version? I had to rig up my party as sprites since I couldn't mix my dead sprites with the normal chara setup (even though it works for enemies using the chara note tags) but it seems like the 0.8 documentation for the sprite overlays is inaccurate, or the feature is missing etc.

I'd prefer to use overlays since I already built the weapontype graphics as overlays (and they're shared between characters) as opposed to having to export out every possible combination of weaponry across all my characters and write a bunch of evals and stuff.
 

moldy

Regular
Regular
Joined
Nov 15, 2015
Messages
283
Reaction score
54
First Language
English
Primarily Uses
Target rate doesn't do anything in LeTBS (it's not supposed to). Here's the page on AI, if u haven't read it already.

On another note, I've refined the edit I made to the .getObjectSequenceData() function:
JavaScript:
TBSEntity.prototype.getObjectSequenceData = function (obj) {
    var defaultSeqId = DataManager.isSkill(obj) ? Lecode.S_TBS.defaultSkillSequence : Lecode.S_TBS.defaultItemSequence;
    var e = BattleManagerTBS.activeEntity();
    if (obj.TagsLetbs.sequence.includes("e.")) {
        var customSeq = eval(obj.TagsLetbs.sequence);
        return customSeq;
    } else {
    return obj.TagsLetbs.sequence || defaultSeqId;
    }
};
More efficient and less error-prone now. Use "e.insertnamehere" for custom sequences.

I studied the provoke skill to see how to properly manipulate aggro, but it functionally does nothing, and the enemies keep attacking my other units.
 

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
So further looking in to getting my weapon overlays working, overlays just aren't a thing in 077.2b

So, okay fine, no overlays, it comes down to figuring out how to swap out the sprites themselves.

Sad, BUT I've found some possible routes from this thread and something interesting in the patch notes in the plugin itself.

First, I noticed @Pharonix mentioned Yanfly's class swapping and RTP. This is a good option other than the fact I can't get RTP death sprites working on characters to save my life (They work on enemies though) so I'm currently using sprite sheets in LeTBS. This method would probably do the trick IF I could get the damn RTP death sprites or any other RTP pose sprites to work. I'd lose some combat poses but whatever, long as I can use a state-based class swap and change the RTP art accordingly its all good since they wouldn't need to be showing weapons while dead.

HOWEVER!

In LeTBS.js, the 0.77 patch note calls out "Changing an entity sprite_name or sprite_config updates it's graphic"

Fantastic! This is exactly what people also need for all kinds of other state indicators, and I can use the same state-based setup to do my weapons!


Theoretically, if I could figure out the syntax to do that with an event I could swap the sprites out that way on anything that uses a sprite!

The problem is, I have absolutely no idea where I'd write that code. Currently the only way I know of to change sprite_name is the note tag entry, and even if I did, I'm not sure how I'd address individual battlers by name to ensure, for instance Arban, when he has the "sword" state, gets given the sprite_name change to Arban-Sword
 

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
Does anyone know if LeTBS uses ._currentAction()? Or if there's an LeTBS equivalent? I've tried looking, to no avail... I basically need BattleManagerTBS.activeEntity()._battler.currentAction() or BattleManagerTBS.activeEntity()._battler._actions[0], thx!
 

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
Does anyone know if LeTBS uses ._currentAction()? Or if there's an LeTBS equivalent? I've tried looking, to no avail... I basically need BattleManagerTBS.activeEntity()._battler.currentAction() or BattleManagerTBS.activeEntity()._battler._actions[0], thx!
What are you trying to accomplish? There might be another way around this if there's more infro to go on.

Also, here's one for you:

So I am building a disarm mechanic, which needs to remove the "sword" state when disarmed, which also changes the battler's pose.

I've got weapon graphic changes working using Yanfly passive states and the method laid out by @Utopiablue in this post:


In terms of a single weapon, everything is going great. Of the battler only uses one weapon, and its state is dispelled, the sprite updates to reflect the weapon is gone. If we reapply the state, the sprite is reapplied.

So, basically, both sword and shield have states for "sword equip" and "shield equip" and those states just grant the actual non-passive normal "sword" and "shield" states at the beginning of battle like so:


Code:
<Custom Battle Effect>
user.addState(204);
</Custom Battle Effect>

This lets me signify what the units have equipped with state graphics while using the invisible removable states to control the graphics, abilities, etc. thus, the unit retains permanent icons for "sword" and "shield" but I can use the dispel action to remove the sword state and all abilities it grants.

The equip state allows me to define what the disarmed unit can pick up (my units can not change equipment in battle, and can only pick up the weapon types they came in with) and so with a simple comparison of equip states and 'real" weapon states I can make sure units can only pick up the appropriate weapons, which is really just an event that re-adds the appropriate weapon state.

The state machine functions perfectly, and though I have yet to build the sequence abilities to generate the pickups the core mechanisms that make it work run great.


The trouble arises with my double wield states. I've got double weapon states using yanfly's note tags to automatically apply or remove them as such:


Code:
<swordANDshield>
  <Custom Passive Condition>
  if (user.isStateAffected(204) && user.isStateAffected (205)) {
    condition = true;
  } else {
    condition = false;
  }
  </Custom Passive Condition>

This is auto-applied through the plugin config, and the conditional states (204 and 205) are my "sword" and "shield" states. The state works flawlessly, as expected, if I have a unit equip both sword and shield, enter a battle, they have the swordANDshield state, and the sprite updates at the beginning of battle to the _swordANDshield pose.

The problem here is that LeTBS' apply and remove state functions don't see changes in this state, I assume because yanfly's code evaluting the passive conditions after they run. So I can spawn a unit, swith sword and shield, dispel the sword state, and the swordANDshield state dispels properly, but the code to change the sprites in LeTBS' onStateErased function never runs.

What I need to do, I think, is figure out how to get yanfly's code to call leTBS' onStateAdd and onStateErased functions, or find another step to call the state check at which happens AFTER yanfly runs the passive condition code and applies/removes the state.

It is also possible that perhaps I need to be checking something other than state, as leTBS might be seeing the "raw" form of the dual wield state even when its functionally disabled depending on how yanfly works.
 
Last edited:

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
I'm trying to add an Active Time / Time Progress Battle mechanic to LeTBS. I already figured out what I need to manipulate, but obviously, it's easier said than done...
 

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
I'm trying to add an Active Time / Time Progress Battle mechanic to LeTBS. I already figured out what I need to manipulate, but obviously, it's easier said than done...
Like an ATB gauge that unlocks special abilities based on number of turns passed/ability use?

If I was gonna build it from scratch I'd probably use varibales to track it and use an onscreen overlay/ progress bar plugin to track the bar, then modify the variable with turn based code calls in a map event and script calls in the ability sequences.

I know there's a yanfly plugin for it but TBH I have aboided any battle related plugins other than the ones in the demo and @Pharonix little plugins since they're not built for an entirely separate battle system so I'm not sure exactly what you'd need.
 

Latest Threads

Latest Profile Posts

Larvae.gif
They're larvae, not fightae, honest!
I've made a big emphasis on visually representing things to make the game as accessible as possible.

MP.png

Grimoires will consist of 5 - 10 pages of skills (still finalizing that max number)

Since each actor is able to take multiple actions per turn, each skill will cost 1-5 pages
This prevents more powerful skills from being uber spammed during an actors turn.
Cats are so easy. I noticed the gray one would never nap in the office while I worked, so I put a blanket on the spare chair in here and now she won't leave.
1701793108356.png
still work in progress, had not much time at the weekend^^
Oh deer! Have you checked my calendar today already? ;3
1701790624587.png

Forum statistics

Threads
136,773
Messages
1,269,748
Members
180,514
Latest member
Ikana
Top