Error during Preview Mode

Bugs will be moved here once resolved.

Post » Sun Aug 19, 2012 8:51 pm

Construct 2 gives an error message when it uses the tokenat() expression on an element in an array. It seems to only happen in preview mode.

Here's the error.


This game is designed to build a room out of tiles by loading a JSON file.
The error does not seem to affect the room building process.

Room Building CAPX

Load the above CAPX and press 1, 2, 3 in that order to build the room.
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Sun Aug 19, 2012 9:26 pm

The last few elements of the array are zeroes instead of strings (see the end of TestStagev3.json), and passing a zero to tokenat() when it expects a string causes the error. I will fix it in the next build to not cause an error and just return an empty string in this case, but you probably still want to fix your project since I doubt this is what you intended.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Mon Aug 20, 2012 2:19 am

Thanks!
After getting rid of the zeros at the end of the JSON file, it doesn't give me the error anymore!
B
13
S
4
Posts: 117
Reputation: 2,242


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest