GML Status Display similar to FF Tactics Style

Wendell

Member
I will try my best to explain this.

In Final Fantasy Tactics, whenever your character has a status - good or bad - a balloon will be displayed over that character's head, with an icon. If you have more than one status, the balloons will change every second, displaying all status you have, one balloon at the time. The image below shows how it looks like:



I already have all status-balloon sprites, what I need is how to make this to display correctly. Let's assume that one character has a poison status. Easy, I can make the balloon to appear, but, what if that character also gets blinded while poisoned? I need to display one balloon after the other, for like, one second each, until the status are gone. In this example, let's assume that the character got rid of the poison, but is still blind. The balloon over his head must show only the remaining status and add more if he gets more, but the logic stays the same, displays all status-ballons, for one second each, for all status he might have.

What is the most efficient way to do this? I'm lost.

Thank you for taking your time to read this.
 

NightFrost

Member
Well, each character has a list of status effects that have been applied to them, since you're able to tell they've been debuffed. Each character should also have a variable that contains an index value of that list, starting from zero, and a timing variable that counts up from zero. In step event, you check if status effect list is longer than zero entries. If so, increase timer by one. When timer hits one second's worth of steps, increase the variable that indexes the status effect list by one and set timer to zero. If the index value now becomes equal to or greater than length of status effect list, set it back to zero. In draw event, you check if status effect list is longer than zero entries. If so, check the status effect that is at the position pointed by the index variable, and draw that effect's icon. If all your characers and enemies are their own instances, as opposed to running the battle through a central controlling object, it is best to make these scripts as you'll have lots of callers to them.

A routine that runs at the end of every turn switch (player turn, enemy turn) would check through all characters' status effect lists and decrement duration by one round. If duration hits zero, the effect is removed from list. To prevent overflow of the index variable that points at the list, simplest option is to set it to zero so it starts flashing icons from the beginning of the list.
 
Top