Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

AI scripting question

A topic by SKUNKSTUFF22 created Apr 14, 2018 Views: 436 Replies: 6
Viewing posts 1 to 2

I'm wondering how to put something into a new AI behavior script that essentially makes it so the admin centre just "exists" and, as population increases, offloads them as settlers (It's for a Zombie Mod). I'm just asking how to boot out the settlers. but any extra advice would be appreciated (I'm not the best with JavaScript).

I'm pretty sure that the easiest way to do this would be to have a dummy building that builds instantly, supports a unit and as soon as unit leaves you destroy it.

When population increases you tell the AI to place the building, then you deploy the unit and destroy the building.

Developer

You can create a unit directly through scripts. See t_unrest_incidents for examples, when it creates rioters.

Huh. I went through mod_api and couldn't find anything related to units other than interface of that name.

Developer

It should be in there. A function called AddUnit (or something like that)

There are 108 occurences of 'unit' in the mod_api.d.ts and none of them relate to anything like adding, placing, or spawning a unit. one of them is:

declare function CreateUnit(unitData: UnitData, position: Hex, tribe: Tribe)
Developer

Yep, that's the one