I had downloaded ICE about a month ago and have been using it to make small games without any major issues on my TI-84 Plus CE. Currently, I am working on an RPG game and have encountered a bug that has stumped me for a few days now.
I have set up a list that stores the data for each of the player's stats like so:
Code:
Index 0 represents the player's maximum HP, Index 1 represents the current HP, etc.
I have had no issue altering the data in the stats list; it is easy to just store it into the list as you would a variable (with respect to the usage guidelines outlined in the ICE documentation).
Interestingly, I have been able to successfully store data into the stats list and read from it in a subprogram that handles the battling system of the game, but I am met with a crash when I try to do it as I would normally in a certain section of the code.
The following code is run when the player has defeated the enemy in battle:
Code:
The above code will check to see if the damage dealt is greater than the enemy's health; if so, the battle ends and experience is increased. The player's health is also increased, which I am doing to test the level-up system. This code works without any errors.
However, when I try to increase health again in the same, exact way as the first time, such that the code now looks like this, as you would expect,
Code:
the program crashes and ram is cleared. No other changes have been made to the main program or the battle subprogram.
Maybe there is something about ICE lists that I don't understand; I am relatively new to using them, but I can't imagine that I am doing anything out of syntax here. I would greatly appreciate any help on this subject.
I have set up a list that stores the data for each of the player's stats like so:
Code:
CopyData(L₂,3,20,20,10,10,05,03,03,01,01,0,100
Index 0 represents the player's maximum HP, Index 1 represents the current HP, etc.
I have had no issue altering the data in the stats list; it is easy to just store it into the list as you would a variable (with respect to the usage guidelines outlined in the ICE documentation).
Interestingly, I have been able to successfully store data into the stats list and read from it in a subprogram that handles the battling system of the game, but I am met with a crash when I try to do it as I would normally in a certain section of the code.
The following code is run when the player has defeated the enemy in battle:
Code:
If DAM<EHEL
EHEL-DAM→EHEL
Else
det(18,"You Win!",5,5
Pause 1000
det(36,5,5,50,6
det(18,"Got ",5,5
det(15,EEXP,4
det(17," EXP!"
Pause 1000
L₂(9*3)+EEXP→L₂(9*3)
L₂(0*3)+10→L₂(0*3)
Goto END
End
The above code will check to see if the damage dealt is greater than the enemy's health; if so, the battle ends and experience is increased. The player's health is also increased, which I am doing to test the level-up system. This code works without any errors.
However, when I try to increase health again in the same, exact way as the first time, such that the code now looks like this, as you would expect,
Code:
L₂(0*3)+10→L₂(0*3)
L₂(0*3)+10→L₂(0*3)
the program crashes and ram is cleared. No other changes have been made to the main program or the battle subprogram.
Maybe there is something about ICE lists that I don't understand; I am relatively new to using them, but I can't imagine that I am doing anything out of syntax here. I would greatly appreciate any help on this subject.