Feature Mechanic: The Picnic Basket (Battle)


Time to go over what it is I did to make this feature work during battle. This will go over what I currently have when attempting to make the various Food Tags work when equipped.

Function

Taking what is equipped from the menu, the way their effects activate is through Common Events. I have two dedicated events at present, one for tags that activate at the start of battle (or when otherwise prompted) and one for during battle itself. I'm still working things out with how some of these get called, but for now I'm going to focus on what is situated in 'CallPicnicBasket2'


In the current build, I have them set to a Loop that will cycle through each slot until it's told to break the loop and end the event. Labels are used to help jump from one point to another. When it finds a tag equipped to a slot, it will immediately jump to the Label that it is associated with and check to see if it can activate

In the case of the Rice Ball, it will go through a few Conditional branches. The first being if any other tags of its kind (HP in this case) have activated already. If it had, nothing else would happen. If not, it checks if the tag activated for about the same reason (maybe considered redundant due to using labels but will look into it). What comes after will vary depending on what the tag does. Because the Rice Ball recovers health based on party health, it will calculate the total party health in the battle party with their current health, and if it's at a certain percentage then it'll proceed to do health recovery...assuming you have enough food which is party of another Condition. Once that happens, it turns on the "RiceBallActivated" switch, causes that condition to increase the max Food capacity, subtract what you have, and if it's eligible for an upgrade (called through a Common Event) it'll do just that. After that, it jumps to the end label and repeats until done.

Pre-Demo Build Code

Before this approach, I attempted to have the tag events placed in the same event tabs used in Troops. They would do a check at the end of each turn for any effects to activate, but that would cause another problem. Certain effects are meant to activate immediately, and because of how Battle Events work, it would have been difficult to get the timing down without it causing the game to get stuck. Not to mention, it would have given each Troop so many events that it might have clogged up the system just as much as the initial Common Event menu. Thankfully, I would learn about how I can have Common Events be called through the Skill table.


Current Build

So right away, you'll notice the Common Event calling for one of the events. This will cause the event to play as soon as the attack animation ends. This worked out well when wanting tags that did enough damage, apply certain status ailments or elemental attacks to work as intended. The only thing left to figure out was how to get the Revival Tags to function since if the entire party was knocked out, the game would immediately call the Game Over prompt without any way to stop it. That's when I learned I could utilize the Custom Action Sequences plugin to better work this out.


This will be part of its own post at some point, but I can at least say this; whenever an attack is made, the targets are made Immortal which will prevent them from dying right away. After the last hit in an attack is made, it will call the Common Event to check for what can activate. While there's a bit to work out (like having HP tags not activate at 0 HP), the Revival Tag will still work as intended when HP drops to 0, so long as the target remains in the Immortal state before it's eventually removed.

At present, not every tag has been programmed with their respective effects and I'm still trying to figure out how to work the effects that go beyond recovery. At the very least, every plugin I learn about helps me get closer to condensing more and more code.

References

Get Tales of Naturia

Leave a comment

Log in with itch.io to leave a comment.