I have been searching for various ways to to implement dual-wield into my game, and I am having issues with the action sequences.
My intent is not only for the base skill that everyone uses, "Attack", but to use this for other skills as well:
- If the user has only one melee weapon, they rush towards the enemy and attack only once
- If the user has only one ranged weapon, they stay put and shoot the enemy only once
- If the user dual wields only melee weapons, they rush towards the enemy, swing both weapons and do damage
- If the user dual wields only ranged weapons, they stay put and shoot the enemy twice and do damage
- If the user dual wields melee AND ranged weapons, they do one of two things:
1) If they are wielding melee/ranged, they move towards the enemy, swing then shoot
2) If the are wielding ranged/melee, they shoot THEN move towards the enemy and swing
I tried using a combination of different scripts/codes/whatever, but I am running into some errors.
Coding
<setup action>
display action
immortal: targets, true
</setup action>
<target action>
EVAL: user._weap1 = user.equips()[0];
EVAL: user._weap2 = user.equips()[1];
EVAL: user.forceChangeEquip(1, null);
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect
EVAL: user.forceChangeEquip(0, user._weap2);
if user.attackMotion() !== 'missile'
move user: targets, front, 20
else perform start
end
wait for movement
motion attack: user
wait: 10
attack animation: target
wait for animation
action effect
EVAL: user.forceChangeEquip(0, user._weap1);
EVAL: user.forceChangeEquip(1, user._weap2);
</target action>
The issues that I am having are:
- a non dual-wielding actor (i.e. is using a sword/shield, or a two-handed weapon) will attack with their weapon and then punch the target
- non dual-wielding enemies are hitting twice, and errors are popping up in the console (picture is provided)
Any assistance with this would be amazing! I am at my wits end trying to figure this out on my own.
Edit: So what I ended up doing was leaving the standard "Attack" alone and using the script to move the user if they were melee, or stay put if ranged. I then used Yanfly's "Weapon Unleash" plugin to make another "Attack" skill with the dual-wield animation replace the regular "Attack" command for dual-wield characters/classes.