RPG Maker Forums

Okay so I decided to look into Lytanathan's Dual Wield Separate Attacks script because it hands dual-wield damage calculation in a more favorable manner than the default system (the script does not combine the parameters from both weapons which is good)  However it doesn't exactly work in my favor because dual-wielding in my project is simulated by 2 separate Attack Skill calls.

The script works by force-changing your weapons to work as if the first weapon is the only one equipped (slot 2 being nil), performs the calculations/damage, and then repeats for the second weapon slot as if the first slot was nil.

Basically i'm trying to modify the script using maybe variable conditions so that for the first time the attack skill is called and this processes, it will only do the first slot weapon stuff. Then when the attack skill is called again later (note that in between this time nobody else will be using the Attack skill but the same dual-wielding actor) and this processes is called, it will do the second slot weapon stuff only. Then after this it will restart all over again for the next dual-wield actor who needs to use the attack skill twice. The whole thing is already conditioned to only work if it's an actor and if dual-wield is applied, otherwise the regular apply_item_effect stuff works like normal.

This is the base script for my modification attempts. For the sake of proper project convenience I changed it to an overwrite instead of an alias which does not affect anything for me compatibility-wise.

#==============================================================================## Dual Wield Separate Attacks by Lytanathan## When a character is wielding more than one weapon, perform an attack for# each weapon equipped, using only that stats of that weapon and not the# others.## Instructions: Place any skills that are attack skills inside the array# ATTACK_SKILL_IDS found below. That is all.## Is (as far as I can tell) compatible with Yanfly's Ace Equip Engine.## So far, partially compatible with Yanfly's and Victor Sant's scripts for # changing the attack formula of the equipped weapon. (Or rather, those scripts# work as they are supposed to, but both weapons end up using the same formula.# If both weapons HAVE the same formula then it everything is good, but if not# then the slot 1 weapon's formula overrides the slot 2 formula)# I am working on this, but I am not a very good scripter and I am not very# confident I will be able to fix it. It took me nearly 24 total hours of coding# just to come up with the single function you see below here.##==============================================================================#==============================================================================#+-----------------------------------------------------------------------------#| BEGIN EDITABLE REGION#+-----------------------------------------------------------------------------#==============================================================================module LytBase ATTACK_SKILL_IDS = [1]end#==============================================================================#+-----------------------------------------------------------------------------#| END EDITABLE REGION#+-----------------------------------------------------------------------------#==============================================================================class Scene_Battle def apply_item_effects(target, item) #If attacker is an actor and dual_wield if @subject.is_a?(Game_Actor) && LytBase::ATTACK_SKILL_IDS.include?(item.id) && @subject.dual_wield? #Remember equipped weapons weapon_list = @subject.weapons for current_weapon in 0..weapon_list.size-1 #Remove weapons not being used to attack for weapon in 0..weapon_list.size-1 if weapon != current_weapon @subject.change_equip(weapon, nil) end end #Perform attack target.item_apply(@subject, item) refresh_status @log_window.display_action_results(target, item) #Replace weapons not being used to attack for weapon in 0..weapon_list.size-1 @subject.change_equip(weapon, weapon_list[weapon]) end end #Else regular attack stuff else target.item_apply(@subject, item) refresh_status @log_window.display_action_results(target, item) end endend 
I was thinking of separating the whole thing into 2 parts, and using a variable-checking case statement to determine when to use each part.

Edit: I managed to do the "split into 2 parts" idea and solved my issue.

#==============================================================================## Dual Wield Separate Attacks by Lytanathan## When a character is wielding more than one weapon, perform an attack for# each weapon equipped, using only that stats of that weapon and not the# others.## Instructions: Place any skills that are attack skills inside the array# ATTACK_SKILL_IDS found below. That is all.## Is (as far as I can tell) compatible with Yanfly's Ace Equip Engine.## So far, partially compatible with Yanfly's and Victor Sant's scripts for # changing the attack formula of the equipped weapon. (Or rather, those scripts# work as they are supposed to, but both weapons end up using the same formula.# If both weapons HAVE the same formula then it everything is good, but if not# then the slot 1 weapon's formula overrides the slot 2 formula)# I am working on this, but I am not a very good scripter and I am not very# confident I will be able to fix it. It took me nearly 24 total hours of coding# just to come up with the single function you see below here.##==============================================================================#==============================================================================#+-----------------------------------------------------------------------------#| BEGIN EDITABLE REGION#+-----------------------------------------------------------------------------#==============================================================================module LytBase ATTACK_SKILL_IDS = [1]end#==============================================================================#+-----------------------------------------------------------------------------#| END EDITABLE REGION#+-----------------------------------------------------------------------------#==============================================================================class Scene_Battle < Scene_Base def apply_item_effects(target, item) #If attacker is an actor and dual_wield if @subject.is_a?(Game_Actor) && LytBase::ATTACK_SKILL_IDS.include?(item.id) && @subject.dual_wield? #Remember equipped weapons weapon_list = @subject.weapons case #Do weapon 0 stuff when $game_variables[197] == 0 #Remove weapons not being used to attack for weapon in 1..weapon_list.size-1 @subject.change_equip(weapon, nil) end #Perform attack target.item_apply(@subject, item) refresh_status @log_window.display_action_results(target, item) #Replace weapons not being used to attack for weapon in 1..weapon_list.size-1 @subject.change_equip(weapon, weapon_list[weapon]) end $game_variables[197] = 1 #Do weapon 1 stuff when $game_variables[197] == 1 #Remove weapons not being used to attack for weapon in 0..weapon_list.size-1 @subject.change_equip(weapon, nil) end #Perform attack target.item_apply(@subject, item) refresh_status @log_window.display_action_results(target, item) #Replace weapons not being used to attack for weapon in 0..weapon_list.size-1 @subject.change_equip(weapon, weapon_list[weapon]) end $game_variables[197] = 0 end #case #Else regular attack stuff else target.item_apply(@subject, item) refresh_status @log_window.display_action_results(target, item) end endend 
This thread can be closed.

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top