XS spawn unit?

Am I misremembering, or was there a spawn unit function in xs that behaves like the spawn unit effect in genie?

(If there isn’t could it maybe be added? And perhaps a trigger effect as well.)

I think you might be looking for xsCreateUnit.

If, however, you need the exact effect that is used for “Spawn Unit” in the DAT, then you can use the cSpawnUnit effect with xsEffectAmount

1 Like

Ah, that cSpawnUnit sounds like what I was looking for!
I’ll have to check and verify if it is.

Yes, this was what I was looking for:

int unitToSpawn = 83;
rule spawnUnits active
 minInterval 5 maxInterval 5
 priority 10
 group spawnGroup
{
 xsEffectAmount(cModResource, cAttributeSpawnCap, cAttributeSet, 4);
 xsEffectAmount(cSpawnUnit, unitToSpawn, 82, 2);
}

This is, of course, just a quick test, but it will work. muahuahuhaHA!

1 Like