IID Details

Get help using Construct 2

Post » Sun Jun 03, 2012 2:21 am

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. xeed2012-06-03 02:37:05
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Sun Jun 03, 2012 3:08 am

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)Nimtrix2012-06-03 03:08:57
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jun 03, 2012 3:26 am

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?xeed2012-06-03 03:31:25
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Sun Jun 03, 2012 4:30 am

[quote]Pick 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.[/quote]

From the manual. Maybe you use it like in the first example, but mean to use it like in the second?
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jun 03, 2012 10:25 am

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?
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Sun Jun 03, 2012 1:26 pm

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.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jun 03, 2012 4:27 pm

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?
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Sun Jun 03, 2012 5:04 pm

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.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Jun 07, 2012 4:30 pm

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



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!Antylope2012-06-07 16:35:25
B
9
S
3
G
3
Posts: 39
Reputation: 3,112

Post » Thu Jun 07, 2012 5:01 pm

@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.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Next

Return to How do I....?

Who is online

Users browsing this forum: armaldio, Colludium, plinkie and 19 guests