DSX3D

Warper
Member
Joined
May 15, 2017
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm using Yanfly's Row Formation Plugin to make a custom battle system and have run into a snag that has me tearing my hair out the past couple days.

So, what I want to do is simple in theory. I want a skill that moves my character to the back row and fires his bow. I've got all that set up and working, but here's the problem: no matter what I do, the row change (and state assignment) happens AFTER damage is calculated. So if he started in the front row the skill does extra damage, middle does normal, back row does reduced damage. If I make the skill attack 2 random enemies, the first hit gets calculated from the starting row and second hit calculates from the destination.

I think the issue is that Yanfly's script passes the 'row change request' to some sort of update method and that method isn't being called until the first damage calc happens. I have tried all the Lunatic Mode methods as well and the skill still behaves the same.

Yanfly's script works flawlessly for normal usage so there is nothing wrong with the plugin, it's just an issue with this particular usage case.

I have a couple workarounds in mind, like using a blank dummy skill before the real attack or somehow triggering the row change when the skill select window opens (I'd like to learn how to do that as well, so share if u know how) but my knowledge of RM only goes so far (been at this less than half a week). I would prefer a more elegant solution (like extending Yanfly's plugin) rather than a workaround if possible.

ANY guidance would be very much appreciated with this issue.

Thanks

PS:
I'm an experienced programmer, studied game dev in college, but I'm fairly new to Rpg Maker. C# is my specialty though and javascript feels very chaotic and unorganized to me, but don't be afraid to get technical if you need to. I need to learn anyway since I've fallen in love with RM and need to learn its language anyway. I'm not afraid to write a plugin if I need to.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,147
Reaction score
10,708
First Language
Czech
Primarily Uses
RMMV
I would rather workaround that instead of editing the plugin, because if you edit whole plugin for just one skill, it can get rather messy for other skills.
However, this is how you can do it.
The skill will do two things. First thing is the row swap, second thing is Force action - shoot arrow - called through script command. Looks elegant enough to me :)
 

DSX3D

Warper
Member
Joined
May 15, 2017
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
I would rather workaround that instead of editing the plugin, because if you edit whole plugin for just one skill, it can get rather messy for other skills.
However, this is how you can do it.
The skill will do two things. First thing is the row swap, second thing is Force action - shoot arrow - called through script command. Looks elegant enough to me :)

Well, if I can get this to work it's going to apply to way more than one skill, I'll probably use it for a bunch of magic spells as well.
So I'm doing all this in the 'note' section of the skill in question, if I can get it working I'll probably wrap it up into a javascript function and load it in as a plugin (I already have my skill damage formulas set up this way). That's later though...for now I would be happy to have it work from notes.

I don't think it works the way you would expect in this case. The row swap is the very first thing that gets called in the skill notes, and the function itself DOES get called before anything else. The row change itself doesn't happen immediately, it passes the request off to "Scene_Battle.prototype.update" (as far as I can tell) and then the rows get updated (actors moved, states added and removed, etc) whenever that function gets invoked by the rpg maker core.
So it doesn't matter when the row change gets requested, it won't happen until that update function gets called.

Is it possible to call that update function from the notes? If so, what syntax would I need to use?
 

DSX3D

Warper
Member
Joined
May 15, 2017
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ok, I finished my workaround...not a perfect solution, so any suggestions for a better way are welcome.

It took a LOT of tweaking to make this work, anything different than this setup causes all kinds of weird issues (including row changes only happening one row at a time, and combat that doesn't end when everything is dead.)

REQUIRES: YEP_RowFormation and YEP_X_ActSeqPack1
Also, I think the Update Rows event needs to be at the bottom of your Effects list for your skill.

First: Make a new skill:
(Back Row)
Scope: TheUser
Damage Type: Mp Recover
Formula: 0
Note: <Change User Row: 3>

Second: Make a Common Event
(Change To Back Row)
Force Action: PLAYER, Back Row, Random

Third: Make another Common Event
(Update Rows)
Script : $gameParty.updateRows();
: : $gameTroop.updateRows();

Fourth: Create your Skill
(Duck and Fire)
Effects:
Common Event Change To Back Row
Common Event Update Rows
Note:
<setup action>
action common event
</setup action>
<target action>
action common event
</target action>

IT WORKS! That's the important part...thanks for your suggestion Poryg :)

UPDATE: Ok, I lied, this method only works for moving to the front row (when I tested this method I did it backwards so my char would start in the back and take less damage)...it appears that the updateRows function actually just moves the character forward one row if the front row is empty. Back to square one again :-/

On a side note: for anyone looking to extend the RowFormation plugin to move the middle row forward when the front row characters die (I have seen a ton of requests for this functionality), the updateRows function and the function that checks a row for alive members are the two methods you need to inherit.

For now, back to the drawing board. I'll try calling that update function directly that Poryg mentions in the next post and see how that works. Otherwise I'll have to use that updateRows function as a template and build a new function into the plugin. I think it uses adjustRow(x) to do what it does...maybe that method adjusts the row instantly. If nothing else, I'm getting closer to a solution.
 
Last edited:

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,147
Reaction score
10,708
First Language
Czech
Primarily Uses
RMMV
You're welcome :) just try to avoid double posting, the mods don't like to see it there.

And yes, it is possible to call the function you mentioned above. Either through SceneManager.update or something like that (I don't know the exact formula for that) or just using so Scene_Battle.prototype.update(). The first one is a command from the jQuery, which is a series of comands to make working with data easier, one calls the raw function. Both should work.
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

so... I decided since a park was an area in my game... here's an enemy that's slide with a hand behind it. cause why not.
Hot chocolate and music make studying and note-taking much easier :kaoluv:
Until my hand cramps up from writing too much!
Doing RPG Maker News for 21st September 2021


Malak is still waiting for Dark Deception Chapter 4... This was him yesterday after another sugar crash.
Again, he's fine. He's just bored at this point, considering he's exhausted his entire vacation bucket list.
Am I the only one who files custom resources under specific folders to remember who to credit? :kaoswt2:
1632263519730.png

Forum statistics

Threads
115,270
Messages
1,088,484
Members
149,875
Latest member
BlaireBear1
Top