How do I get the IID?

Just started using Construct 2? Post your questions here

Post » Thu May 05, 2016 9:34 pm ... ckup1?dl=0

How do I get the instance id? I used the manual and I know inst.get_iid() is what gets it but WHERE do I put it?

The basic concept is that I choose which platform will be visible. What I need to do is grab the IID of the most recently created platform, compare it to the random choice of which platform that will be visible (1 or 2) and make it visible. I just have no idea WHERE to put the inst.get_iid() because there is no 'get' option under system that i'm aware of.
Posts: 57
Reputation: 1,723

Post » Thu May 05, 2016 9:59 pm

That function is for the SDK for if you are building your own plugin in javascript.

I'm assuming that is not what you are doing. What you should be using is UID, which you can get from object.uid. This can be stored in an array or variable when you create the object (pushing it to an array will give you the order each one is created in as well).

Otherwise, the shortcut to use IID is to reference the newest instance of an object in an expression by object(-1).expression.

You generally never need to know to know what the IID of any specific object is, as it can change as objects are destroyed.

So IID basically is a way to get relative order for expressions - first, second, third, last, next to last, ect. UID useful to pick a specific instance of an object.
Mistakes were made.
Posts: 1,950
Reputation: 75,377

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests