TheNegroShoddy
Member
I'm currently in the middle of coding the menu in an RPG where a character's spells are displayed and have ran into a small problem. All spells are stored in an array and the spells are shown on screen in rows of two like in Final Fantasy 6. I'm trying to come up with a way to always get the correct number of rows based on the amount of spells a character has.
My first thought was to just take half of the array length:
However, in some cases this would lead to an inaccurate number of rows unless I use the round() function. I was just wondering if there was a better way to do this.
My first thought was to just take half of the array length:
Code:
total_spell_rows = ( array_length_1d( global.char_battle_info[ CHAR_BATTLE_PROP.CBP_SPELLS, char_sel_party_pos ] ) / 2 );