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:
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.
Let me explore this, that is definitely right syntax. Smile
Thank you. Let me know if I can provide any additional details that would help.
It seems to work fine for me, both with ICE v2.1 and v2.2. Can you PM me the source program(s) please? (both with and without that error line) Smile
CharlesSchar wrote:
I had downloaded ICE about a month ago

I know this sounds stupid, but have you updated?
LAX18 wrote:
CharlesSchar wrote:
I had downloaded ICE about a month ago

I know this sounds stupid, but have you updated?

I downloaded the compiler mid-June, and it looks like the last update was on May 18, so I don't think that is the issue.
I've sent the files for the program over. Let me know if there are any other errors in the code.
UPDATE:

Interestingly, the program crashes whenever I add anything at all to the line below! I think it may be some kind of memory limit error, even though the size of the subprogram that crashes is merely 1 KB compared to the other main program which is 12 KB.

Has anyone else experienced any issues such as this, or are there any known bugs that relate to memory overflow?
This may just be a glitch... I would also like to inform you that it is considered good practice to limot posting in the same thread twice within 24 hours. Please try to edit your previous post to add new information in the future. There are times where it is better to post twice (like I am now), but your above two posts could have been combined.
CharlesSchar wrote:
UPDATE:

Interestingly, the program crashes whenever I add anything at all to the line below! I think it may be some kind of memory limit error, even though the size of the subprogram that crashes is merely 1 KB compared to the other main program which is 12 KB.

Has anyone else experienced any issues such as this, or are there any known bugs that relate to memory overflow?

Oh well, everything works fine for me, so it might be your calc. How much free RAM do you have? Something around 75kB? If so, that is not enough Razz ICE itself takes about 62kB because uncompressed + libraries size, so that + 12kB could more than the amount of free RAM. That is still an error of ICE though, because it needs to check for the amount of free RAM I guess.
PT_ wrote:
CharlesSchar wrote:
UPDATE:

Interestingly, the program crashes whenever I add anything at all to the line below! I think it may be some kind of memory limit error, even though the size of the subprogram that crashes is merely 1 KB compared to the other main program which is 12 KB.

Has anyone else experienced any issues such as this, or are there any known bugs that relate to memory overflow?

Oh well, everything works fine for me, so it might be your calc. How much free RAM do you have? Something around 75kB? If so, that is not enough Razz ICE itself takes about 62kB because uncompressed + libraries size, so that + 12kB could more than the amount of free RAM. That is still an error of ICE though, because it needs to check for the amount of free RAM I guess.


Using all of the programs in the game, I still have a full 115 kB or so of free RAM leftover, so perhaps it isn't a memory error after all.

However, I was luckily able to circumvent the problem by moving my code to after the Goto END statement and still retain the same desired effect. I think that there may be an issue with how Goto's work, but I was able to "fix" the issue by changing the code around. If the code I sent worked for you, then I think it must be some kind of personal calculator issue, so I don't think that further investigation would really help. Anyway, I appreciate the feedback on this subject.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement