Create new Object on empty Position?

Get help using Construct 2

Post » Wed Jun 13, 2012 1:26 pm

Hey Mates,

any simple solution for to create new objects of similar type, only on "free positions", so on such on where no other object of the same type already is?

On collision check, the new object also calls collision=true for itself.

Thanks for your help :)xeed2012-06-14 10:23:23
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Wed Jun 13, 2012 1:38 pm

hmmm you can use this action (system , create object , then put the object, and layer and position )

also when you do that you must!!!! put that object outside or inside the layout or you will get error so put it outside with destroy behavior if you want.
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Wed Jun 13, 2012 1:46 pm

does this help?

example

instant creation
examplevtrix2012-06-13 13:51:50
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Thu Jun 14, 2012 10:02 am

thanks, this is going forward. :)

but only the last created object should be moved to a free position. in your example, sometimes already existing objects move too.

this is the main problem: how to pick the last instance and check against the remaining.

this is the simplest solution i found trough a temp object.

https://dl.dropbox.com/u/54216429/freieStelleSuchen.capx

but couldn't this be made without a dummy object?

or is there any way to "pick all instances but n'th" ?

many thanks :)xeed2012-06-14 11:16:50
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Thu Jun 14, 2012 12:53 pm

@xeed i don't get what you want but i think you need variables :P
B
48
S
15
G
6
Posts: 795
Reputation: 12,035

Post » Thu Jun 14, 2012 2:37 pm

I modified vtrix's example a little. capx The last created object will be on top in z order.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Thu Jun 14, 2012 3:29 pm

works like a charm :)

thank you!
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests