Lecode Tactical Battle System 0.77.2B

Sacrifyx

Veteran
Veteran
Joined
Oct 16, 2012
Messages
110
Reaction score
9
First Language
English
Primarily Uses
RMMV
Gotta revisit an old problem here - system is working pretty much the way I need it thus far. Only issue I'm having currently is with the last enemy on-screen - once they die, they don't play death animation and disappear. HP drops to 0 and the victory music plays with the enemy still onscreen. Minor issue, but definitely something that bugs me.

A couple other things - how can I make a character spawn into battle facing a certain direction? Related, how can I prevent them from changing direction during message display? They all seem to want to face downward when they're talking.

Aaaaaand...something else. It seems that when I save my game and reload it (not sure if it matters for an instant reload or if I close the game and relaunch/reload), the next battle errors out with a can't read property error. I'll get the specific error if needed. It doesn't come up if I just play straight through.
 
Last edited:

Utopiablue

Veteran
Veteran
Joined
Apr 11, 2015
Messages
44
Reaction score
19
First Language
english
Primarily Uses
Gotta revisit an old problem here - system is working pretty much the way I need it thus far. Only issue I'm having currently is with the last enemy on-screen - once they die, they don't play death animation and disappear. HP drops to 0 and the victory music plays with the enemy still onscreen. Minor issue, but definitely something that bugs me.
I had the same problem. This is how I fixed it.
In LeTBS.js go to line 3877 (for ver. 7.72) and replace "BattleManagerTBS.checkDefeatAndVictory" function with this one:

BattleManagerTBS.checkDefeatAndVictory = function () {
if (!this.anySequenceRunning()) {
if (this.canPrepareDefeat()) {
this.prepareDefeat();
return false;
} else if (this.canPrepareVictory()) {
this.prepareVictory();
return false;
}
return true;
}
};

That will allow all sequences to finish playing before going to Victory or Defeat.
 

Sacrifyx

Veteran
Veteran
Joined
Oct 16, 2012
Messages
110
Reaction score
9
First Language
English
Primarily Uses
RMMV
YES! That's one down. Thanks a bunch for that fix.

Now I just need to figure out how to make a character spawn into battle facing a certain direction, how to prevent them from changing direction during dialogue, and also curious if there's a way to prevent them changing direction when attacking. I have turreted weapons that should preclude the need to face the enemy (or even in their general direction). Those and the save thing I also mentioned above.
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
756
Reaction score
344
First Language
English
Primarily Uses
RMMV
YES! That's one down. Thanks a bunch for that fix.

Now I just need to figure out how to make a character spawn into battle facing a certain direction, how to prevent them from changing direction during dialogue, and also curious if there's a way to prevent them changing direction when attacking. I have turreted weapons that should preclude the need to face the enemy (or even in their general direction). Those and the save thing I also mentioned above.
For the turrets, just make a sheet where it uses the same direction for all rows
 

Sacrifyx

Veteran
Veteran
Joined
Oct 16, 2012
Messages
110
Reaction score
9
First Language
English
Primarily Uses
RMMV
Well the turrets themselves work fine, the only issue is the ship (it's a space game) turns to face the enemy when it fires and I'd prefer it remain stationary if at all possible. If it isn't, then that's life I guess.
 

AbstractMan

Forever lost in the Tea Room of Despair
Veteran
Joined
Jun 22, 2019
Messages
48
Reaction score
17
First Language
English
Primarily Uses
RMMV
Should be an easy fix. You will need to make a character sheet entirely of the direction you want it to face on whatever pose _sequence you are using
 

Sacrifyx

Veteran
Veteran
Joined
Oct 16, 2012
Messages
110
Reaction score
9
First Language
English
Primarily Uses
RMMV
I assume you mean for the pose(atk) in the character notetags? Problem with that is there's also weapons that only fire forward.
 

Utopiablue

Veteran
Veteran
Joined
Apr 11, 2015
Messages
44
Reaction score
19
First Language
english
Primarily Uses
Well the turrets themselves work fine, the only issue is the ship (it's a space game) turns to face the enemy when it fires and I'd prefer it remain stationary if at all possible. If it isn't, then that's life I guess.
Okay, what you could do is this...
Put this notetag <stationary_atk> in the notebox on whatever Ally or Enemy you want to have stationary attacks.
Next, open up LeTBS.js and go to line 3485 (version 7.72) and find "BattleManagerTBS.executeAction". Replace that function with this:

BattleManagerTBS.executeAction = function () {
this._subPhase = "obj_invokation";
var action = this.activeAction();
var item = action.item();
var entity = this.activeEntity();
var id = action.isAttack() ? entity.getWeaponSequenceData() : entity.getObjectSequenceData(item);
var fastSequence = action.isAttack() ? entity.getWeaponFastSequence() : entity.getObjectFastSequence(item);

if(entity.battler().isActor()){
if (!$dataActors[entity.battler().actorId()].meta.stationary_atk){
entity.lookAt(this._activeCell);
}
} else {
if (!$dataEnemies[entity.battler().enemyId()].meta.stationary_atk){
entity.lookAt(this._activeCell);
}
}

entity._actionPerformed = true;
entity.battler()._itemOnUse = item;
this.activeBattler().useItem(item);
action.applyGlobal();
entity.onActionStart(id, fastSequence, action);
if (fastSequence.length > 0)
entity.startSequence(fastSequence, action);
else
entity.startSequence(id, action);
};

Also, go to line 6482 and find function "TBSAiManager.prototype.commandUseP2".
Replace it with this one:

TBSAiManager.prototype.commandUseP2 = function (obj) {
var cellTarget = this._actionData.cellTarget;
var center = this._entity.getCell().toCoords();
var cell = this.getClosestActionCellToTarget(cellTarget, obj, center);

this.BM().setCursorCell(cell);
//this.BM().updateActionSelection();

if(this._entity.battler().isActor()){
if (!$dataActors[this._entity.battler().actorId()].meta.stationary_atk){
this._entity.lookAt(cell);
}
} else {
if (!$dataEnemies[this._entity.battler().enemyId()].meta.stationary_atk){
this._entity.lookAt(cell);
}
}

if (Lecode.S_TBS.showScopes) {
var wait = Lecode.S_TBS.aiWaitTime;
this.BM().wait(wait);
}

this._commandPhase = "obj_selection_wait";
this._commandNextPhaseCallBack = this.commandUseP3.bind(this, obj);
};

Save it and then try it out.
 

ZankokuNoYami

Veteran
Veteran
Joined
May 11, 2018
Messages
109
Reaction score
25
First Language
English
Primarily Uses
N/A
I didn't see it... or I'm blind. This thing is SOOOO overwhelming. Mainly because its been years and I am sure all of it was introduced little by little over that time. But now it's just all in my face, hahaha. Not complaining, I mean, it's amazing! Seriously! Love the work you have done with this!

It has a lot of the things I need to make my game work. The games focus is on investigating and a slow and steady approach. No grinding. But one thing I do need is the ability to switch weapons. My characters use both melee and ranged.

So... does this support currently, or is there a plugin currently, that would let a character switch weapons mid battle?
 

Sacrifyx

Veteran
Veteran
Joined
Oct 16, 2012
Messages
110
Reaction score
9
First Language
English
Primarily Uses
RMMV
Okay, what you could do is this...
Put this notetag <stationary_atk> in the notebox on whatever Ally or Enemy you want to have stationary attacks.
Next, open up LeTBS.js and go to line 3485 (version 7.72) and find "BattleManagerTBS.executeAction". Replace that function with this:

BattleManagerTBS.executeAction = function () {
this._subPhase = "obj_invokation";
var action = this.activeAction();
var item = action.item();
var entity = this.activeEntity();
var id = action.isAttack() ? entity.getWeaponSequenceData() : entity.getObjectSequenceData(item);
var fastSequence = action.isAttack() ? entity.getWeaponFastSequence() : entity.getObjectFastSequence(item);

if(entity.battler().isActor()){
if (!$dataActors[entity.battler().actorId()].meta.stationary_atk){
entity.lookAt(this._activeCell);
}
} else {
if (!$dataEnemies[entity.battler().enemyId()].meta.stationary_atk){
entity.lookAt(this._activeCell);
}
}

entity._actionPerformed = true;
entity.battler()._itemOnUse = item;
this.activeBattler().useItem(item);
action.applyGlobal();
entity.onActionStart(id, fastSequence, action);
if (fastSequence.length > 0)
entity.startSequence(fastSequence, action);
else
entity.startSequence(id, action);
};

Also, go to line 6482 and find function "TBSAiManager.prototype.commandUseP2".
Replace it with this one:

TBSAiManager.prototype.commandUseP2 = function (obj) {
var cellTarget = this._actionData.cellTarget;
var center = this._entity.getCell().toCoords();
var cell = this.getClosestActionCellToTarget(cellTarget, obj, center);

this.BM().setCursorCell(cell);
//this.BM().updateActionSelection();

if(this._entity.battler().isActor()){
if (!$dataActors[this._entity.battler().actorId()].meta.stationary_atk){
this._entity.lookAt(cell);
}
} else {
if (!$dataEnemies[this._entity.battler().enemyId()].meta.stationary_atk){
this._entity.lookAt(cell);
}
}

if (Lecode.S_TBS.showScopes) {
var wait = Lecode.S_TBS.aiWaitTime;
this.BM().wait(wait);
}

this._commandPhase = "obj_selection_wait";
this._commandNextPhaseCallBack = this.commandUseP3.bind(this, obj);
};

Save it and then try it out.
So this kind of worked. When I fired the turreted weapon, the ship maintained its initial direction, this is good. When firing a weapon that was forward fire only (using a line scope, anyway), it fired the weapon in the direction the ship was facing, then the ship turned to actually face the enemy. The hit still landed even though visually it was fired off into nowhere.
 

Utopiablue

Veteran
Veteran
Joined
Apr 11, 2015
Messages
44
Reaction score
19
First Language
english
Primarily Uses
Alright, I guess I'm going to have to go to the source, which is the function "TBSEntity.prototype.lookAt".
First thing I would like you to do is undo the changes that was made.
Replace function "BattleManagerTBS.executeAction" back to this one:

BattleManagerTBS.executeAction = function () {
this._subPhase = "obj_invokation";
var action = this.activeAction();
var item = action.item();
var entity = this.activeEntity();
var id = action.isAttack() ? entity.getWeaponSequenceData() : entity.getObjectSequenceData(item);
var fastSequence = action.isAttack() ? entity.getWeaponFastSequence() : entity.getObjectFastSequence(item);

entity.lookAt(this._activeCell);
entity._actionPerformed = true;
entity.battler()._itemOnUse = item;
this.activeBattler().useItem(item);
action.applyGlobal();
entity.onActionStart(id, fastSequence, action);
if (fastSequence.length > 0)
entity.startSequence(fastSequence, action);
else
entity.startSequence(id, action);
};

Replace function "TBSAiManager.prototype.commandUseP2" back to this one:

TBSAiManager.prototype.commandUseP2 = function (obj) {
var cellTarget = this._actionData.cellTarget;
var center = this._entity.getCell().toCoords();
var cell = this.getClosestActionCellToTarget(cellTarget, obj, center);

this.BM().setCursorCell(cell);
//this.BM().updateActionSelection();

this._entity.lookAt(cell);
if (Lecode.S_TBS.showScopes) {
var wait = Lecode.S_TBS.aiWaitTime;
this.BM().wait(wait);
}

this._commandPhase = "obj_selection_wait";
this._commandNextPhaseCallBack = this.commandUseP3.bind(this, obj);
};

Now, that the functions are back to normal let's try this out...
First, go to line 9036 and find function "TBSEntity.prototype.getDirectionTo".
Replace it with this :

TBSEntity.prototype.getDirectionTo = function (cell) {
this._skilldirect = true;
var oldDir = this.getDir();
this.lookAt(cell);
var dir = this.getDir();
this.setDir(oldDir);
return dir;
};

Lastly, go to the source of all entity direction, line 8985 and find function "TBSEntity.prototype.lookAt".
Replace it with this version:

TBSEntity.prototype.lookAt = function (cell) {

if(this.battler().isActor()){
if (!this._moving && !this._skilldirect && BattleManagerTBS._subPhase !== "directionSelector_input" && $dataActors[this.battler().actorId()].meta.stationary_atk){
return;
}
} else {
if (!this._moving && !this._skilldirect && BattleManagerTBS._subPhase !== "directionSelector_input" && $dataEnemies[this.battler().enemyId()].meta.stationary_atk){
return;
}
}
this._skilldirect = false;

var downD = cell.y - this._cellY;
var upD = this._cellY - cell.y;
var rightD = cell.x - this._cellX;
var leftD = this._cellX - cell.x;
var maxD = LeUtilities.getMaxInArray([downD, upD, rightD, leftD]);
switch (maxD) {
case downD:
this.setDir(2);
break;
case upD:
this.setDir(8);
break;
case leftD:
this.setDir(4);
break;
case rightD:
this.setDir(6);
break;
}
};

Hope this helps.
 

Sacrifyx

Veteran
Veteran
Joined
Oct 16, 2012
Messages
110
Reaction score
9
First Language
English
Primarily Uses
RMMV
Alright, I guess I'm going to have to go to the source, which is the function "TBSEntity.prototype.lookAt".
First thing I would like you to do is undo the changes that was made.
Replace function "BattleManagerTBS.executeAction" back to this one:

BattleManagerTBS.executeAction = function () {
this._subPhase = "obj_invokation";
var action = this.activeAction();
var item = action.item();
var entity = this.activeEntity();
var id = action.isAttack() ? entity.getWeaponSequenceData() : entity.getObjectSequenceData(item);
var fastSequence = action.isAttack() ? entity.getWeaponFastSequence() : entity.getObjectFastSequence(item);

entity.lookAt(this._activeCell);
entity._actionPerformed = true;
entity.battler()._itemOnUse = item;
this.activeBattler().useItem(item);
action.applyGlobal();
entity.onActionStart(id, fastSequence, action);
if (fastSequence.length > 0)
entity.startSequence(fastSequence, action);
else
entity.startSequence(id, action);
};

Replace function "TBSAiManager.prototype.commandUseP2" back to this one:

TBSAiManager.prototype.commandUseP2 = function (obj) {
var cellTarget = this._actionData.cellTarget;
var center = this._entity.getCell().toCoords();
var cell = this.getClosestActionCellToTarget(cellTarget, obj, center);

this.BM().setCursorCell(cell);
//this.BM().updateActionSelection();

this._entity.lookAt(cell);
if (Lecode.S_TBS.showScopes) {
var wait = Lecode.S_TBS.aiWaitTime;
this.BM().wait(wait);
}

this._commandPhase = "obj_selection_wait";
this._commandNextPhaseCallBack = this.commandUseP3.bind(this, obj);
};

Now, that the functions are back to normal let's try this out...
First, go to line 9036 and find function "TBSEntity.prototype.getDirectionTo".
Replace it with this :

TBSEntity.prototype.getDirectionTo = function (cell) {
this._skilldirect = true;
var oldDir = this.getDir();
this.lookAt(cell);
var dir = this.getDir();
this.setDir(oldDir);
return dir;
};

Lastly, go to the source of all entity direction, line 8985 and find function "TBSEntity.prototype.lookAt".
Replace it with this version:

TBSEntity.prototype.lookAt = function (cell) {

if(this.battler().isActor()){
if (!this._moving && !this._skilldirect && BattleManagerTBS._subPhase !== "directionSelector_input" && $dataActors[this.battler().actorId()].meta.stationary_atk){
return;
}
} else {
if (!this._moving && !this._skilldirect && BattleManagerTBS._subPhase !== "directionSelector_input" && $dataEnemies[this.battler().enemyId()].meta.stationary_atk){
return;
}
}
this._skilldirect = false;

var downD = cell.y - this._cellY;
var upD = this._cellY - cell.y;
var rightD = cell.x - this._cellX;
var leftD = this._cellX - cell.x;
var maxD = LeUtilities.getMaxInArray([downD, upD, rightD, leftD]);
switch (maxD) {
case downD:
this.setDir(2);
break;
case upD:
this.setDir(8);
break;
case leftD:
this.setDir(4);
break;
case rightD:
this.setDir(6);
break;
}
};

Hope this helps.
Only difference is now the ship doesn't turn after firing a forward facing weapon. Still lands the hit that it fired into nowhere.
 

Utopiablue

Veteran
Veteran
Joined
Apr 11, 2015
Messages
44
Reaction score
19
First Language
english
Primarily Uses
So I did fix the stationary problem. That's good. Now the problem with this forward facing weapon... is this a skill that the ship entity has or is this the turret entity? I play tested with a stationary entity with the skills provided in the 0.77.2b demo and they all seem to work as intended. This makes me believe that the issue you have with the forward facing weapon that fires off into nowhere is a skill or sequence issue.
Can you show me pics of this skill, showing the info in the notes box and the info you wrote in LeTBSconfig.js so
I can test this skill out?
 

ZankokuNoYami

Veteran
Veteran
Joined
May 11, 2018
Messages
109
Reaction score
25
First Language
English
Primarily Uses
N/A
I have a couple of questions:

1) Is there a way to increase a characters mobility as the game progresses? Or even decrease? (Like say there is a point he is wounded and thus has less squares he can move). Or certain equipment that lets him move further?

2) Is there a way to have a battle start with the character already on a square? As in, you dont choose where to place them? I guess I could just remedy it by making only one square. But feels unnecessary at that point.

3) I dont quite understand one of the plugins. I am guessing by hitting shift, it can take you to points of the map? Or, like, view those parts with scrolling? But I created a brand new map and just threw down what I needed to test a battle. Accidentally hit shift and got this:

1582861258141.png

4) In the demo, if I try to 'push' the treasure chest, I got this:
1582864051953.png

5) I do not see anything in the demo letting me adjust the sprite size. Or if I am using a taller sprite, do I need to do like they did for actor 1 and split the cells individually? Because I didn't really realize the monster sprite I had bought was taller than normal until I noticed it was displaying only half of it in the game...
 
Last edited:

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
756
Reaction score
344
First Language
English
Primarily Uses
RMMV
I have passive skills that grant states that increase movement.

All my "Skills" require the skill equip system from Yanfly, so if a character wants more mobility, you sacrifice other skills.

Sometimes that Scrolling issue occurs. I think someone earlier had an idea for a fix, but I honestly cannot remember.

As for the chest, I don't quite remember whats wrong with the chest. I had a map with chests of my own, and haven't had that issue.
 

Sacrifyx

Veteran
Veteran
Joined
Oct 16, 2012
Messages
110
Reaction score
9
First Language
English
Primarily Uses
RMMV
So I did fix the stationary problem. That's good. Now the problem with this forward facing weapon... is this a skill that the ship entity has or is this the turret entity?
I play tested with a stationary entity with the skills provided in the 0.77.2b demo and they all seem to work as intended. This makes me believe that the issue you have with the forward facing weapon that fires off into nowhere is a skill or sequence issue.
Can you show me pics of this skill, showing the info in the notes box and the info you wrote in LeTBSconfig.js so
I can test this skill out?
Here's the forward facing weapon skill:
RGSkill.png
And here is the sequence for it.
"railgun": [
"wait: 10",
"set_frame: user, atk, 0",
"wait: 30",
"play_pose: user, atk",
"directional_anim: user, user, 199, 198, 196, 197",
"look_at: user, cursor_cell",
"set_speed: user, +6",
"set_speed: user, reset",
"set_frame: user, atk, last",
"wait: 12",
"effects: {aoe}_battlers, current_obj, obj_anim",
"wait: 20",
"play_pose: user, idle",
"wait: 10"
],

And here's a link to the project itself as it stands at this very moment, in case you need a closer look at anything not provided here. If you do go into it, please don't judge it too harshly as this was originally only supposed to be a testbed for LeTBS to see if it was suitable for my main project, but I liked it so much I decided to try and flesh it out into a project of its own.
 
Last edited:

AbstractMan

Forever lost in the Tea Room of Despair
Veteran
Joined
Jun 22, 2019
Messages
48
Reaction score
17
First Language
English
Primarily Uses
RMMV
Afternoon! Has anyone found a way to attach poses to different states? We found a way to change sprites using states but not the actual poses. I even attempted to code the enemy poses in sequences but to no avail. It seems like it should be easy and more than possible but maybe its not. Anyone know ?
 

ZankokuNoYami

Veteran
Veteran
Joined
May 11, 2018
Messages
109
Reaction score
25
First Language
English
Primarily Uses
N/A
I have passive skills that grant states that increase movement.

All my "Skills" require the skill equip system from Yanfly, so if a character wants more mobility, you sacrifice other skills.

Sometimes that Scrolling issue occurs. I think someone earlier had an idea for a fix, but I honestly cannot remember.

As for the chest, I don't quite remember whats wrong with the chest. I had a map with chests of my own, and haven't had that issue.
Is there any particular set up for those passive skills? I am not quite sure how movement works aside from the initial setting. So do you have to see up some sort of script or plugin call? Or is there a state that actually affects it?

I Have yanflys attachments to weapons and armor and what not. I was thinking of having it so the armor material could increase or decrease mobility. You want more def, you give up mobility. Want more mobility, give up def. Simular idea to your passive skill idea.

Also, does anyone know how to add Yanfly's equip during battle to the available actions? Or does it not work with this system?
 
Last edited:

Utopiablue

Veteran
Veteran
Joined
Apr 11, 2015
Messages
44
Reaction score
19
First Language
english
Primarily Uses
Here's the forward facing weapon skill:
And here is the sequence for it.
"railgun": [
"wait: 10",
"set_frame: user, atk, 0",
"wait: 30",
"play_pose: user, atk",
"directional_anim: user, user, 199, 198, 196, 197",
"look_at: user, cursor_cell",
"set_speed: user, +6",
"set_speed: user, reset",
"set_frame: user, atk, last",
"wait: 12",
"effects: {aoe}_battlers, current_obj, obj_anim",
"wait: 20",
"play_pose: user, idle",
"wait: 10"
],
I got it to work now. It turns out that I needed to edit the "directional_anim" command function. But first, I found three things in your sequence that doesn't need to be there.

"look_at: user, cursor_cell", "set_speed: user, +6", "set_speed: user, reset". There is no need to look at target because ship is stationary. And increasing the speed and then resetting it straight after doesn't make sense.
So now your sequence should look like this:

"railgun": [
"wait: 10",
"set_frame: user, atk, 0",
"wait: 30",
"play_pose: user, atk",
"directional_anim: user, user, 199, 198, 196, 197",
"set_frame: user, atk, last",
"wait: 12",
"effects: {aoe}_battlers, current_obj, obj_anim",
"wait: 20",
"play_pose: user, idle",
"wait: 10"
],

Next, go to line 3485 and find the function "BattleManagerTBS.executeAction".
Replace it with this one:

BattleManagerTBS.executeAction = function () {
this._subPhase = "obj_invokation";
var action = this.activeAction();
var item = action.item();
var entity = this.activeEntity();
var id = action.isAttack() ? entity.getWeaponSequenceData() : entity.getObjectSequenceData(item);
var fastSequence = action.isAttack() ? entity.getWeaponFastSequence() : entity.getObjectFastSequence(item);

this._direction = entity.getDirectionTo(this._activeCell);

entity.lookAt(this._activeCell);
entity._actionPerformed = true;
entity.battler()._itemOnUse = item;
this.activeBattler().useItem(item);
action.applyGlobal();
entity.onActionStart(id, fastSequence, action);
if (fastSequence.length > 0)
entity.startSequence(fastSequence, action);
else
entity.startSequence(id, action);
};

Lastly, go to line 7305 and find function "TBSSequenceManager.prototype.commandDirectionalAnim".
Replace it with this one:

TBSSequenceManager.prototype.commandDirectionalAnim = function (param) {
var targetData1 = param[0];
var targetData2 = param[1];
var anim_2 = param[2];
var anim_4 = param[3];
var anim_6 = param[4];
var anim_8 = param[5];
var animDelay = Number(param[6] || 0);
var wait = String(param[7] || "false");
var targets1 = this.readTargets(targetData1);

if (targets1.length > 0) {
var anim;
switch (BattleManagerTBS._direction) {
case 2:
anim = anim_2;
break;
case 4:
anim = anim_4;
break;
case 6:
anim = anim_6;
break;
case 8:
anim = anim_8;
break;
}
param[0] = targetData2;
param[1] = anim;
param[2] = animDelay;
param[3] = wait;
return this.commandAnim(param);
}
return {};
};

And that should do it.
 

Sacrifyx

Veteran
Veteran
Joined
Oct 16, 2012
Messages
110
Reaction score
9
First Language
English
Primarily Uses
RMMV
I got it to work now. It turns out that I needed to edit the "directional_anim" command function. But first, I found three things in your sequence that doesn't need to be there.

"look_at: user, cursor_cell", "set_speed: user, +6", "set_speed: user, reset". There is no need to look at target because ship is stationary. And increasing the speed and then resetting it straight after doesn't make sense.
So now your sequence should look like this:

"railgun": [
"wait: 10",
"set_frame: user, atk, 0",
"wait: 30",
"play_pose: user, atk",
"directional_anim: user, user, 199, 198, 196, 197",
"set_frame: user, atk, last",
"wait: 12",
"effects: {aoe}_battlers, current_obj, obj_anim",
"wait: 20",
"play_pose: user, idle",
"wait: 10"
],

Next, go to line 3485 and find the function "BattleManagerTBS.executeAction".
Replace it with this one:

BattleManagerTBS.executeAction = function () {
this._subPhase = "obj_invokation";
var action = this.activeAction();
var item = action.item();
var entity = this.activeEntity();
var id = action.isAttack() ? entity.getWeaponSequenceData() : entity.getObjectSequenceData(item);
var fastSequence = action.isAttack() ? entity.getWeaponFastSequence() : entity.getObjectFastSequence(item);

this._direction = entity.getDirectionTo(this._activeCell);

entity.lookAt(this._activeCell);
entity._actionPerformed = true;
entity.battler()._itemOnUse = item;
this.activeBattler().useItem(item);
action.applyGlobal();
entity.onActionStart(id, fastSequence, action);
if (fastSequence.length > 0)
entity.startSequence(fastSequence, action);
else
entity.startSequence(id, action);
};

Lastly, go to line 7305 and find function "TBSSequenceManager.prototype.commandDirectionalAnim".
Replace it with this one:

TBSSequenceManager.prototype.commandDirectionalAnim = function (param) {
var targetData1 = param[0];
var targetData2 = param[1];
var anim_2 = param[2];
var anim_4 = param[3];
var anim_6 = param[4];
var anim_8 = param[5];
var animDelay = Number(param[6] || 0);
var wait = String(param[7] || "false");
var targets1 = this.readTargets(targetData1);

if (targets1.length > 0) {
var anim;
switch (BattleManagerTBS._direction) {
case 2:
anim = anim_2;
break;
case 4:
anim = anim_4;
break;
case 6:
anim = anim_6;
break;
case 8:
anim = anim_8;
break;
}
param[0] = targetData2;
param[1] = anim;
param[2] = animDelay;
param[3] = wait;
return this.commandAnim(param);
}
return {};
};

And that should do it.
This is closer. Now the weapon fires off in the proper direction, but the ship still doesn't face in the proper direction.

I noticed this also raises an issue with another weapon. This ship can launch a fighter wing as an attack. The fighter wing has a circle scope so attacks like a turreted weapon but should always fire in the direction the ship is facing, if that makes sense. Forgive my ignorance, but would it be possible (easier? way more difficult?) to define additional notetags that can be applied to weapons or skills that would give the proper movement behavior to whatever is using those weapons or skills? My thought is something like the <stationary_atk> tag could maybe be assigned to a skill rather than an actor? Would probably need something for attacks like the fighter wing as well to force it to fire in the facing direction. I really know absolutely nothing about coding so I'm just spouting off here.

And just so I'm clear, those extra lines in the sequence aren't hurting anything, they're just redundant, yes? I ask because all my "custom" sequences are just copypasta'd and renamed from stock sequences. I did remove them as requested, just curious about the troubles they might cause as I noticed those lines are in the few other custom sequences I have as well.
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Ami
Me: It's dark cloudy! I hope it's Rain…
(2-3 Hours Later,Changed To Sunny)
Me: :kaolivid:
EpicFILE wrote on Dr_Bonehead's profile.
Dr_Bonehead? You're in this forum too? :D
Take a listen to this beautiful 1975 supermarket music. :D

Somehow it makes me think that the actual real world is still at 1970s. What we experience now is just a futuristic dream. :)
Want to play sandbox games as long its not the online only.
Building on the previous post, why stop at titlescreen idle videos? Now you can have videos as splash screens before the title screen too! [Free Plugin]

Forum statistics

Threads
104,534
Messages
1,006,986
Members
136,026
Latest member
dispriva
Top