Confused about instance defaults..

0 favourites
  • 7 posts
From the Asset Store
Forget about default textbox restrictions, you can create sprites atop of the textbox
  • I have some objects that I instance. An example would be a Tileset, a Sprite (specifically a Trigger), and NPCs.

    Now the tileset of course can be drawn on, sprites have instance properties that can be set, etc. I, by convention, drag at least the first instance into a "Master" sheet so there's always that first core instance. I can also drag multiple instances, and set each of them to have different instance variables. All of this works as expected.

    But sometimes I get 'old' values when dragging new instances. For example, if I drag a new instance of Tileset into a layout, it will have one of the other layer's layouts by default, which I have to erase before I can draw new stuff on it. Similarly, I may drag a new trigger instance into a layout, and for whatever reason, its attributes default to a previous instance's attributes (even though I have one on the Master sheet).

    SOMETIMES when I drag a tileset to a layout, it's blank as expected.

    I'm really confused here. How does it decide what the 'default' state is?

    Tagged:

  • It's because it picks the first instance overall, not the first one on that particular layout

  • Wonderful, so if I accidentally added it to a scene first, then to master, I'm kinda out of luck for that object type? Any way to fix this in the json files?

  • A common strat is to create a layout for an object bank, this then keeps all the default instances stored in there and you can refer back to them easily.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yeah I've been doing that, but since I'm still new-ish I wasn't aware of the importance of making sure that first instance gets created in what I'm calling the "Master" sheet. I'll dig through the JSON and see if I can correct the 'first id' somewhere.

  • Yep you can do a search for all instances and it will be the one with lowest IID/UID.

  • Presumably you could use the templates feature to have direct control over what instance you copy from.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)