Page 1 of 1

Unit Launcher (Worm) - Best way to do this?

Posted: Wed Apr 20, 2016 8:38 pm
by TheSAguy
Hi,

So I gave worms the ability to launch units at you.

I did this by adding a a create entity to the projectile:

Code: Select all

 {
	type = "create-entity",
	trigger_created_entity = "true",
	entity_name = "unit-cluster"
 },

The entity that gets created,"unit-cluster", is a biter with 1 life and a negative life re-gen of -2, so it will die.

Using "defines.events.on_entity_died" I then spawn units when "unit-cluster" dies.

Code: Select all

	if (event.entity.name == "unit-cluster") then
		SpawnLaunchedUnits(event.entity)
	end
Where "SpawnLaunchedUnits()" will create units based on the evolution factor.

Was just wondering if anyone saw any issue doing this?
Thanks.

Control Code
Unit Cluster Code
Projectile Code

Re: Unit Launcher (Worm) - Best way to do this?

Posted: Wed Apr 20, 2016 8:42 pm
by Klonan
Following what i did in here might help:

viewtopic.php?f=93&t=23559