|
Today was a good day, for me at least there was some issues with setting up the project synchronization since we hit the size cap on out Sourcetree repository.
I have now finally managed to perform a spell the intended way, by holding the right trigger and moving the stick up and quarter circle down right. After Friday’s experiments and some testing this morning we concluded that changing the variable ‘current Spell’ in the spell system included in the player was enough to cast different spells. Today i added a function in the beginning of the update which runs the input-reading of the sticks if the player is holding the right trigger and the player is not currently casting any spell.
The input- reading is part of a function which handles the inputs for the sticks by reading the inputs and then erasing the end of the path list if it is above a specified length. After doing this the stick handling function exits into the Magic Casting function which in turn runs the CompareToPlayerSpells macro in which a boolean is set depending on the stick path matches any of the spells known to the player. As of right now it is only reading the right stick for all spells but we intend to have spells using different sticks or both of them. If the boolean comes out true, the Current Spell variable is set to a value determined inside the CompareToplayerSpells function and the spell system’s Cast function is then called which starts charging the spell in front of the player. Finally a boolean named Spell To Be released is set to true which prevents the function from looping. The spell is then released once the trigger is lifted.
I had to rework some things in order to make these functions work, first of all i had originally placed the check for if a spell should be cast to be run once when the trigger is pressed and the reading of the stick paths to be run inside the update function all the time. This would have worked well if the idea was to move the sticks and then hit the trigger, however our idea is to hit the trigger, move the sticks and then release.
The function for adding to the stick paths was acting up again and i had to remake it into an actual function rather than a macro and also edit some of the logic within. Luckily this went fairly pain-free once i figured out the way to watch a variable. Image included for future comparison with earlier posts.
Finally I laid most of the ground work for lining up a number of spells to be cast in Harakat mode, more details about that coming tomorrow.

|