mrabjohn's Forum Posts

  • 4 posts
  • Hi,

    I have written a plugin that generates objects who's rendering depends on other objects of the same plugin.

    I note that I haven't handled delete/destruction of objects and that Construct doesn't crash, but as far as my objects are concerned, the deleted object is still present because I saved a reference to the object when it was added.

    Is there an IDEInstance.prototype.OnDeleted callback that I could use to remove the object ref from my list? Alternatively, is there a flag on the instance for isdeleted?

    Cheers,

    Mark

  • Hi Mike,

    I have now written the runtime portion of my plugin (not optimized) and I have certainly been able to use the data in "this.type.animations" to render the cells that I require, I've also been able to use "this.type.instances" to iterate over all of my instances.

    Can I ask for some clarification, because I can't get those functions to work in the IDE from edittime.js.

    I'm happy with the results I have thus far, but I would love to get the edittime rendering to match what is possible in runtime i.e. access animation frame data to change the texture of the next quad rendered in the IDE.

    Cheers,

    Mark

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I'm new to Construct, but it seems to me that collision on Sprite objects can be turned off or on.

    It would be most appropriate to treat each column as a static pile (i.e. no movement) - then only the top of the static pile would need collision enabled.

    Items that fall in from the top would have collision enabled by default.

    When a block lands, you'd turn off collision on the box it landed on, and disable movement on both.

    This idea could be extended such that when the full grid falls in (if that's how your level starts), only the first falling object would have collision enabled. As the box lands, simply enable collision on the next up the falling chain.

    Where blocks are removed from the middle, you'd have to treat the bottom bit as a static pile, and the top as a falling pile - indeed if blocks are removed such that two holes are made in one column, you'd still only have to treat all of the falling items as one stack, not several.

    Hope this makes sense.

    Cheers,

    Mark.

  • Hi guys,

    I'm starting off a project, and I thought that I'd start with a helper plugin for my level builds, i.e. a char-mapped wall system that calculates junctions based on proximity to other similar walls in a grid.

    I have 2 main problems:

    1) I need 16 images per wall type to function for all permutations of North, South, East, West connected or nor connected. I note that I can't just set up 16 image properties, because there is only one editor, so for this I used animations as an image bank. Clearly using 16 named animations will allow me to animate walls too, woo!

    The only problem is, that I can't display the walls as they would appear in runtime (when I've written it), because GetTexture only returns the first frame of the first texture (or am I missing something?).

    If I can select the texture of a named animation in edittime, that would be amazing - can anyone help with this?

    2) I haven't written any runtime code yet, but it looks as though I can get an array of all instances based on my plugin. Can this be done in edittime too? At the moment, I have declared an array, and I add references to all my instances in it when an IDEInstance is created, this works although I just realised that I haven't handled deletion yet.

    It seems to me that the IDE must hold a list of all of the instances, is this accessabile from the edittime code? I'd rather not reinvent if it's there anyway.

    Cheers,

    Mark

  • 4 posts