|
As of today we are past the Alpha, at moment of writing we haven’t technically been approved but our showing worked well enough even though the combinations of spells within Harakat didn’t get shown. But i get ahead of myself. The last two days have been filled with small fixes and putting together an alpha-worthy version. Other than a bunch of small fixes and tweaks i have been setting up a system for being able to add a number of spells to a list and then fire all of them in succession. In addition to this, if the player performed a certain combination of spells they would be replaced by another spells as a combination of these two.
The entire system is somewhat complex and i went through some loopholes to make it work but i’ll explain the entire process.
The magic input reading begins in the Event Tick process which is run once every time the game updates. Within this the path branches depending if the player is in Harakat mode, outside of harakat the function is simpler since it “only” reads the stick inputs, compares it to the known spells and then casts that spell.

Inside the function Harakat spells i divided the segments for easier navigation, the first segment determines if the list of lined up spells is longer than the maximum length of spells to line up. I made this value its own variable in order to be able to change the default value or change it through the game. If the spell list is not filled the function goes along the True route which will be the first to be examined. First of all the function reads and updates the stick paths and then compares them to the spells known to the player. In the CompareToPlayerSpells macro a boolean is set (reset in the beginning of the macro) which the next branch depends on, if no spell matching the player’s inputs is found the function exits without casting any spells and resumes the update process.

Inside the same macro the variable Spellnum is set which is normally used when casting spells to set the spell system’s CurrentSpell variable to select the right spell to cast. In this case the variable is instead added to the list of lined up spells (the list is filled with integers to be used when casting the spells). After doing this the path checks of the list of spells are longer than one which means there is a potential for combinations, if so the function to check for combos is run before cleaning up. 
Inside Check Combos i do a cheap thing where the numbers of the two last elements in the lined up spells list are run through a series of switches and then calls the AddComboSpell function with a number specific number as input. That function in itself is nothing special, only removes the two last elements of the lined up spells list and replaces them with another. In the end of the Check for Combo function it also calls the event dispatcher Call Harakat Spell Launcher, more on this in just a little bit.

Finally at the end of the Harakat spells functional couple of cleaning actions are performed to reset the stick path, reset FoundASpell(that might be superfluous though…i’ll look into it) and set spell To Be Released to be false since all spells have been Released which have been cast already.

Now about the Event Dispatcher named Harakat Spell Launcher. It is being called potentially in two places within the Harakat Spells function, the first being if the list of spells have been filled and all spells are to be cast. The second being when a combo spell has been created and the harakat mode is to be ended while casting all the spells. The Event Dispatcher has this event attached in the beginning of the game, when this event fires i actually performs the Cast Lined Up Spells function.
Now, one would think making a for-each-loop which ran through each element in the list of lined up spells, cast and released each one, waited for a shot time between each so the spells wouldn’t be created within each other would be an easy enough task. But no, apparently, putting delays within a for-loop is a nono in Unreal which practically makes my method of casting the lined up spells not work properly. I’ve been exploring possible solutions to this but have yet to make one work. In either case hope to make it work within the end of the week.

Also to be noted is the reason i placed this in it’s own function through an event dispatcher. Originally it was simply to make the delay work but i also realized that placing a delay in the path of Event Tick would hold up everything else in the Event Tick path.

|