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

Add Spring.DropWreck #1684

Open
sprunk opened this issue Sep 18, 2024 · 0 comments
Open

Add Spring.DropWreck #1684

sprunk opened this issue Sep 18, 2024 · 0 comments
Labels
enhancement New feature or request Lua API

Comments

@sprunk
Copy link
Collaborator

sprunk commented Sep 18, 2024

Sometimes you may want to keep a unit technically alive after being killed (e.g. for correct damage attribution for any ongoing attacks). Delaying death this way forces you to spawn a wreck manually. It isn't trivial to replicate what the engine does perfectly:

  • poll LuaRules for gadget:AllowFeatureCreation.
  • where exactly does the wreck spawn, midpos? Base pos?
  • with wrecklevel > 1 you gotta traverse the feature death chain manually.
  • gotta set the original unit type for rezzing while obeying rezzability as defined in the featuredef
  • inherit a bunch of traits such as velocity, heading, (ally)team.
  • set smoke (this one is straight up not doable because there is no interface for setting smoke, but that is outside the scope of this request).
  • engine behaviour may change in the future, outdating your gadget.

The request is to add Spring.DropWreck(unitID, number? wreckLevel) -> featureID that behaves the same as if the unit was dropping the wreck as part of its death sequence, but without dying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Lua API
Projects
None yet
Development

No branches or pull requests

1 participant