I will not make this title “Learning how to spell”

A good day today, plenty of progress and didn’t really get stuck. I spent most of the day setting up the input structure for the spell system. The idea is to read the stick inputs when the play is holding down the corresponding trigger and then compare the movements with a list of locations which are assigned to a spell each which can then be cast.

The “Magic cast” function has three segments: Read Stick Input, Compare To Player Spells and finally Actually cast the spell. I might move the final segment outside the function or give each spell their own function, i still haven’t decided(figured out) how to do it yet.

Today i made the first segment where the current position of the sticks are boiled down into an array of integers each. The main function is divided into two similar parts, one for each stick. Each part is activated if the corresponding trigger is pressed and adds a number to the “Stick path” list if the stick is within a certain “node” square area of its possible positions.

The way i do this is using a macro within each part where the stick current position is compared to each possible node using a switch case an another macro. The entire function stacked up looked like this: Scyscraper

However, after moving each node to their corresponding space the function now looks like this: SpiderWeb

The function returns true if any of the internal macros return true, these macros each take one Vector2D, max and min X value, max and min Y value. It then simply uses the In Range standard macro to determine if both the X and Y value is within the maximum and minimum values, finally it returns true. The Outer macro then returns true back so that the node’s value is added to the stick’s list.

By making the lists empty on their own over time the lists stay manageable and can be compared to the list of spells the player owns.

Next I started working on these spells, as it turns out, there might be some issues because the blueprints don’t allow for dynamic arrays which can contain other arrays, I think i have a solution and i will finish it tomorrow and start working on comparing the spells. For now: Gotta get home and try out GTA on PC.