IID Details

0 favourites
From the Asset Store
Human/Character Base Pixel Art Sprites in various poses (nearly 100 files)
  • Hi all,

    since no answer on my last topic, could you tell me how IID's work? I am really stuck on my game, and could not find a solution to dynamic path movement on multiple points, getting destroyed when collecting.

    1. what happens with the IID of an object with multiple instances, when it gets destroyed during runtime?

    2. what happens with them when an object with multiple instances gets created during runtime?

    3. and how can i access an object with a specific IID directly?

    Kytric said, IID's are dynamic. But when objects are destroyed, there is no replace object to select on the same ID. so:

    4. is there any way to resort the object IID's in a specific order, like UID's?

    Thanks for more information about this important c2 topic. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Have you read this manual entry? If not it could be useful to have a look. I've made an example to illustrate what happens in the conditions you asked, hope it helps:

    IIDexample.capx (r92)

  • build nearly the same test project few minutes ago lol, many thanks :)

    anyway, this does not work for my project.

    so, pick by n'th instance does select an object per IID or UID?

  • ick Nth instance

    Pick the instance at a given place in the internal list of picked objects. This is most useful used in sub-events to act on separate instances. For example, in a "Sprite collided with Sprite" event, Pick 0th instance and Pick 1st instance can be used to act on each instance involved in the collision separately.

    If all objects are currently picked, this condition can also be used to pick an object by its index ID (IID). For more information, see common features.

    From the manual. Maybe you use it like in the first example, but mean to use it like in the second?

  • i am trying to build the same test scenario directly inside my game, for to check the wandering IID's of the HoldPoints and the KI's.

    But i'm afraid how your capx works, since every tick one textfield should be created for every sprite.

    Anyway, thats how it happens in my project...so the fps drops down to 0.

    Also i dont get how to delete only the specific textfield concerning to the object. Even if an object spawns a textfield, the textfield does not remember, like in your project, to which sprite it belongs.

    Getting more and more confused about this stuff. Maybe i can PN you the project, and you could take a look inside it?

  • Yeah, I updated the example to not just keep spawning text, didn't notice yesterday. I could take a look, sure, as long as there are no plugins or anything. <img src="smileys/smiley20.gif" border="0" align="middle" />

  • sorry, there are already some plugins like pathfinder...essential for the whole game.

    Should i send the whole capx and addons, including a little description on what problems to fix?

  • Would it be too much work to recreate just the problem bit in a new .capx? If it is, I can install the plugins and look at the project, but I'd rather not. It's a lot easier to navigate through an example than a whole project anyway.

  • Sorry I may get offtopic but I didn't want to create another thread. I'just want to know what I'm doing wrong trying to pick instance by number.

    Here's what I have

    <img src="http://img209.imageshack.us/img209/9838/bohscrtrainingbox.jpg" border="0" />

    In event 47 I create several platform instances.

    In events 48/53 I try to rotate some of them but only 1 (the one with the 0 IID) get modified. Why the others don't?

    bye and thanks!

  • Antylope You need a

    System: Pick all tb_platform_half_l

    after creating the objects since the only tb_platform_half_l selected will be the last one created.

  • Yeah, what ramones said is probably the problem. You should read about the "Pick nth instance" in the manual if you wonder why this happens.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not sure to get it. I tried to add the event you say but by it self it doesn't do anything. Tried to attach it the rotation events as sub-events but nothing.

    Could you explain a little?I'm stucked in this since yesterday.

    Thanks!

  • Antylope:

    I made an example to illustrate, try with the disabled event first, then re-enable it.

    Link: PickInstance_Subevent.capx (r93)

  • Beat me too it... haha <img src="smileys/smiley32.gif" border="0" align="middle" />

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/pickInstance.png" border="0" />

  • An almost identical example. <img src="smileys/smiley20.gif" border="0" align="middle" />

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