Scripting:TWTriggerAIEcologyDespawn

Building pieces of another world.
Revision as of 18:34, 22 June 2020 by gravatar The Watcher [userbureaucratsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

TWTriggerAIEcologyDespawn is a script that despawns slain AIs, generally ones spawned by TWTrapAIEcology and it informs the AIEcology that the AI has been despawned. Use this script to remove AI corpses that would normally remain on the map so that the game can reuse the object ID.

If an AI despawns itself - that is, it doesn't leave a visible corpse - you should use TWTriggerAIEcologySlain to update the AIEcology instead of this script, as the AI may despawn before this script updates the AIEcology.


Design Note Parameters

This script supports all the following arguments in the Editor -> Design Note in addition to the arguments given in the TWBaseScript and TWBaseTrigger documentation.

TWTriggerAIEcologyDespawnRate
Type: time
Default: 2m
This is the delay between an AI being slain and each attempt to despawn the AI. If the AI is visible, and TWTriggerAIEcologyDespawnVisible is false, the AI is not despawned and the script waits for this period before trying again.
TWTrapAIEcologyDespawnVisible
Type: boolean
Default: false
If set to true, no visibility checks are done on when despawning slain AIs, and they will be despawned even when they are on screen.

See also


Authors

  • gravatar The Watcher [userbureaucratsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+]