-
Notifications
You must be signed in to change notification settings - Fork 4
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
[REQUEST] new function onSpawnEntity(_entity) function for entities/items/skills #301
Comments
This is actually a pretty cool idea I think. |
I've been working on this for quite some time and unfortunately it doesn't have a simple/clean solution. Ideally I'd like the My current solution consists of all of the following:
An alternative is to call Another alternative is to call Summary: |
After a lot more working here is a "dirty" solution that I have that currently seems to work. We basically call
this.m.HasOnSpawnBeenCalled <- true;
this.m.IsInstanceAdded <- false;
this.m.IsAssigningRandomEquipment <- false;
if (this.isPlacedOnMap() && !this.m.IsAssigningRandomEquipment && this.m.IsInstanceAdded && !::Tactical.Entities.m.IsResurrecting)
this.onSpawn();
So:
Other thoughts: |
Is your feature request related to a problem? Please describe.
Currently no skill, item or entity can actively react to an entity spawning mid fight.
This ability would be useful for
Describe the solution you'd like
There is the
function spawnEntity
in the BB root table that is used to spawn any entity via its scriptPath mid-fight.That function should be hooked so that it calls the following new
onSpawnEntity
function on the spawned entity before returning itAdd this new function to the entity.nut:
Similar functions would be added to
skill_container.nut
,skill.nut
aswell asitem_container.nut
anditem.nut
. But here they wouldn't contain any inherent effects.So as a nice side-effect the night effect is now automatically added to every entitiy that is spawned mid-fight. No longer do we need to do this manually for unleashable animals for example.
The text was updated successfully, but these errors were encountered: