We need a "make default instance" button and label!

0 favourites
From the Asset Store
J-BoB Game Button Sound Pack comes with 300 high-quality sound effects
  • Ashley

    (Note: By "default instance" I mean the very first instance of an object type created for the project - the template that future instances inherit all of their properties from, not the first instance in a given layout or having an IID of 0.)

    Basically there's no way of knowing which instance is the default, nor where it's located if you want to change its properties (unless objects are stored in a separate dedicated layout, but sometimes you forget to do so). We also don't have any way of changing which instance is the default, which in some cases automatically changes behind-the-scenes.

    So I propose we get a "Make Default Instance" button in the object properties. When it is clicked, all future instances will inherit the properties of this instance. A small label at the top of the object properties saying "Default Instance" or "Template" or something would be very nice as well.

    This will also let us work around the bug where new tilemap instances inherit the placed tiles from a previous instance instead of the blank default instance. (I meant to report it but found it difficult to reproduce; seems to just happen over time.)

  • I thought the lowest index was the default.

    Object(0)

  • newt Pretty sure that's just the IID for runtime purposes. The object properties only displays the UID which isn't very useful at all.

  • I'm not talking about anything during runtime, guys. I mean the default instance in the editor - the very first instance ever created that future instances inherit their properties from.

  • Ok, but even if he were to add something to display the iid, theres a chance it could change when you change an instances z order.

    That makes editing in the editor somewhat unreliable.

    ... rolls eyes

  • What are you talking about dude. IID's are unique to the instances in a layout and only utilized at runtime. I don't see how they have anything to do with the project's default instance of an object type, which is what this thread is about. I never even asked for the object properties to display the IID - just if it was the default instance (the very first instance created for that object type in the whole project, not at runtime or in a specific layout)

  • well, Actually I find a bug...

    when you create your first instance (object), and for example, set 2 different variables...this will be setting by default (like your suggestion)

    after this, when you are making a new instance, the variable would be the same of the old one... but there is a problem, when you remove all of the instance, (appear "you have deleted the last...") and you try to change the variable to make a new default instance variables, (click right in the object on Projects windows), this will not works, contruct2 will load the old variables of the first instance...

    so, I think this should be fixed, because you can't actually set a new default instance... If it was possible, you don't need any extra options to make it, but a new options is good, so, I suggest to insert in the properties of the object, just a button set as default instance, (same to the first instance)

  • The iids are given by their z order, the object with the lowest iid is the default object. (the initial object may not be the default instance because of this... dude)

    If you look at the z order bar you can find the default object by finding the instance closest to the bottom of the list.

    Unless you mean something else when you say default object.

  • Just tested, and apparently iid is no longer tied to the default at runtime.

    While the default iid is always 0, the 0 instance is not always the picked instance.

    I guess the highest z is for some reason.

    https://dl.dropboxusercontent.com/u/666 ... dr200.capx

    Heres a capx

    text objects are in containers to show the instances iids

    At run time clicking the button should pick the default object, move to it, and change the button text to the objects iid.

    Nope

    Note the iids follow the z order of the instances.

    I'll make a bug report later, but I swear I've had one similar already, and the answer was "not going to fix".

  • +1

    Good suggestion.

    I suppose you could use sprite.AsJson and the "load from json" action to copy all the properties of one object to another. Just pick the object you want to use as the default and save the .asJson to a global.

  • +1 as it is bothering that Inside the editor, when you drag an instance, it can be a waste of time to resize it as it should (first exemple:tiled backgrounds, you need a big one first, congratz, all of the next ones will be that big, even if you needed a smaller one...) or change the instances variable one by one just because the first one you created inside C2 was not the "default type" one you wanted to use afterwards to gain some time.

    Goes for other objects of course.

  • Tokinsom is talking the object 0. When you use SpawnObject or Create object. C2 creates the object based off of a template version of the object. However as I understand(this could be off) the creation process. Is that the first object defined in the first Layout of that object becomes the template object.

    The first solution is that anything you use create on. Should only be on some form of Assets Layout. However there is a problem.

    Let's give an example.

    1. I have a Assets layout where I create the first ever version of the object. We call this Object[0].

    2. However I end up using Object[1] in the main menu, but I end up doing some customizations

    3. I create Object[.....] during game play

    from a development point of view. Object[0] is my template Object that set's the standard for the create and forget. However there is a problem. Because Object[1] is custom and is the first create one through used alyouts. My game layouts will use Object[1] even though I want Object[0] as my default.

    Tokinsom is suggesting that there be a toggle field as part of the info where they can be just set as a Default. So that the confusion of Create precedence is not an issue.

    My suggestion is to copy Unit's Prefab system. Where Objects are popped into a Prefab dedicated folder. This way Prefabs are always default. Another suggestion would be to create instead a Prefab Layout. So that Any objects on this Layout take precedence of creation settings.

  • jayderyu Yep that's about it. The 'template objects' or 'default instances' (pretty sure that's what Ashley referred to them as) are very oddly handled, and behind-the-scenes no less. I fully support a prefab system similar to Unity's, but I don't expect to see that until C3. However, we can work around these faults right now in C2 by introducing the features I brought up here.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hate to say it but:

  • I like this idea. I'd definitely like to see it. That way I don't have to resize previously resized objects just because of whatever the previous instance/copy was prior to making a new instance in the layout.

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