2012-01-16 22:44:45

As I am playing with bgt today, I keep on coming across an index out of bounds error. I checked the line and there is nothing wrong with the line. true, I'm using an array, but I checked the code and it shouldn't be giving me this error. is there any other places to check, like maybe the sound pool?

All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither, Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
DropBox Referral

2012-01-17 08:35:37

Hi there,

I would need to see your code in order to tell you what's wrong. An index out of bounds runtime error simply means that the array doesn't have the particular element that you're trying to access, so you may want to print out in an alert box or in a log what the actual index is, the length of the array, etc. Remember also that array elements are 0 based.

By the way, you'd probably get more replies to these sorts of questions on the dedicated BGT forum at blastbay.com.

Kind regards,

Philip Bennefall

2012-01-17 15:11:24

I have done areys before and it looks right but I will send you the code if you wish to look at it. I realy don't want it in the public until I'm done with it. I'm assume an address is on your site. also, I tried setting up an account on the bt forms, but didn't get the email. I will try the alert box thing to see...

All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither, Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
DropBox Referral

2012-01-17 16:04:37

It's easy for index out of bounds errors to pop up where you don't expect them. (I imagine that 99% of the times that Sengoku Jidai crashed it was an index out of bounds error). It's a good idea to put in as many checks as you can (check to be sure that the index you're checking is valid before using it, make sure you have an array with non-zero length, maybe do index%array.length() if you really need to).

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2012-01-17 16:23:28

Cw,

What was the username you used on the forum? I will go approve it manually so you can log in.

Kind regards,

Philip Bennefall

2012-01-17 20:32:48 (edited by cw 2012-01-18 04:17:21)

it's cw, but I think you might of guessed it by now. LOL. I will up load the code in the next day or so. As for the checks, I will double check. Funny they some cometimes come and  go. As soon as I added a new sound, the error won't go away. The line that it said giving me trouble as far as I can see isn't where the problem is... lol.

edit
I have posted it on dropbox and put the link on the bgt form. As soon as I get it correct, I will post the exe of it on this form. I think you will ike what I did to my little ugly duckling of a beginner's project this time. All I can say is that I hope yall like snakes. LOL.

All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither, Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
DropBox Referral

2012-01-22 10:36:48

Ot
Sorry for the off topic, but how do you perform checks with a BGT Script.

Go to Heaven for the climate, Hell for the company. - Mark Twain

2012-01-22 15:28:31

If checks means what I think it does, you would basically need to add things to confirm that the program gets to a certain line.
When you have complex things going on, it can be hard to tell where an error originates from. So I'll add either messages to be copied to the clipboard, or alerts to let me know that the program has made it to a certain point. These are just for tracking down bugs, though, so they usually need to be removed when the project is ready for release.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2012-01-22 21:55:56

you are right about those checks CAE_Jones. They mean what you think they mean. It took me a try or two to get the right check in the right place. Anyway, I have a new version of my beginners project up here on dropbox. Should I go ahead in put the link in the other topic I was posting it in?

All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither, Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
DropBox Referral

2012-01-22 22:12:43

I think you should, because there is already a topic created for it.

I post sounds I record to freesound. Click here to visit my freesound page
I usually post game recordings to anyaudio. Click here to visit my anyaudio page