"extra.solidEnabled" in solid behavior

For developers using the Construct 2 Javascript SDK

Post » Tue Sep 23, 2014 3:19 am

Hi, @Ashley

I find that solid is put in inst.extra.solidEnabled. And inst.extra will be saved automatically when official saving.
But the minify might change the name of key. Most of savings are put by a string key like extra["se"].
Will it be an error that inst.extra.solidEnabled has been minified to different key-name?
B
108
S
26
G
272
Posts: 4,472
Reputation: 152,279

Post » Tue Sep 23, 2014 12:16 pm

Hmm... it's an interesting point. It's true that it saves using the minified name since it does not use string property syntax. It is probably not a problem for most games, since as long as the same minified code is saving and loading, then it will always use the same property name in the savegame. However if the game is updated with new minified code, it depends on whether the minifier chooses a new name for properties like 'solidEnabled'. I don't think the minifier is deterministic, so this is probably a subtle bug.

Thanks for pointing it out, I'll make sure the code is updated to use string syntax for those properties.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests