Lecode Tactical Battle System 0.77.2B

@deathsia Are you sure the plugin update is the cause? (because I do not have any problems updating with yanfly new batch)
Your console log says that he can not find Librarium.json in your data folder and I think that is the main reason for the crash (are you using a plugin that requires Librarium.json in your data folder? If yes, try to disable the plugin or put the file in your folder.

(There is also some other missing resources in the "turn order" file)
is there currently support for party sizes larger than 4?
@hc phoenix
Yes it does but it might be buggy at the position selection phase!

To avoid that before your fight you can do a script call (not plugin command, but a script call) :

Game_Party.prototype.maxBattleMembers = function() {
return X;
};


Where X is the number of your party members if it is above 4 !

Edit :
For enemies, it is not supported yet, the best way to do very large enemy troops (above 8) is to create "portals" or "gates" that are invincible and keep summoning enemies until they run out of MP (and make them vulnerable at turn X by lowering these entities defense or self destruct them by applying death state)
Can anyone verify the solution to the item problem works? I tried the "self_cast" method thing someone mentioned on page 33 but I still get the error 'Cannot read property "LeTbs_scopeData" of null' if I try to use an item in the demo

Edit - This has been resolved now. Thanks Chaosicaa.
I am having a bit of trouble with something...

I am attempting to call a common event every time a skill is used, which adds a constant of "1" to a variable. I then have a conditional branch set up so that:

If "Variable" = 1
Text: It worked

to simply test to make sure it is working in combat

I created a fresh project with no plugins, works fine the test message I created shows up at the end of the players turn if the skill is used, as it should.

However when I am attempting to use this in my main project which has LeTBS on it, it does not work...

Does LeTBS do something with how skills call common events by chance? Does anybody have a work-around for this?

I am trying to add in an individual leveling system for each element type: Fire Water Wind Earth. The conditional branch instead of displaying the text "It Worked" at 1 would instead say you leveled up in x element after 10 or so, and every few "levels" it would provide you with a new skill.
Not sure how to solve your problem @Tewth but here's a plugin that implements element levelling that might be easier to use: https://forums.rpgmakerweb.com/index.php?threads/gdt-elements-leveling.64207/
Not sure how to solve your problem @Tewth but here's a plugin that implements element levelling that might be easier to use: https://forums.rpgmakerweb.com/index.php?threads/gdt-elements-leveling.64207/

Thank you for the reply, I have tried this plugin actually, however when I try to create a specific event that I need for my project to simply give you a choice of which element to level up upon activating the event, I get error messages.

It works on a fresh project with only that plugin you mentioned on it, but when i use it with LeTBS is when the issues start. I've contacted the maker of the GDT elements plugin about the issue I am having, however he hasn't gotten back to me yet... So it's a waiting game at this point.

I did try triggering the common event for leveling up an element with monster battle events by putting it as a condition of the player winning, and it kind of works, however it seems to have issues remembering past the number 1... I can trigger an element "level up" if I set it so that the player only needs to win one battle to get a level, but as soon as i go any higher than 1 it stops working..

Anyway, thank you again for the reply and the suggestion!
I am attempting to call a common event every time a skill is used, which adds a constant of "1" to a variable. I then have a conditional branch set up so that:

If "Variable" = 1
Text: It worked

to simply test to make sure it is working in combat

I think in theory you could tie a sequence to the skill (or as many skills as you want), and have that sequence call the common event. If you tried that and it's not working though I would also be interested to hear why, I'm just starting to learn the system myself.

Edit: the Sequences documentation lists "script: code" as a sequence command which it sounds like will evaluate a script call you put there, so maybe something along the lines of "script: $gameTemp.reserveCommonEvent(n);" ?
one thing I noticed is adding aoe to weapons, does not actually work when using the main "attack" command.
Trying to make a scythe that attacks the three in front, is not working 🙁


Edit:

I guess I can make a bunch of skills: "Scythe Attack" "Bow Attack" "Spear Attack"
and use the commands function to remove the default attack command and replace with the adjusted "Custom" attack for their weapon.

Edit 2:
This is the way to go
Add
<letbs commands>
skill[X]
</letbs commands>

to the weapon where X is the id for the weapon skill.
then remove the Attack command and leave [extra] in.
This will result in

MOVE
Scythe
Special

if using a scythe

or
MOVE
Spear
Special

if using a spear.
one thing I noticed is adding aoe to weapons, does not actually work when using the main "attack" command.
Trying to make a scythe that attacks the three in front, is not working 🙁


Edit:

I guess I can make a bunch of skills: "Scythe Attack" "Bow Attack" "Spear Attack"
and use the commands function to remove the default attack command and replace with the adjusted "Custom" attack for their weapon.

Edit 2:
This is the way to go
Add
<letbs commands>
skill[X]
</letbs commands>

to the weapon where X is the id for the weapon skill.
then remove the Attack command and leave [extra] in.
This will result in

MOVE
Scythe
Special

if using a scythe

or
MOVE
Spear
Special

if using a spear.

Oh sweet, so I could use this to make a weapon master class right? Basically starts off with sword and uses skills to swap weapons. Swap weapon to spear/hammer/scythe/javelin/bow. Make custom weapons that the skills will call upon. I could even make it so that depending on the weapon I could get different skills right? Like 2 skills per weapon and then the default attack scope for each.

I don't know if you ever played dark souls but in it the scythes only do full damage if you hit the enemies with the blade. So to do this for a scythe that has 3 range but only the 3rd box hitting max power would I just make it so that the attack actually has 2 skills, one being the first 2 boxes doing about 2/3 damage and the second skill dealing full damage.

Any tips would be greatly appreciated!
Oh sweet, so I could use this to make a weapon master class right? Basically starts off with sword and uses skills to swap weapons. Swap weapon to spear/hammer/scythe/javelin/bow. Make custom weapons that the skills will call upon. I could even make it so that depending on the weapon I could get different skills right? Like 2 skills per weapon and then the default attack scope for each.

I don't know if you ever played dark souls but in it the scythes only do full damage if you hit the enemies with the blade. So to do this for a scythe that has 3 range but only the 3rd box hitting max power would I just make it so that the attack actually has 2 skills, one being the first 2 boxes doing about 2/3 damage and the second skill dealing full damage.

Any tips would be greatly appreciated!

Dark Souls was my jam for a while.

I was actually going more towards the spectral souls / agarest war route with the scythe
However yes, you can add more than 1 skill however, this WILL add a new menu option for each one.

For instance this is the notebox for my Test weapon to test the scopes of each weapon skill
upload_2017-8-24_9-4-49.png
Here's how it looks in battle,
Seems there's not enough space
(I wanted to show all my options)
upload_2017-8-24_9-8-59.png


I haven't actually figured out yet how to make skills use more than 1 skill or have different effects for different cells though.
theres a few more weapon scopes i'm currently working on so that above list will be growing.

But going off this yes,
You can make a fire blade that gives "Blade" and "Flame"
you can make a gunblade that gives the options "Slash" "Shoot"
You could make a Revolver that when shot, unequips, equips "Revolver(Empty)" and gives the skill "Reload" that when used, unequips "Revolver(Empty)" and equips "Revolver".

Similar to this, a gun blade that gives "Shoot" and "Blade Mode" if in Gun Mode and "Slash" and "Gun Mode" if in blade mode.

If you want to go the route of being able to use these switch mode/ equip skills, you will want to disable the "One turn offense" in the main LETBS plugin
upload_2017-8-24_9-21-30.png


Then what you'll need to do, is make sure all other skills have pass_on_use
this will mean after most attacks, the turn ends, but if the player uses "Gun Mode" their weapon becomes a gun and they can attack right away with "Shoot" but shoot, since it has pass_on_use will end the player's turn.

However, I do not know if you need a script to be able to equip the current actor.
However, if you make all the weapon swap skills unique to each character, you can call a common event to change their weapon in the skills settings.
If you allow a player to have 5 weapon masters and have 10 weapons, you would need 50 skills, 10 for each. Unless someone has a better idea on how to handle the equipping.


Let me know if you have any other questions regarding this.

EDIT (Since it was long).

Yanfly's skill costs script should also work with LETBS,

In theory, going with the above GunBlade now this will only apply to 1 character so you would need to add 1 bullet type (Loaded-CharacterName) if you want multiple characters with guns like this.

3 items
Bullet
Bullet(Loaded) or Bullet(Jeffrey) Bullet(Lawrence) Bullet(Fiona) etc.
Bullet(Fired)

Using Jeffrey as an example

Make reload call event
(reload-Jeffrey)
If(Bullet>5) (As in 6)
{
Add to inventory : Bullet(Jeffrey) + 6
Remove from inventory : Bullet - 6
Unequip Gun(Empty)
Equip Gun(Loaded)
}
else if Bullet>0 (its not >5, but more than 0)
{
var x = bullet in inventory
remove x bullet from inventory
add to inventory Bullet(Jeffrey)+ x
Unequip Gun(Empty)
Equip Gun(Loaded)
}
else
{
Text : No Bullets to load
//No bullets to load, no unequipping, reload failed.
}

Then when shoot is used call a common event with conditionals
(Shoot-Jeffrey)
If Bullet(Jeffrey) in inventory >1 (2 or more bullets)
{
Bullet(Jeffrey) -1
}
Else If Bullet(Jeffrey)==1 (Last bullet)
{
Bullet(Jeffrey) - 1 (Use last bullet)
Unequip Gun{Jeffrey-L}
Equip Gun(Jeffrey-E)
}
(Greater than 1 is important since shoot is using the last bullet if it equals 1)

This should work.

I'll build this weapon combo later and let you know.
So I found that Common Events cannot be called in battle by skills.

Lecode - Is there another way around this (Perhaps with sequences)

I tested the gun events and such in side-view and everything is working. Just need a way for it to work in tactical battle.
LeTBS 0.76a Update
Code:
# - 0.76a: Added restrictions to scopes ("scope_select" tag)
#          Added evaluated parameters for sequences: [string]
#          Improved the waiting process of sequences
#          Battlers can be automatically parsed from raw scopes during sequences
#          Objects are now properly parsed for sequences
#          Scopes can now be combined
#          Added the following template sequences: atk_push(x), atk_rush(x), skill_push(x), skill_pull(x)
#           where x is the number of cells to push/pull the targets
#          Added a multi selection system
#          Added a tile effect to escape battles
#          Animations tied to entities are correctly disposed when they die
#          Vertical jumps are now correctly performed
#          Fixed a bug where projectiles starting point could be wrong
#          The skill bubble is now correctly positioned to avoid obstructions
#          Windows above entities are now correctly positioned on large maps
#          Skills are now correctly categorized in the window skill
#          Fixed a bug where stuck AI entity would make the game crash
#          Fixed a flaw in AI logic causing entities to skip turns
#          Do not attempt to preview non-existant object
#          Minimal scopes are now drawn properly on map corners
#          Fixed cross scopes
#          Fixed the salvation sequence (was using the old commands)
#          Since 0.75 the tactical layer was above entities. It's now fixed
#          Event sprites are now correctly below entities level
#          Fast selection on the positioning windows correctly supports more than 4 members

So I did a lot of bugfixes. The scan command and the eventing demo was taking too much times so I decided to release a patch for now.
I'm not sure I covered all reported bugs but I'll quickly go through previous pages and prepare some patches for the next days, depending on my availability. I still wants to work on the eventing demo and make a video thought for 0.76b.
I also did a lot of work code-wise, to prepare the next versions and some commissioned work. A tackle system should be easier to come with for 0.77 too.
Updated doc page with the new features about scopes.
Doc page on multi selections.
0.76a files (only modified/new js files with demo data) - Put LeTBS_Commands just below LeTBS_Windows.
Take a look at the new skills too.

Let me know if you find any new bugs.

EDIT: About this change:
Code:
#          Added the following template sequences: atk_push(x), atk_rush(x), skill_push(x), skill_pull(x)
#           where x is the number of cells to push/pull the targets
Chaosicaa reported that people wanted to use the pull/push effects more easily. So I exploited the template sequences features. To use them just put "sequence: atk_push(x)" for example. Hopefully you'll get some clues on how template sequences work.
Can't wait to pull this into my clean demo project.

I'm going to keep trying to see if I can find a way around the common events not working when called through a skill in letbs mode.
Will keep you all posted.
Can't wait to pull this into my clean demo project.

I'm going to keep trying to see if I can find a way around the common events not working when called through a skill in letbs mode.
Will keep you all posted.

Yeah I was having this issue as well. I worked around it by setting up a common event that gets called AFTER battle is done to keep track of the kill count using a variable, however I originally wanted to keep track of the total number of times each elemental typing was cast, but this works too.

Thank you for the patch @Lecode I am about to test it out..

While you are online however I do have one question: Is there a way to create TRUE random encounters using this system? As it stands one needs to create the events to mark where monsters and player characters will spawn, but I would love to be able to have wherever the player is standing when the encounter begins get marked as the spawn location for the player, then randomly generate the monsters within a certain scope of the characters location, assuming the terrain id allows it.

Would something like this be possible? I feel very limited only having one area where battles can take place on a map.
While you are online however I do have one question: Is there a way to create TRUE random encounters using this system? As it stands one needs to create the events to mark where monsters and player characters will spawn, but I would love to be able to have wherever the player is standing when the encounter begins get marked as the spawn location for the player, then randomly generate the monsters within a certain scope of the characters location, assuming the terrain id allows it.

Would something like this be possible? I feel very limited only having one area where battles can take place on a map.
Oh yeah, I made an add-on for random encounters in 0.76a. It's in the file but I forgot to document it.
Use this code in your map comment box:
Code:
<LeTBS Encounter Maps>
default: ID_1, ID_2
area X: ID_1, ...
area Y: ...
</LeTBS Encounter Maps>
The code above is setting random encounter maps by default or based on terrain tags (X and Y, for instance). The party is teleported to the selected map and the battle begins. You can also set up the position of transfert by adding <LeTBS Transfer Pos [DIR]> to a blank event where DIR is either 2,4,6 or 8 - the direction of the teleported party.
The add-on is featured on the demo.

I'll make LeTBS support common events in the next patch.
Oh yeah, I made an add-on for random encounters in 0.76a. It's in the file but I forgot to document it.
Use this code in your map comment box:
Code:
<LeTBS Encounter Maps>
default: ID_1, ID_2
area X: ID_1, ...
area Y: ...
</LeTBS Encounter Maps>
The code above is setting random encounter maps by default or based on terrain tags (X and Y, for instance). The party is teleported to the selected map and the battle begins. You can also set up the position of transfert by adding <LeTBS Transfer Pos [DIR]> to a blank event where DIR is either 2,4,6 or 8 - the direction of the teleported party.
The add-on is featured on the demo.

I'll make LeTBS support common events in the next patch.

Thank you for the reply @Lecode !

What if I don't want to teleport to a new map, and I want the position of transfer for where the battle starts to be exactly where the character is standing when the random encounter begins? (I only use one playable character in the party for my game)

e.g.

Player is walking, random encounter begins where the player is standing, and enemies are spawned randomly on terrain not labeled 249 or 250, within a radius of 6 (ish) blocks of the player. This way I don't have to create encounter maps, and I don't have to have all battles on that map take place in one spot.

Is there anything like this possible?
Thank you so much @Pharonix I actually wanted to max a gunslinger class that used a revolver but I wasn't sure how to make a bullet system. I really like that idea. I just need to get some time off to actually start working on this.
Player is walking, random encounter begins where the player is standing, and enemies are spawned randomly on terrain not labeled 249 or 250, within a radius of 6 (ish) blocks of the player. This way I don't have to create encounter maps, and I don't have to have all battles on that map take place in one spot.

Is there anything like this possible?
This is sick, I like the idea.... I'm already thinking about how to implement it with settings to handle long range battles. If the starting cells spawn randomly it could be too chaotic for a TBS.
This is sick, I like the idea.... I'm already thinking about how to implement it with settings to handle long range battles. If the starting cells spawn randomly it could be too chaotic for a TBS.

Thank you I really love the idea too! Perhaps making it so that the surrounding few blocks around the player are exempt from monster spawn ins could help reduce the chaos a bit, and could be allowed every so often to replicate an "ambush" type event where suddenly oh hey, there's an orc in my face... lol

Original thread: https://forums.rpgmakerweb.com/threads/lecode-tactical-battle-system-0-77-2b.71572/