Apologies if this has been discussed before! Or if this is in the wrong forum...I just want some suggestions for a feature I am thinking of implementing, but am unsure where to begin.
I've had the idea for my game that there are some characters that use more than one weapon, and depending on the row they are in, having them use the default Attack command will either have them use a melee weapon, or a ranged weapon.
I basically want to perform a sort of check that automatically switches the weapon should the player move that actor's position. Row 2 for ranged weapons, and row 1, melee.
I'm kind of getting the hang of using Action Sequence Pack, so changing the animation depending on what the attack motion is shouldn't be too hard or confusing. It's the meat of the mechanic I'm not sure about; checking their position and then changing the weapon. It would have to be for any specific actor that changes rows mid-battle.
I am using Row Formation to note. Thank you for your time 😍
So, you kinda mention two different things.
One way, automatically switching the weapon when they change rows, is doable but problematic. Especially from the viewpoint of the player...if the player has multiple weapons in the party inventory, how do you know which to switch to? What if the player would want to use a different one because of its effects or something? That would only work well if you don't have choices of weapons, only one kind each of melee and ranged.
If you wanted to go ahead with that method, use the parameter in Row Formation to assign states to the different rows, and put Custom Apply effects on those states to change the actor's equipment.
The other way, using a second weapon the actor already has equipped, would require basically nothing. You can just do an if check in your action sequences for user.row() to see whether it returns a 1 or a 2 and use the appropriate motions.
Thanks for the quick reply! The feedback on the idea is appreciated, too; it's got me thinking if there are other ways to achieve this affect, perhaps ways that'd be far more convenient.
As of now, my game works in such a way that manually changing weapon equipment is impossible. The weapon an actor starts with is dependent on their class and they are largely stuck with it until they class change; when it comes the time for these classes to upgrade, so will their weapons. My decision to do it this way is because I don't really see it too necessary or fitting to make it to where a player has to upgrade their gear whenever they level up every three to five times, heh. :hswt:
But I'll experiment and see what feels best!
Assuming there is no mechanical difference between the ranged attack and a melee attack, and that the only major difference is a visual component (weapon animation/weapon sprite/weapon motion), you can also have being in a specific row give the actor a state, and then use the state together with the YEP weapon animations plugin to change the actor's weapon sprite that way.
I used something similar for a skill I had made where a bard character needed to play an instrument, and I used weaponsprites for the instrument, so I applied a state that set his weapon animation to the harp or whatever, played his animation and then removed the state. You can do the same thing with states applied by being in the second row to change the weapon animation to a bow, or whatever instead.
If you want more than one bow animation, or different actors to have different weapons, you could also use AutoPassiveStates on specific actors or weapons which become active only if they're in the second row, using the function ATT_Turan posted, and set the different weapon animations on the passive state instead.
Then you just need to make sure your attack action sequence does a check for the right weapon motions and does the right sequence depending on which weapon you have.