# kts.AddMonsterGenerator

## Name

kts.AddMonsterGenerator – enable random monster generation at specific tiles

## Synopsis

`result = kts.AddMonsterGenerator(monster_type, tile_list, probability)`

## Description

This function sets up particular tiles as "monster generators". For example, this is used for vampire bats, which are generated at open pit tiles.

The `monster_type`

must be a valid MonsterType (this would be the vampire bat monster type in our example).

The `tile_list`

is a list of tiles (e.g. a list of open pit tiles).

`probability`

is the probability that, during each monster generation cycle, a monster will be generated at the given tile type. (A monster generation cycle is run every `monster_interval`

milliseconds, see kts.MISC_CONFIG.)

## Return Value

No value is returned.

## Errors

Errors may be generated if the input parameters are incorrect.

## Notes

If there is a total monster limit (kts.LimitTotalMonsters), then the probability of generating a monster will automatically reduce, in proportion to how close we are to reaching the total monster limit. (Once the limit is reached, the probability becomes zero.)

Monsters can only be generated within a distance of `monster_radius`

of any Knight (see kts.MISC_CONFIG).

## See Also

kts.MISC_CONFIG – in particular, `monster_radius`

and `monster_interval`

kts.LimitMonster

kts.LimitTotalMonsters

kts.MonsterType

kts.SetZombieActivity

kts.Tile