Object that creates wood when the last one is destroyed

Get help using Construct 2

Post » Fri Jul 07, 2017 4:20 am

Hello, I am making a game, and I want to make an object create a chunk of wood that falls, when that wood is destroyed it will create another one. How do I go about doing this?
B
16
S
5
Posts: 20
Reputation: 1,040

Post » Fri Jul 07, 2017 9:55 am

On the object you can use the spawn action to spawn a chunk of wood. You can give it physics behaviour so it falls or set it to a bullet at angle 90 so it move downwards. You then destroy the wood by whatever event you are using, hitting the floor or something. Then use the event trigger On chunk of wood destroyed > spawn chunk of wood on object.
B
46
S
16
G
77
Posts: 2,157
Reputation: 45,829

Post » Fri Jul 07, 2017 3:31 pm

@Plinkie First, thank you, second, I know that much, but I have multiple wood spawners, how do I make a wood spawner associate with the wood it created?
B
16
S
5
Posts: 20
Reputation: 1,040

Post » Fri Jul 07, 2017 3:44 pm

Oh, and I just realized that my last post might have come across as rude. Sorry.
B
16
S
5
Posts: 20
Reputation: 1,040

Post » Fri Jul 07, 2017 3:52 pm

Oi, talvez o objeto particulas te ajude... se for pra criar fragmentos de madeira...
Huemerson
B
22
S
16
G
21
Posts: 108
Reputation: 16,884

Post » Fri Jul 07, 2017 3:56 pm

Usually I would give the wood spawner an instance variable, a kind of ID, so the first one var is 1, second one, var is 2 etc which you can pull from the wood spawner's own IID (instant of that object type). Then any wood spawned from it, you can set an instance variable on the wood to match the spawner. So something like spawner - spawn the wood. Wood set wood.variable=spawner.variable. Then any wood marked as 1 has come from spawner 1, marked as 2 from spawner 2 etc.
B
46
S
16
G
77
Posts: 2,157
Reputation: 45,829

Post » Fri Jul 07, 2017 4:15 pm

Thank you! Also
@Huemerson Estarei usando partículas. Obrigado. Isso foi o Google traduzido
B
16
S
5
Posts: 20
Reputation: 1,040

Post » Fri Jul 07, 2017 4:19 pm

B
16
S
5
Posts: 20
Reputation: 1,040

Post » Fri Jul 07, 2017 5:29 pm

Not sure what your trigger event is meant to be for spawning wood so I set it to every 2 seconds. This is the logic for matching wood to its own dispenser. https://www.dropbox.com/s/ytkppgcc6b0hf ... .capx?dl=0
B
46
S
16
G
77
Posts: 2,157
Reputation: 45,829

Post » Fri Jul 07, 2017 5:42 pm

My trigger is when it is destroyed if that helps and thanks
B
16
S
5
Posts: 20
Reputation: 1,040

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests