How do I check a sequence?

Get help using Construct 2

Post » Wed Mar 04, 2015 1:46 pm

Thank you very much, @andreyin!

It's exactly what I needed.

I would just like to understand the use of the "append" (str (sprite.IID)). Could you?
B
67
S
13
G
2
Posts: 987
Reputation: 6,835

Post » Wed Mar 04, 2015 3:15 pm

@RenatoB

When you "append" something to a text object, it will add what you want after the current text.

If you have a text object with "Hello" written on it and append " world" after it (with the space), you would get "Hello world".

If you have a text object with "Hello" written on it and used SET TEXT with " world", the text would erase and become " world".

The sprite IID is the instance ID that it has when it's created. If you notice, all the sprites with numers are the same sprite, just with different animations. When the game starts it loads these sprites one by one, and each one has a single IID, from 0 to 3. The str() expression converts this number into a string, and the append adds it to the text object.
B
111
S
38
G
40
Posts: 817
Reputation: 27,176

Post » Wed Mar 04, 2015 5:53 pm

Thanks @andreyin.

IID has nothing to do with UID, right?

In this case, the frame numbers are associate to IID?

If I intend to create the sprites when the game starts, instead to do this manually, the only thing I have to do is change the frame number for each one (randomly for example)?
B
67
S
13
G
2
Posts: 987
Reputation: 6,835

Post » Wed Mar 04, 2015 8:32 pm

@RenatoB

IIDs are only for the same object - UIDs are for all the objects from the entire game.

Yeah, you could make something like "on start of layout -> for 0 to 3 -> Create Sprite at random positions -> Set sprite frame to (loopindex)
B
111
S
38
G
40
Posts: 817
Reputation: 27,176

Post » Wed Mar 04, 2015 11:10 pm

Thank you, @andreyin. You really helped me.
B
67
S
13
G
2
Posts: 987
Reputation: 6,835

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests