Page 1 of 1

Error: "No default instance when creating object"

PostPosted: Sun Nov 27, 2011 2:34 pm
by marcinkowski
Hi
I'g getting error when I tried use z as shot.

Assertion failure: No default instance when creating object. You must have at least one instance of every object type in at least one layout. This will be fixed in a future build...

Stack trace:
assert2(null,"No default instance when creating object. You must have at least one instance of every object type in at least one layout. This will be fixed in a future build...")@http://localhost:50000/preview_prelude.js:12
(null,[object Object],false,972,6870)@http://localhost:50000/preview.js:865
([object Object],[object Object],972,6870)@http://localhost:50000/preview.js:858
([object Object],[object Object],3)@http://localhost:50000/Sprite_plugin.js:962
()@http://localhost:50000/eveng.js:711
()@http://localhost:50000/eveng.js:312
()@http://localhost:50000/eveng.js:301
((function (key) {"use strict";var ret = key === this.triggerKey;this.eventRan = this.eventRan || ret;return ret;}),[object Object],[object Object])@http://localhost:50000/eveng.js:1518
((function (key) {"use strict";var ret = key === this.triggerKey;this.eventRan = this.eventRan || ret;return ret;}),[object Object])@http://localhost:50000/eveng.js:1403
([object Object])@http://localhost:50000/Keyboard_plugin.js:85
([object Object])@http://localhost:50000/Keyboard_plugin.js:52
([object Object])@http://localhost:50000/jquery-1.6.3.min.js:3
([object KeyboardEvent])@http://localhost:50000/jquery-1.6.3.min.js:2

Re: Error: "No default instance when creating object"

PostPosted: Sun Nov 27, 2011 2:40 pm
by Ashley
The error is pretty much right, we aim to fix this soon but in the mean time just make sure there's an instance of the object you're trying to create already placed in the layout.

Re: Error: "No default instance when creating object"

PostPosted: Fri Mar 09, 2012 6:55 am
by jbadams
Any update on this one? It's relatively easy to work-around, but I'm finding myself having to work around it a LOT... obviously not something that deserves high priority, but it would be nice to have fixed.

Re: Error: "No default instance when creating object"

PostPosted: Fri Mar 09, 2012 10:30 am
by rgros
This is actually something that is really anoying if you have a bigger project, its something i would really love to see fixed in next build.


Re: Error: "No default instance when creating object"

PostPosted: Fri Mar 09, 2012 7:44 pm
by Ashley
Is it that annoying? You just need one unused layout in the project where you dump a single instance of every object in your game, then you never need to worry about this.

It's kind of a quirk of the engine because if you create an object and there are no instances anywhere in the project, C2 doesn't know what to use for the object properties. It's one of the things on the todo list for a long time but I thought it was minor and it's a little tricky to fix.

Re: Error: "No default instance when creating object"

PostPosted: Sat Mar 10, 2012 6:04 am
by jbadams
Aha -- I hadn't actually thought to work-around by sticking default instances in a default layout rather than hiding them or putting them off screen. Still a bit of a kludge, but a much nicer fix, thanks!

Re: Error: "No default instance when creating object"

PostPosted: Sat Mar 10, 2012 6:41 am
by jbadams
It should e fairly easy to come up with sensible defaults should't it? The only difficult ones should e position related, and those are supplied during creation.

It is a fairly minor annoyance though -- keep up the great work with other new features, love your work!