<aside> 📦 DTADD.acs
</aside>
<aside> ⚡
int AddSpawnFunc(int type, str name)
</aside>
Spawn functions are scripts that execute when specific actors spawn. Scripts can be made to execute on those actors as the activator. This function adds a script to be executed in that list of scripts.
type: int - Which actors call the script
DTADD_SFT_WEP: 0 - Weapon Token SpawnDTADD_SFT_ITEM: 1 - Item SpawnDTADD_SFT_PARTYBALL: 2 - Party Ball SpawnDTADD_SFT_FLAG: 3 - CTF Flag Spawn (including White Flag)DTADD_SFT_PROJ: 4 - Projectile SpawnDTADD_SFT_PROJCLIENT: 5 - Projectile Spawn (executed on CLIENTSIDE)DTADD_SFT_PILLAR: 6 - Skulltag Score Statue Spawnname: string - Name of the script to run<aside>
⚠️ Note: If defining a spawn function for projectiles to be called on the client-side, you need to call this function in an OPEN CLIENTSIDE script.
</aside>
An excerpt from core’s scripts which show how to properly use SFT_PROJ and SFT_PROJCLIENT.
script "core_spawnfuncs" OPEN
{
AddSpawnFunc(DTADD_SFT_PROJ, "core_projtransgive");
}
script "core_spawnfuncs_client" OPEN CLIENTSIDE
{
AddSpawnFunc(DTADD_SFT_PROJCLIENT, "core_projtransgiveclient");
}