Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits)

Thank you for your reply mate. I was at work the whole day so I had to wait forever just to reply.  I just did a whole bunch of tests so I'll put my findings here.


1. Character has dual wield set to the basic attack Skill 1 (Slot 1), with no action sequence. She attacks twice, playing both animations, deals mainhand and off-hand damage as they are supposed to be. Everything is fine.

2. Character has dual wield set to a different Skill that is an exact copy of the basic Attack command of Skill 1. Both with and without action sequence yielded the same result. One animation plays, she deals mainhand damage only.

3. Character has dual wield set to the basic attack Skill 1 with an action sequence.  Her slash animation plays only once, but she deals two sets of damage numbers, however, both are roughly half of her main-hand damage. She should be dealing 10ish and 6ish, but both numbers are never higher than 6s unless she crits.

4. Character has dual wield set to a different Skill that is an exact copy of the basic Attack command of Skill 1, but with the <Dualwield Skill> tag in note field. Both with and without action sequence yielded the same result. One animation plays, she deals one instance of mainhand damage only, damage is correct.

5. Character has dual wield set to a different Skill that is an exact copy of the basic Attack command of Skill 1, but with the <Dual wield Skill> tag in note field. Both with and without action sequence yielded the same result. One animation plays, she deals one instance of damage only, damage is half of what it should be (off-hand damage maybe?).

----

In all tests, the Actor (Actress?) has the dual wield tag given to her by her class.

$gameParty.leader().isArmedOffhand() yields True

$gameParty.leader().MHCalc() yields 10, which is most likely right Mainhand is (base 7 + weapon 5) x .9 = 10.8, so the game rounds down.

$gameParty.leader().OHCalc() yields 5.  (7 + 1) x .75 = an exact 6, so it's a wee bit lower than it should be.

$gameParty.leader().attackTimesAdd() does yield 1.

The skill is using a custom action sequence. If there is anything else I can do to help, please let me know. I'm happy to help.

Okay, using the given information, it appears we might have two separate issues here.

  1. In some of your tests, it would appear that the actor is only dealing offhand damage, despite hitting twice.
  2. Dual Wielding with action sequences doesn't seem to be working for (most?) skills.

First, for issue #1, the calculation is probably correct for the offhand damage, as you mentioned that the mainhand hit has a modifier of 0.9, which could only have been applied if you were using the Dual Wield modifier, which applies to both the main and off hands, meaning the offhand calculation is ((atk * 0.9) * 0.75 + offhand atk).

So, the next thing to do is to check that the swing counter is properly being reset after each hit. Were each of these tests done successively, from the same instances of the game? Did you have one actor who had all of these skills set, and just used them one after eachother in the same battle test without resetting in between? The current swing is stored as a value on the battler, so $gameParty.leader()._numAttacks should show a number in the console when you call it. it should return one of three values, undefined or 0, or 1. If it shows undefined, that means the actor has not yet attacked in this battle, and so, the next hit should be a main hand one. If it is 0, that means they have attacked before, but the next hit is still going to be a main hand hit, and if it is 1, the next hit will be an off hand hit. 

I think maybe it's getting stuck with the swing counter at 1, somehow, and just keeps doing the offhand attack, but only after one actual dual wield attack has already been performed. If the above console command shows a number higher than 1, then the counter is never being reset, so it just defaults to doing an offhand swing because the value isn't 0 or undefined. We can fix that, if that turns out to be the case.

For the second thing, the problem is going to be a bit trickier to work around. Dual Wield only affects the default attack skill, but it also has a function that checks if the action being used is the 'attack skill', which in RMMV was used by the YEP Weapon Unleash plugin to 'replace' the attack command with other skills. Because this plugin specifically uses the AttackTimes+ trait, which only affects the default attack skill, any skill that the engine doesn't consider the default attack will remain unaffected. 

It sounds like you're using an Equip Skills plugin to set the attack skill, but I'm not entirely sure that is all that needs to be done here, as I don't have that plugin myself so I cannot verify if it correctly sets your equipped attack skill as the attack skill, you know? It doesn't seem like it is, and this is why your second test didn't seem to work at all. In RMMZ, there is a trait to set the 'attack skill', instead of equipping a different skill as the basic attack, try setting a trait on the class to change the attack skill to the same exact copy of the default attack skill with no action sequence, and see what happens.

In your third test case, it would appear that the dual wielding 'works' but isn't working as intended. The reason for this working over the second test case would appear to be because you reverted to using the basic attack skill again. With that being said though, I think the problem here is not that it doesn't work, but that it is working as intended, I won't be able to tell myself unless you show me the entire action sequence of the attack skill to confirm, but I will explain what is happening anyway.

When a normal actor uses the normal attack it goes through the following steps:

  • Setup Actions
  • Whole Actions
  • Target Actions
  • Follow Actions
  • Finish Actions

Even without setting one up, the default attack skill still has an action sequence, as the VS team has made it so that they follow a default action sequence if one isn't specified. With the attack skill specifically, the action sequence changes slightly if the user has an Attack Times+ trait on them. 

  • Setup Actions
  • Whole Actions
  • Target Actions
  • Target Actions (repeat until Attack Times+ is reached)
  • Follow Actions
  • Finish Actions

As you may have guessed from this, dual wield functions by adding a hidden Attack Times+ to the actor, and causes their second swing to be an offhand swing instead of the main hand one. The problem here would appear to be that your custom sequence only deals damage in the target action section, and nothing else. Since I suspect all movement and animations are done during the setup (or whole, but probably setup) action, the only thing that repeats is the action effect in the target section. Again, I'd have the see the sequence to be sure, but the default sequences they use generally put attack motions and animations in the target section too, and that's why the default attack sequence works fine.

Your other note about <dual wield skill> not doing what you'd expect it to is also a bit of a misunderstanding. That tag makes it so that a multi hit skill will do split damage, and nothing else. It does not inherently make the skill hit more times. If my assumption in the first bit up top there is correct, at the time you tested this, the actor was probably already locked to the offhand some how, so that's why it only did offhand damage, again though, that's likely a bug I can fix.

To make a skill that only strikes twice if the user is dual wielding, you'd have to add in a section in your action sequence locked behind an if check that checks to see if the actor is currently dual wielding. In MV version of this plugin I had included special action sequence commands that repeated sections of the sequence if the user was dual wielding, but I could not do that in MZ because the VS BattleCore is obfuscated, and they moved action sequences to common events so I'm not sure how they're parsed. Something like 

if (user.isCurrentlyDualWielding())
//repeat target action plugin calls
end

should work for you there.

So in conclusion, 

  • See if you set the attack skill by adding an 'Attack Skill' trait to the actor's class if it works like the default attack, rather than equipping a different skill using the equip skills thing you're using.
  • Show me what your custom action sequence looks like, and if it's only got an 'action effect - target' in the target section, that's probably why it doesn't work.
  • Check those numAttacks variables and see if it's maybe not being reset correctly after an attack, and that's likely why it seems like all your split attacks are only doing offhand damage.

-Ramza

Were each of these tests done successively, from the same instances of the game? 

Yes

Did you have one actor who had all of these skills set, and just used them one after eachother in the same battle test without resetting in between?

Yes

$gameParty.leader()._numAttacks while choosing her attack does say Undefined. Oddly enough after she attacks, and tabbing over, replacing the formula, it still says undefined. Changing back to the Skill 1 attack with no AS (Gonna use that for action sequence from now on) the number does change to 0 after she attacks.

It possibly means that the MECH: Action Effect command in the AS does not actually trigger the dual wield attack mechanic.

Dual Wield only affects the default attack skill, but it also has a function that checks if the action being used is the 'attack skill', which in RMMV was used by the YEP Weapon Unleash plugin to 'replace' the attack command with other skills. Because this plugin specifically uses the AttackTimes+ trait, which only affects the default attack skill, any skill that the engine doesn't consider the default attack will remain unaffected. 

This definitely seems to be true, since my character's skill is not the default attack skill. But even so, the default attack skill with AS doesn't seem to proc correctly, hence 2 instances of off-hand damage.


It sounds like you're using an Equip Skills plugin to set the attack skill,...

Definitely. using Battle commands replacement from Visustella.

In RMMZ, there is a trait to set the 'attack skill', instead of equipping a different skill as the basic attack, try setting a trait on the class to change the attack skill to the same exact copy of the default attack skill with no action sequence, and see what happens.

After doing so, she does indeed attack twice, but both damage appear to be mainhand damage. I even set off-hand multiplier to 0.1 and she is still doing the same as her mainhand attack. This is a bit of progress though, since she does attack twice with a skill that isn't the basic attack command.

To make a skill that only strikes twice if the user is dual wielding, you'd have to add in a section in your action sequence locked behind an if check that checks to see if the actor is currently dual wielding.

Makes a lot of sense.

I could have a conditional in the AS that checks for a state given by all off-hand weapons that can trigger it (something that gives "is dual wielding" or something like that), so there's something. But how to trigger the off-hand attack eludes me.

This is my AS.

In RMMZ, there is a trait to set the 'attack skill', instead of equipping a different skill as the basic attack, try setting a trait on the class to change the attack skill to the same exact copy of the default attack skill with no action sequence, and see what happens.
After doing so, she does indeed attack twice, but both damage appear to be mainhand damage. I even set off-hand multiplier to 0.1 and she is still doing the same as her mainhand attack. This is a bit of progress though, since she does attack twice with a skill that isn't the basic attack command.

Let's work with this first. With this specific case, set the new skill as <dual wield skill> and see if the damage is correct. This shouldn't be the case here, as the engine should treat it as the normal attack at this point, but perhaps it's not.

It appears that the default action sequence command (ACSET: Target action?) would be duplicated normally, but since your action sequence doesn't have that, and uses a custom bunch of stuff in the middle there instead, it's not being repeated properly, while the MECH: Action Effect is being duplicated correctly. 

Since you tested all of the original test cases sequentially without resetting the playtest in between, it is most likely that the swing counter is never being reset, even though that might be difficult to see using that one console command I gave you. You can try putting a script call at the end of your action sequence with the following text in it, and it should reset the swing counter completely after the attack:

delete BattleManager._subject._numAttacks

From this I can see that there is definitely something I need to fix about the custom action sequence, I'll need to try to figure out how the duplication of the target action section works in the VS Battle Engine before I can come up with a real solution. As I said above, the YEP BattleCore plugin that it was based on simply repeated the entire target action section, but it doesn't seem like they have sections anymore, at least, based on your sequence there.

(1 edit)

All right, so there is some more progress here! I added the ACSET Each target action instead of just the Action Effect, and my character now actually plays 2 animations now when she attacks! Hooray for progress! Haha! So now, the only thing that doesn't work is that she is still causing both instances of main-hand damage, since she's dealing 2 ~10s and not one 10 and one ~1. I have one animation set to a slash, and the other lightning, and both animations play the way you have in your gif.  Adding the <dual wield skill> skill did nothing to the animations playing or altering the damage - both swings still do mainhand damage.

Interestingly enough, changing the ACSET to All instead of Each plays one animation and shows 2 damage numbers (both mainhand) like before, but Each does the two animations the way you have in your gif.

(+1)

That is interesting.

When I get a chance in the next few days, I'll see about duplicating this in my test project and get to the bottom of why it only seems to do main hand damage. It sort of seems like now it's resetting the swing counter to zero after every hit, but then, if it were actually doing that, the weaponsprites and animations of each swing would also both be the weapon in the main hand. Either way, it's something to do with the action sequence, so I'll try to make a couple test cases and figure it out.

I'll keep you posted when I figure out what's going on, or if I need more info from your project. 

Apologies for this taking as long as it is to figure out, since I stopped actively making RM games before MZ came out, I don't have a lot of experience actually using the plugins I made for it in a live project, so something like action sequences, which changed a lot between MV and MZ are proving difficult for me to get a grasp on.

-Ramza

No worries at all mate. I log on at least once a day and will be more than happy to provide assistance.

I am excited to see what developments you'll make. Thank you!

Alright, I've been working on this a little bit, and I've got it a lot closer to working completely, but TBH, the plugin loses almost all of it's "plug n play" ability when you're not using a default action sequence (or ACSET: all targets).

I'm working on trying to make it properly update the animation for the offhand on the second hit, but currently damage splitting is working.

Basically (and hopefully I'll be able to change this in the future) the best case is to use the default melee action sequence parameter if you can. Failing that, the ACSET: Each Target Action Set seems to work 100% as well, showing both animations, and splitting damage correctly with no other changes to the sequence, as long as it is your default attack skill.

I am still working on getting non templated sequences to work completely. I suspect I'll have to see if I can get someone from the VS team to assist me, as I'm pretty tapped out on stuff I can fumble around blindly with.

For now, I managed to get damage splitting to work, but the animation for the offhand hit is still showing the mainhand weapon animation, and I currently suspect that is because the action sequence command to 'show attack animation' is just pulling the animation from a skill, rather than calling the function which is supposed to be used for such, a function which I updated specifically so it would update for main and offhand weapons.

In any case, to get what I have working, I just added in a few if checks, and repeated part of what would've once been called the target sequence for the offhand, and added a script at the end to delete the _numAttacks value from the subject, so as to reset the swing counter correctly after the attack.

◆Plugin Command:VisuMZ_1_BattleCore, ACSET: Setup Action Set
:              :Display Action = true
:              :Immortal: On = true
:              :Battle Step = true
:              :Wait For Movement = true
:              :Cast Animation = true
:              :Wait For Animation = true
◆Plugin Command:VisuMZ_1_BattleCore, MOVE: Move To Target(s)
:              :Targets (Moving) = ["user"]
:              :Targets (Destination) = ["current target"]
:              :Target Location = front base
:              :Melee Distance = 24
:              :Offset Adjustment = horz
:              :Offset: X = 0
:              :Offset: Y = 0
:              :Duration = 12
:              :Face Destination? = true
:              :Movement Easing = Linear
:              :Movement Motion = walk
:              :Wait For Movement? = true
◆If:Script:(BattleManager._subject && !BattleManager._subject._numAttacks)
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Wait By Motion Frame
  :              :Motion Frames to Wait? = 1
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Action Animation
  :              :Targets = ["all targets"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Wait By Motion Frame
  :              :Motion Frames to Wait? = 2
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["current target"]
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Immortal
  :              :Targets = ["user","all targets"]
  :              :Immortal = false
  ◆If:Script:BattleManager._subject && BattleManager._subject.isCurrentlyDualWielding()
    ◆Script:BattleManager._subject._numAttacks = 1
    ◆
  :End
  ◆
:End
◆If:Script:(BattleManager._subject && BattleManager._subject._numAttacks == 1)
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Motion Type
  :              :Targets = ["user"]
  :              :Motion Type = attack
  :              :Show Weapon? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Wait By Motion Frame
  :              :Motion Frames to Wait? = 1
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Attack Animation
  :              :Targets = ["all targets"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆Plugin Command:VisuMZ_1_BattleCore, MOTION: Wait By Motion Frame
  :              :Motion Frames to Wait? = 2
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Action Effect
  :              :Targets = ["current target"]
  ◆Plugin Command:VisuMZ_1_BattleCore, MECH: Immortal
  :              :Targets = ["user","all targets"]
  :              :Immortal = false
  ◆
:End
◆Plugin Command:VisuMZ_1_BattleCore, ACSET: Finish Action
:              :Immortal: Off = true
:              :Wait For New Line = true
:              :Wait For Effects = true
:              :Clear Battle Log = true
:              :Home Reset = true
:              :Wait For Movement = true
◆Script:delete BattleManager._subject._numAttacks

This... uhh, obviously isn't ideal. It still doesn't quite work right, and it's a lot more involved than I originally wanted. A side effect to that, though is that you should be able to do this to every skill, not just the attack skill, and it should work just as well.

Another thing worth noting is that Attack Times+ doesn't work at all with a custom sequence, with or without my plugin. The standard function is to simply make the attack skill hit more than once, and unless you're using the auto-sequence, or the ACSET mentioned above, it simply doesn't do that at all.

I'm going to start by submitting a bug report to the VS team to see if they can fix that at least. Not sure where it'll go from there, though.

Thank you so much mate. I appreciate you following through on this plugin. I hope VisuStella can help you, and I believe there is a good chance they will. I submitted a request to them a few weeks ago and they got it fixed almost immediately.


I personally cannot use the basic attack command since I use the battle voice plugin and it doesn't fire correctly if I use action sequence and the camera, oddly enough, so I have to have a unique action for each character so they can play their own sounds. Additionally the mages' attacks are coded differently as well 


I am grateful for your continued work on this plugin and the way you're updating me on it. I am excited to see the progress being made

Okay, I got somewhere with the VS team about this.

So, I've managed to get a sequence to work mechanically, and a fix to BattleCore should be coming out at some point soon to correct the animations issue.

So, and again, this isn't as plug and play as I want it to be, but sometimes we gotta work with what we've got.

So for setup we need to have a state telling the battle engine that the replacement skill is the actor's attack skill, otherwise the second attack will not automatically happen. Since you're using the battle command replacement, and as I understand it, that is class-based, you can also create a passive state on the class, or a trait, which sets the 'attack' skill to the replacement skill instead, and just use the regular attack command.

Next, your replacement attack skill needs to be tagged as <dualwield skill>. All this really does at this point is make sure that the damage splitting is working, and I've tested in my test project, and that appears to be fine, so we're good on this.

Last, we need to modify your action sequence a bit. First, we need a label for what I will call the target action, put the label before the attack motion of your sequence, basically, we're going to use this to repeat a section of it for each weapon. After the label, do the rest of the sequence as normal, and then at the end of the target action, use the plugin command 'TARGET: Next Target' and specify the label we just made. Inside the target action, you've gotta change any action effects or show animations to use 'current target' instead of the default 'all targets', that'll make it so that the effect (and animation) triggers once for each hit, instead of triggering twice at the end.

As for the battle animations, Yanfly has indicated that the common events used for the action sequences don't use the same function to grab the attack animation of the user as default sequences, and that I cannot alias one, as it is a plugin command, so he's going to update the BattleCore plugin at some point to allow the user to specify the offhand weapon animation specifically. When that gets implemented, we'll need to change the sequence again, wrap an 'if' around the 'ANIM: Attack Animation' command, and check for !BattleManager._subject._numAttacks . If true, we'd show the regular attack animation, and in the else case, we'd call the new command to show the offhand animation instead. This'll look something like the below:

◆If:Script:!BattleManager._subject._numAttacks
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Attack Animation
  :              :Targets = ["current target"]
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆
:Else
  ◆Plugin Command:VisuMZ_1_BattleCore, ANIM: Attack Animation 2+
  :              :Targets = ["current target"]
  :              :Slot = 2
  :              :Mirror Animation = false
  :              :Wait For Animation? = true
  ◆
:End

He's also adding an option to use the attack motion from the offhand weapon as well, but in my experience so far, I don't think we'll need that for this to work correctly.

So uhh, update your sequence a bit, add that note tag to the replacement skills, and set them as the attack attack skill via a trait on the class or actor, or whatever, and then update BattleCore when the update comes out (next week most likely), and that should take care of that.