How do I use IID to store coordinate of sprite respawn

Get help using Construct 2

Post » Wed Dec 14, 2016 11:35 pm

Message: GUN can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I've asked about this in the forum a while ago. But I still cant figure out of this.
I have a sprite that can be pushed all the way in a direction (up/down/left/right in a top down view).
And it will be destroyed if hit a wall.

I want the sprite to respawn in the previous position (if the sprite previously in x:40,y:50).
After a sprite is destroyed or a sprite is pushed to a direction/ kicked, it will start respawn in the x:40 , y:50 position.

I've tried using IID to store the sprite's IID to a global variable, which can be used to "Pick Nth instance" , so after the push, Nth instance will be the sprite's IID which have been pushed. I used IID because it is said that IID still intact even after a sprite is destroyed.

This method works for the first respawning, but doesnt work in the second respawning.
I really dont know the problem why this is happened.
It is hard for me to explain this problem, so see the capx for yourself.

This is the capx
http://s000.tinyupload.com/?file_id=202 ... 5753272595

Thanks anyway.
B
7
S
1
Posts: 16
Reputation: 409

Post » Thu Dec 15, 2016 11:01 am

Please make sure you tick "Do not automatically parse URLs" in your post to make sure, your link doesn't get shortened.
Because the way it is now, we can't use it.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Thu Dec 15, 2016 11:28 pm

OK here it is.

http://s000.tinyupload.com/?file_id=202 ... 5753272595

A couple of hours ago, I tried to use pick UID to store the UID of "what would be kicked" sprites.
I used dynamic text to debug this. And it shows that the UID actually stored in global variable for the first time, but it doesnt work for the second time ( when I move 4 ways and overlapping the "what would be kicked" sprites it shows the sprite UID/ like in UID 1or 2), but it doesnt show the UID for the second time it overlaps.

I dont understand why this is happened.
B
7
S
1
Posts: 16
Reputation: 409

Post » Thu Dec 15, 2016 11:55 pm

Check my games on Arcade, there have some of them with sample CAPX to download and learn.
Image
B
108
S
24
G
18
Posts: 1,372
Reputation: 22,817


Return to How do I....?

Who is online

Users browsing this forum: beohs, brunopalermo and 12 guests