Lecode Tactical Battle System 0.77.2B

Myers & Sparks

Veteran
Veteran
Joined
Jan 2, 2017
Messages
91
Reaction score
3
First Language
English
Primarily Uses
RMMV
More interestingly, can you manually call a sequence from the editor? I.E in script plugin line?

upload_2019-8-18_23-18-17.png


Like with either of those?
 

Aezriel

Shadow Slayer
Member
Joined
Mar 28, 2019
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
I was actually working on something like that. I actually got a "Transfigure Skill" working. Where it transformed actors/enemies into puppies.
I'll try to get you the correct steps tomorrow.
Thanks man.
 

Myers & Sparks

Veteran
Veteran
Joined
Jan 2, 2017
Messages
91
Reaction score
3
First Language
English
Primarily Uses
RMMV
What exactly are you trying to do
Something like a "combo" system

I figured out how to make it functional(ish) -I think, I noticed that you can define sequences in common commands

upload_2019-8-20_2-59-4.png


So I aim to have it where a player does a qte correctly, they will get additional attacks
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
644
Reaction score
277
First Language
English
Primarily Uses
RMMV
Something like a "combo" system

I figured out how to make it functional(ish) -I think, I noticed that you can define sequences in common commands

View attachment 121607


So I aim to have it where a player does a qte correctly, they will get additional attacks
Then you will need a few lines

var skill = $dataSkills[skillId];
//This to get the actual Skill you want them to use

entity = BattleManagerTBS.activeEntity();
//This gets the active Entity (The guy attacking)

BattleManagerTBS.forceAction(skill, entity);
//This should force the skill to be used by the entity.

Now, if you use pass_on_use
This may or may not work. I have yet to try ANY of this in a common event as part of the skill, so I can't guarantee these work.
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
644
Reaction score
277
First Language
English
Primarily Uses
RMMV
Thanks man.
Apparently all I did was use yanfly's states and stuff, to use apply/remove effects

So the "Transmutate skill" simply added a state, which used this.
However, it is very inelegant, and may not work properly.

For the "Rock Transform" I made an enemy that was a rock with max stats (to prevent damage).
Then I gave it no skills, no movement, and basically made settings that forced it to wait instead of making a move.
Then when the state wore off they went back to normal.
This was crude and didn't always work, not to mention it didn't work on player characters.

<Custom Apply Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
// Archive the previous enemy ID.
user._prevEnemyId = user._enemyId;
// Set the target enemy ID you want the enemy to change into.
var transformEnemyId = 35;
// Transform the user.
user.transform(transformEnemyId);
}
</Custom Apply Effect>


<Custom Remove Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
// Retrieve the archived enemy ID.
var transformEnemyId = user._prevEnemyId;
// Transform the enemy back.
user.transform(transformEnemyId);
// Clear the archived data.
user._prevEnemyId = undefined;
}
</Custom Remove Effect>
 

Aezriel

Shadow Slayer
Member
Joined
Mar 28, 2019
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
Apparently all I did was use yanfly's states and stuff, to use apply/remove effects

So the "Transmutate skill" simply added a state, which used this.
However, it is very inelegant, and may not work properly.

For the "Rock Transform" I made an enemy that was a rock with max stats (to prevent damage).
Then I gave it no skills, no movement, and basically made settings that forced it to wait instead of making a move.
Then when the state wore off they went back to normal.
This was crude and didn't always work, not to mention it didn't work on player characters.

<Custom Apply Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
// Archive the previous enemy ID.
user._prevEnemyId = user._enemyId;
// Set the target enemy ID you want the enemy to change into.
var transformEnemyId = 35;
// Transform the user.
user.transform(transformEnemyId);
}
</Custom Apply Effect>


<Custom Remove Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
// Retrieve the archived enemy ID.
var transformEnemyId = user._prevEnemyId;
// Transform the enemy back.
user.transform(transformEnemyId);
// Clear the archived data.
user._prevEnemyId = undefined;
}
</Custom Remove Effect>
Oh well, thanks for trying to help, I'll just keep experimenting with stuff to try and figure out a way to make it work.

Edit: So just to confirm, there isn't a way to make a players sprite change mid battle?
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
644
Reaction score
277
First Language
English
Primarily Uses
RMMV
Oh well, thanks for trying to help, I'll just keep experimenting with stuff to try and figure out a way to make it work.

Edit: So just to confirm, there isn't a way to make a players sprite change mid battle?
I use class change core, and set up graphics that take place when they change classes.
at this time, I am not sure if they change graphics in battle if you change their class. I know this works with yanfly core, but I do not know whether it works inside LeTBS.
I would need to do testing.
 

Aezriel

Shadow Slayer
Member
Joined
Mar 28, 2019
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
I use class change core, and set up graphics that take place when they change classes.
at this time, I am not sure if they change graphics in battle if you change their class. I know this works with yanfly core, but I do not know whether it works inside LeTBS.
I would need to do testing.
I'll go ahead and test this to see if it works or not, thanks again.

Edit: So I got the plugin working and everything but now when I go into a battle it says "Cannot read property 'fittingHeight' of undefined"
 
Last edited:

Aezriel

Shadow Slayer
Member
Joined
Mar 28, 2019
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'll go ahead and test this to see if it works or not, thanks again.

Edit: So I got the plugin working and everything but now when I go into a battle it says "Cannot read property 'fittingHeight' of undefined"
I'm sorry, I'm an idiot, Yanfly Battle Core was conflicting with everything so as soon as I got rid of it battles started working
 

Myers & Sparks

Veteran
Veteran
Joined
Jan 2, 2017
Messages
91
Reaction score
3
First Language
English
Primarily Uses
RMMV
Alright, found my modifications. You'll need to open up LeTBS_RTPUse.js, find these two functions, and replace them with the versions I have here:

Code:
Lecode.S_TBS.RTPUse.oldTBSEntitySprite_processBitmapsConfig = TBSEntity_Sprite.prototype.processBitmapsConfig;
TBSEntity_Sprite.prototype.processBitmapsConfig = function (poseConfig, hue) {
    var pose = poseConfig.pose;
    var data = poseConfig.data;
    var battler = this._entity.battler();
    if (data.match(/use_chara/)) {
        this._useFrameOrder[pose] = true;
        this._poses.push(pose);
        var array = data.split(",");
        // DrQ: Actors still use params, if they have them
        var charaName = (battler.isActor() && !array[1]) ? battler.characterName() : array[1].trim();
        var fullBitmap = ImageManager.loadCharacter(charaName, hue);
        fullBitmap.addLoadListener(this.createCharaBitmap.bind(this, fullBitmap, array, pose));
        return;
    }
    Lecode.S_TBS.RTPUse.oldTBSEntitySprite_processBitmapsConfig.call(this, poseConfig, hue);
};

TBSEntity_Sprite.prototype.createCharaBitmap = function (fbitmap, array, pose) {
    var battler = this._entity.battler();
    // DrQ: Actors still use params, if they have them
    var charaIndex = (battler.isActor() && !array[2]) ? battler.characterIndex() : Number(array[2].trim());
    var lineIndex = array[3] ? Number(array[3].trim()) : undefined;
    var frameIndex = array[4] ? Number(array[4].trim()) : undefined;
    //var bitmap = new Bitmap(48 * 3, 48 * 4);
    var pw = fbitmap.width / 4;
    var ph = fbitmap.height / 2;
    var bitmap = new Bitmap(pw, ph);
    var n = charaIndex;
    var sx = (n % 4) * pw;
    var sy = Math.floor(n / 4) * ph;
    bitmap.blt(fbitmap, sx, sy, pw, ph, 0, 0);
    if (lineIndex >= 0) {
        ph /= 4;
        sy = lineIndex * ph;
        if (frameIndex >= 0) {
            pw /= 3;
            sx = frameIndex * pw;
            //var newBmp = new Bitmap(48, 48);
            var newBmp = new Bitmap(pw, ph);
            newBmp.blt(bitmap, sx, sy, pw, ph, 0, 0);
            this._bitmaps[pose] = newBmp;
            this._maxFrame[pose] = 0;
            this._nbrLines[pose] = 1;
        } else {
            //var newBmp = new Bitmap(48 * 3, 48);
            var newBmp = new Bitmap(pw, ph);
            newBmp.blt(bitmap, 0, sy, pw, ph, 0, 0);
            this._bitmaps[pose] = newBmp;
            this._maxFrame[pose] = 2;
            this._nbrLines[pose] = 1;
        }
    } else {
        this._maxFrame[pose] = 2;
        this._nbrLines[pose] = 4;
        this._bitmaps[pose] = bitmap;
    }
    this._frameLoaded++;
};
This should work for sprites of any size, but does still demand they be arranged as usual (eight sheets arranged 4x2, each sheet is 3x4)- so no using the $bigmonster sprites directly, not that you'd necessarily want to anyway considering none of them have multiple facing directions.

When I tried this, it only make the taller people shift side to side.
Alright, found my modifications. You'll need to open up LeTBS_RTPUse.js, find these two functions, and replace them with the versions I have here:

Code:
Lecode.S_TBS.RTPUse.oldTBSEntitySprite_processBitmapsConfig = TBSEntity_Sprite.prototype.processBitmapsConfig;
TBSEntity_Sprite.prototype.processBitmapsConfig = function (poseConfig, hue) {
    var pose = poseConfig.pose;
    var data = poseConfig.data;
    var battler = this._entity.battler();
    if (data.match(/use_chara/)) {
        this._useFrameOrder[pose] = true;
        this._poses.push(pose);
        var array = data.split(",");
        // DrQ: Actors still use params, if they have them
        var charaName = (battler.isActor() && !array[1]) ? battler.characterName() : array[1].trim();
        var fullBitmap = ImageManager.loadCharacter(charaName, hue);
        fullBitmap.addLoadListener(this.createCharaBitmap.bind(this, fullBitmap, array, pose));
        return;
    }
    Lecode.S_TBS.RTPUse.oldTBSEntitySprite_processBitmapsConfig.call(this, poseConfig, hue);
};

TBSEntity_Sprite.prototype.createCharaBitmap = function (fbitmap, array, pose) {
    var battler = this._entity.battler();
    // DrQ: Actors still use params, if they have them
    var charaIndex = (battler.isActor() && !array[2]) ? battler.characterIndex() : Number(array[2].trim());
    var lineIndex = array[3] ? Number(array[3].trim()) : undefined;
    var frameIndex = array[4] ? Number(array[4].trim()) : undefined;
    //var bitmap = new Bitmap(48 * 3, 48 * 4);
    var pw = fbitmap.width / 4;
    var ph = fbitmap.height / 2;
    var bitmap = new Bitmap(pw, ph);
    var n = charaIndex;
    var sx = (n % 4) * pw;
    var sy = Math.floor(n / 4) * ph;
    bitmap.blt(fbitmap, sx, sy, pw, ph, 0, 0);
    if (lineIndex >= 0) {
        ph /= 4;
        sy = lineIndex * ph;
        if (frameIndex >= 0) {
            pw /= 3;
            sx = frameIndex * pw;
            //var newBmp = new Bitmap(48, 48);
            var newBmp = new Bitmap(pw, ph);
            newBmp.blt(bitmap, sx, sy, pw, ph, 0, 0);
            this._bitmaps[pose] = newBmp;
            this._maxFrame[pose] = 0;
            this._nbrLines[pose] = 1;
        } else {
            //var newBmp = new Bitmap(48 * 3, 48);
            var newBmp = new Bitmap(pw, ph);
            newBmp.blt(bitmap, 0, sy, pw, ph, 0, 0);
            this._bitmaps[pose] = newBmp;
            this._maxFrame[pose] = 2;
            this._nbrLines[pose] = 1;
        }
    } else {
        this._maxFrame[pose] = 2;
        this._nbrLines[pose] = 4;
        this._bitmaps[pose] = bitmap;
    }
    this._frameLoaded++;
};
This should work for sprites of any size, but does still demand they be arranged as usual (eight sheets arranged 4x2, each sheet is 3x4)- so no using the $bigmonster sprites directly, not that you'd necessarily want to anyway considering none of them have multiple facing directions.
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
644
Reaction score
277
First Language
English
Primarily Uses
RMMV
whenever an actor or a foe dies, this error pops up on my screen can you help?
can you attach the console output.
As well as what version you're using
As well as the entire notebox for an/the entity that causes this issue.
 

RUMTHECROW

Warper
Member
Joined
Jun 23, 2019
Messages
2
Reaction score
0
First Language
Turkish
Primarily Uses
Other
Im using 0.77.2
cant open the console idk why
here is the notebox:
<letbs_sprite>

pose(idle): use_chara, Evil, 0

pose(dead): use_chara, Damage2, 0, 0

turn_order: auto

status_sprite: auto

</letbs_sprite>
 

Aezriel

Shadow Slayer
Member
Joined
Mar 28, 2019
Messages
16
Reaction score
0
First Language
English
Primarily Uses
RMMV
Alright, I can confirm, there is no way as of now to change an actors sprite mid battle. Hopefully Lecode adds something to help.
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
644
Reaction score
277
First Language
English
Primarily Uses
RMMV
Im using 0.77.2
So you're using 0.77.2 and not 0.77.2B?
Because that makes things way easier for me, since I do not use version B
But add this plugin to your project, this should enable the console(F8 I believe) But it should open automatically anyway
 

Attachments

omeg

Veteran
Veteran
Joined
Jul 13, 2019
Messages
69
Reaction score
10
First Language
french
Primarily Uses
RMMV
HEY guys ^^

Anybody knows if we can integrate this for some battle only?
For example you play in default battle system and in the game orcs attack a castle and the combat in tactical mode begin?
Obviously after the fight everything go back to DBS ^^
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
644
Reaction score
277
First Language
English
Primarily Uses
RMMV
HEY guys ^^

Anybody knows if we can integrate this for some battle only?
For example you play in default battle system and in the game orcs attack a castle and the combat in tactical mode begin?
Obviously after the fight everything go back to DBS ^^
Just turn off LeTBS and it'll enable other stuff.
Plugin Command:
LeTBS OFF

Alright, I can confirm, there is no way as of now to change an actors sprite mid battle. Hopefully Lecode adds something to help.
I'm looking into it, I'll let you know what I come up with.
 

omeg

Veteran
Veteran
Joined
Jul 13, 2019
Messages
69
Reaction score
10
First Language
french
Primarily Uses
RMMV
@Pharonix is that simple? few month ago some people told me its will be hard to switch because of the engine itself ^^"
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
644
Reaction score
277
First Language
English
Primarily Uses
RMMV
@Pharonix is that simple? few month ago some people told me its will be hard to switch because of the engine itself ^^"
It sorta works for me at least:
Just don't see allies, because I don't set side-view chars, because I don't use it.
upload_2019-8-21_11-25-49.png

The Biggest issue is making sure the skills work properly.
 

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

Latest Threads

Latest Profile Posts

For anyone who has uploaded a game to Steam and wonders if they actually check your game's build when you first upload it, I can personally vouch for Steam.
6 more towns to make in my game. SIX. not done with interiors yet but SIX EXTERIORS.
what to do when you come across a person that has stated "What if I say, f*** their EULA? I could probably get away with it." concerning asset packs sold here... on this site ...
So a guy enters in a bar and walks up to the counter. He looks the bartender with a mysterious look and asks him...
I've wondered for a while now... what is it about the YED SV plugin that just doesn't do transformations... I feel it's how it looks up the battlers honestly.

Forum statistics

Threads
93,495
Messages
912,978
Members
123,030
Latest member
Galewings
Top