How do I create object from object that was destroyed

Get help using Construct 2

Post » Thu Dec 03, 2015 9:55 am

hi, I'm stuck in making the game. I want to create object and set its position on the object that has been destroyed. so before I have made the object and adjust at any point. (view image)
Image

i.e objects in #2 destroyed then create other objects and set position to #2

thanks
B
9
S
2
G
1
Posts: 28
Reputation: 671

Post » Thu Dec 03, 2015 10:01 am

Would this work for you?

Object on destroyed - create object2 at object.x,object.y
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 03, 2015 10:03 am

@fahmijufri

Can't you create an event when the Object is destroyed the systems creates a new Object and set's it at the same position?
Try if this works.

Condition
On PinkCube destroyed

Action
System Create PinkCube on X= PinkCube.X, Y = PinkCube.Y
B
11
S
3
G
1
Posts: 32
Reputation: 751

Post » Thu Dec 03, 2015 10:03 am

LittleStain wrote:Would this work for you?

Object on destroyed - create object2 at object.x,object.y



This! :)
B
11
S
3
G
1
Posts: 32
Reputation: 751

Post » Thu Dec 03, 2015 11:52 am

Message: fahmijufri can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
@LittleStain & @Kribzy
i've done it, but in game that i made. it didn't works

this is the .capx's file, is there any wrong with my events?
https://www.dropbox.com/s/5lu0dk53nxtuf ... .capx?dl=0

thanks for your help. :)
B
9
S
2
G
1
Posts: 28
Reputation: 671

Post » Thu Dec 03, 2015 11:58 am

You only need 2 more reputation to be able to post urls..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 03, 2015 12:08 pm

Wow, I didn't notice that. :)
can i share it now?
https://www.dropbox.com/s/5lu0dk53nxtuf ... .capx?dl=0
B
9
S
2
G
1
Posts: 28
Reputation: 671

Post » Thu Dec 03, 2015 12:09 pm

fahmijufri wrote:Wow, I didn't notice that. :)
can i share it now?
https://www.dropbox.com/s/5lu0dk53nxtuf ... .capx?dl=0


Yep, you were just 1 post away from total forum-freedom..
Haha..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Dec 03, 2015 12:33 pm

Heya,

Sorry, I checked the Cap.x but had trouble understanding everything how it works ^^.
Can you check if this works? If you put variables that saves the position before doing the "Wait" command.


Image
B
11
S
3
G
1
Posts: 32
Reputation: 751

Post » Thu Dec 03, 2015 12:46 pm

Ist there a special reason you are working with IID?
IID changes when objects are destroyed and created.

From the Manual:

For example, the first instance in two object types both have the IID 0, the second 1, and so on. Therefore the IID neither identifies a unique instance like the UID, nor does it persistently refer to the same instance (if IID 0 is destroyed, the next instance becomes IID 0).
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Next

Return to How do I....?

Who is online

Users browsing this forum: 12thmix and 5 guests