Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Emit infantry on destruction" trait / make SpawnActorOnDeath emit multiple units #9548

Open
clemty opened this issue Oct 5, 2015 · 4 comments
Labels

Comments

@clemty
Copy link
Contributor

clemty commented Oct 5, 2015

TD used to spawn actors when buildings were destroyed (e.g. Commando blows up a SAM site: two minigunners appear); there apparently exists an EmitInfantryOnSell trait, but there is no such thing as EmitInfantryOnDestruction.

SpawnActorOnDeath is not listed on https://github.com/OpenRA/OpenRA/wiki/Traits , but it seems it can only emit a single actor:

SpawnActorOnDeath:
  Actor: e1
EmitInfantryOnSell:
  ActorTypes: e6,e1,e1,e1

Also the traits are named inconsistently (ActorTypes & Actor, ProductionAirdrop uses ActorType), and wouldn't SpawnActorOnSell be better? (I guess it's possible to emit vehicles as well)

@penev92
Copy link
Member

penev92 commented Oct 5, 2015

"Yes" to SpawnActorsOnSell with an Actors property and "yes" to SpawnActorsOnDeath with an Actors property.
Also SpawnActorOnDeath is not on the traits page because it was just recently added and that's the traits page for the release.

@abcdefg30
Copy link
Member

Isn't this doable now that you can have multiple instances of SpawnActorOnDeath?

@phrohdoh
Copy link
Member

@abcdefg30 Yes that is possible, but I don't see a reason not to fulfill this request.
SpawnActorOnDeath being conditional and allowing multiple Actor types to be provided is the most flexible without requiring many SpawnActorOnDeath instances.

This needs discussion and a decision on how we're going to supply spawn offsets.

The path of least breakage would be Offset being refactored into CVec[] Offsets with a 1:1 relationship with Actors.

@pchote
Copy link
Member

pchote commented Jul 12, 2017

The issue with a 1:1 relationship is that we don't have a way for specifying cell+subcell pairs. It would be simpler IMO to define just the footprint of valid cells (e.g. CVec[] Offsets) and then spawn the units randomly within those.

In any case this should be sharing at least the user facing behaviour but ideally also the code with SpawnActorsOnSell. We could pull out a base class like we do for AffectsShroud or have a single trait that has an enum for EmitType.Sell, EmitType.Destroyed, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants