I'm trying to build a combat system for a JRPG. Please pardon the placeholder assets.
There are multiple types of actions. First the player selects. Then the AI. Then, the actions are meant to resolve in a predetermined sequence. Actions of the same type resolve simultaneously.
What I hoped to do was:
1) Create a text box above the head of each character using "Magic", containing text that indicates the skill that character is using.
2) Destroy that text box and its text.
3) Spawn an effect animation object at the location of the character's target, using an instance variable that tracks the target's UID.
4) Display the skill animation
5) show hitstun, calculate damage, and do a bunch of other stuff that I haven't been able to implement yet.
So it should looks something like this:
media.giphy.com/media/v1.Y2lkPTc5MGI3NjExNjFub2k1dG0waHZ3Y29mamJlc3dmbDhwcThlbGdweWt3MGQzbGljbyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/dZIUKNJS52E5tqdTHP/giphy.gif
Right now, the system is doing what I want it to do, however, this is how I've had to code it:
It seems to me that the effect I've produced is illusory, in that it will go straight to hell as soon as there are multiple instances of enemy and/or player. And there will probably be a lot of clutter and nonsense in the meantime. However, this is the most workable solution I've been able to reach.
Everything else I've tried seems to have been stymied by one or more of the following problems:
1) I'm not sure how to deal with targeting, since both the acting character and its target will both be members of the character family.
2) Asynchronous weirdness caused by the "Wait" actions.
3) Weird scope problems, where some elements within the loop appear not to be accessible, even after these loops are completed.
If anybody can help me understand these problems, or point to possible solutions, I would much appreciate it.
drive.google.com/file/d/18kHmHn-rUvJiba-nGwPef4jUxKr3al8O/view