ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
900
Reaction score
569
First Language
English
Primarily Uses
RMMV
Greetings once again.


As some of you may recall I released a dual wielding plugin a couple of months ago that worked pretty well in splitting up damage from attacks based on individual weapon swings. I know next to nothing about javascript, as was mostly able to accomplish this by ctrl+f through the default rmmv scripts and them modifying them into my own script.


I was able to get the following to work, but can go no further because I can't grasp where my issues are coming from.

  • An actor who is dual wielding and has more than one 'attack' action (from a trait) will swing alternately with each weapon.
  • Weapon swing/poke/range and weapon sprites update per attack in combat, resetting after an odd number of attacks.
  • The battle animations played when dual wielding will correspond to the weapon being swung/stabbed/missiled, alternating between the two weapons equipped.
  • damage per hit will be based solely on the weapon being swung on that hit.
  • skills that use the 'attackanimation' action sequence will also alternate weapons if they hit multiple times.
  • A cleanup script has to be called at the end of action sequences that returns the weapon data to the correct place. This was only needed on an odd number of attacks.



I have the following problems that I can't seem to solve on my own, and would like some help:

  • If an actor is dual wielding, but doesn't have a weapon in his mainhand, both of his weapon sprites will be of the weapon that is in his offhand, though the animation remains fine

    I suspect this is a failsafe in the engine to ensure that the actor was swinging SOMETHING during the default dual wield animation
  • I can't seem to locate the place in the default javascript files that handles this weaponsprite, so I can't find anything to disable or overwrite to stop this
  • EG: if Harold has a barehand in the mainhand slot, and a mace on the offhand, his first attack will LOOK like a mace, but have the animation of barehand and do the damage of barehanded attack. His second attack will also look like a mace, but do the animation of damage of a mace.

[*]If doing an attack when dual wielding, and any of the attacks miss, the following attack will have the weapon sprite of the previous attack that missed. It will still do damage as if it were the correct attack.

  • Before I had split the damage values of the individual attacks to be based on the weapon being swung, I thought the damage calculation wasn't being applied after a miss either, but this turned out to be incorrect.
  • I had added a bunch of code to swap parameters on the actual weapons the actors were wearing to change the swingtype and weaponspriteID of both weapons being equipped, but using the debug window and some call outs, I can see that the values are being changed after a miss, but are being ignored on the next swing, while the animation and damage calculation are being updated for the next swing.
  • Example:

    Harold has 10 att, and is dual wielding a claw and a mace. claw is thrust type and the mace is swing type. The claw has 20 ATT and the mace has 60 ATT
  • If we are in battle and Harold does a normal attack, he will hit twice, the first attack will thrust with a claw sprite, and slash animation, and do (120+-20%) damage
  • the second attack will be a swing animation with a mace sprite, and will have a 'hit' animation and deal (280+-20%) damage.
  • If Harold misses on the first attack, the second attack will carry over the weaponsprite and swingtype(thrust) of the claw, but show the animation and deal damage as if it were the mace.
  • if harold were using a skill that hit three times instead of twice, if the first hit missed, and the next two attacks hit, hits 2 and 3 would have the incorrect swingtypes and weaponsprites, swing 2 would use the sprite/thrust of the claw, while actually being a mace swing, and swing 3 would show the mace sprite and swing animation, white showing the animation and damage of the claw.
  • if harold misses the second attack as well, if there were a third attack, it would still show the animation and swingtype of the first weapon, but the damage and animation would update back to the first weapon.

[*]I suspect that when a normal attack follows a missed attack from the same actor, the engine uses the weaponspriteID/swingtype from the first attack automatically, without checking the database to see if any of those values had changed between the miss and the second attack. But like the issue above, I can't figure out where the weapon sprite information is gathered in the core scripts.





I have attached my convoluted script as well, if anyone wants to give me a hand here, or can point me to the right core file to look at, that'd be great.


Thanks,


Ramza


edit: uploaded an old version of the script somehow.

View attachment RamzaDualWield.js
 
Last edited by a moderator:

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
900
Reaction score
569
First Language
English
Primarily Uses
RMMV
It seems that in my time away, @Victor Sant has made a superior version of this very plugin, which to my knowledge only has one slight issue with it, that I'm sure he will take care of shortly. On that note, I will close this topic, and forward any further inquiries to his topic, as I am now using his plugin instead of my own.


Thanks.
 

Latest Threads

Latest Posts

Latest Profile Posts

Finally started working on Grim Trigger episode 2 today :LZScat: it's half comic/half visual novel!

GfY3Rwj.png
Is it interesting to get more backstory on villains? A key moment in their past, their childhood, or maybe something that shows they've always been that way? To see or not to see?
"Everything tastes like chicken until it's chicken, then it doesn't taste like chicken."
Context: chicken samosas do not taste like chicken. I thought it was veggie samosas.
Just another ordinary evening.
This pig girl is a merchant and playable character.
Currently there's no name for her yet. a suggestion is welcomed.
Merchant.jpg
Merchant-1.jpg
Want for a Nail: I'm trying to figure out what controllers work with MZ, one support thread, a plugin request thread, a dead controller, and a $48 eBay purchase, and a PS1/PS2 USB adapter later. Still stuck with keyboard controls...

Forum statistics

Threads
110,353
Messages
1,052,580
Members
143,394
Latest member
flopinou74
Top