Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Element limit for Arrays in agk?

Author
Message
Mungkeh_Man
12
Years of Service
User Offline
Joined: 11th Apr 2012
Location:
Posted: 2nd Oct 2012 15:52
I am so close to completing my first game, but this is killing me!

I am declaring an Array like so:

Dim aintSetOrder [64] as integer = [1, 2, 3,....]

Which works, however, this does not:

Dim aintSetOrder [71] as integer = [1, 2, 3,....]

So, it seems there is a limit of 64 elements in an Array?

Is this just in the trial version?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Oct 2012 17:04
I use arrays with hundreds of elements with no problem. If you are using multi-dimensional arrays you have to be careful if you re-dim them because there is a bug causing data to be screwed up.


this.mess = abs(sin(times#))
Mungkeh_Man
12
Years of Service
User Offline
Joined: 11th Apr 2012
Location:
Posted: 2nd Oct 2012 17:08
Hi baxslash, and thank you for the quick answer!

When you are using hundreds of elements, I assume you assign the values via a loop, rather than as a list, as I have done?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Oct 2012 17:11 Edited at: 2nd Oct 2012 17:24
Quote: "When you are using hundreds of elements, I assume you assign the values via a loop, rather than as a list, as I have done?"

Normally I add elements to arrays one at a time rather than the way you've done it. I haven't actually tried it that way yet. I suppose there could be a limit assigning values that way... I'll have a try.

Strange but the compiler I'm using doesn't even let me compile the code from the help for the "dim" command. I can only assume that some work is being done on arrays at the moment as my current build of AppGameKit is a beta version. Can anyone test the example below or something much like it for me?



this.mess = abs(sin(times#))
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Oct 2012 18:04
baxslash, your sample gives a compile error. But if you add 'as integer' between the ']' and the '=', it compiles. And, when run, it shows the expected values.

Mungkeh_Man, are you sure you assigned all 71 values in the second case? I don't see any reason why the demo AppGameKit would limit array sizes, but it is not impossible. That is a question for TGC to answer.

Cheers,
Ancient Lady
AGK Community Tester
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Oct 2012 18:05
Quote: "baxslash, your sample gives a compile error. But if you add 'as integer' between the ']' and the '=', it compiles. And, when run, it shows the expected values."

I get a compile error either way.

If the code doesn't work as AL said I'll query it with someone more in the know than myself


this.mess = abs(sin(times#))
Mungkeh_Man
12
Years of Service
User Offline
Joined: 11th Apr 2012
Location:
Posted: 2nd Oct 2012 18:44
My code compiles, but if there is more than 64 elements, the entire array stays empty...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Oct 2012 23:53
baxslash, it looks like this is a question for you guys. It sounds like an issue with the demo AGK.

Cheers,
Ancient Lady
AGK Community Tester
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 3rd Oct 2012 03:14
Working as expected on this end baxslash with AL's modification. Exact code:


baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 3rd Oct 2012 11:10
OK, I'll contact someone. I would suggest that it seems to work in the current full release but not in the trial. It should work for both.


this.mess = abs(sin(times#))
Mungkeh_Man
12
Years of Service
User Offline
Joined: 11th Apr 2012
Location:
Posted: 3rd Oct 2012 13:56
I was not going to buy the full version of agk until I had fully finished my first game, but I guess I can bring it forward as this is the only thing stopping me.

Thank you all for the quick responses.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Oct 2012 17:13
When you do get the full version, instead of copying the project directory from the AGK_Trial (something like that) path, you should create a new project and copy in all your code and media.

I would suggest copying your trial version project directory to some safe place outside of the AppGameKit trial directory. Then uninstall the trial version completely. And then install the full version. You might even want to reboot between uninstall and install.

Some people had discovered oddities when they took a project directly from the trial version to the full version.

By creating a fresh project in the full version, you make sure that the project uses only full version stuff.

Cheers,
Ancient Lady
AGK Community Tester

Login to post a reply

Server time is: 2024-05-04 19:40:28
Your offset time is: 2024-05-04 19:40:28