Char-mapped Walls & Edittime

0 favourites
  • 3 posts
From the Asset Store
A template which allows you to customise the controls of your game.
  • 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

  • 1. If you have the different walls set up as animations, you can use set frame to change which wall you display and compare frame to find out which one is being displayed:

    scirra.com/manual/115/sprite

    2. Instances have a uid (unique id) and iid (instance id, which changes as instances are created and destroyed) that you can query e.g. Sprite_name.uid. (According to the manual, instance ids are "lazily assigned" ^^)

    scirra.com/manual/30/instances

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

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