Updated NPC Factory (markdown)

Simon Fortier 2018-12-23 11:51:36 -05:00
parent 3a3459422a
commit 2623fa6134

@ -1,4 +1,17 @@
## NPC Factory ## NPC Factory
![NPC Factory](https://user-images.githubusercontent.com/7120851/34075634-138c889e-e29a-11e7-962d-fee63016a345.png) ![NPC Factory](https://user-images.githubusercontent.com/7120851/34075634-138c889e-e29a-11e7-962d-fee63016a345.png)
The NPC Factory is a 2x2 tiles structure that is randomly generated in the game universe. It periodically creates new NPCs that will work in a certain radius around the Factory. As of version 1.3a, there is no way to interact with it. The NPC Factory is a 2x2 tiles structure that is a part of a [Settlement](https://github.com/simon987/Much-Assembly-Required/wiki/Settlement).
It periodically creates new NPCs that will work in a certain radius around the Factory.
The NPCs spawned by the factory are bound to its [Settlement](https://github.com/simon987/Much-Assembly-Required/wiki/Settlement), and will generally be hostile to foreign NPCs (This feature has not yet been implemented). Regular NPCs will not go more than 3 worlds away from the Settlement.
### Hacking
Units with a [ComPort](https://github.com/simon987/Much-Assembly-Required/wiki/Hardware:-Universal-Com-Port) are able to upload data to the factory so that the next spawned NPC becomes a [Hacked NPC](https://github.com/simon987/Much-Assembly-Required/wiki/Hacked-NPC). This gives the player the opportunity to control more than one unit.
The Factory starts accepting data sent by the ComPort as soon as it has received the password for this Settlement (See [Settlement](https://github.com/simon987/Much-Assembly-Required/wiki/Settlement)). Attempts to send messages to the Factory while it is locked will fail (the `COMPORT_FRONT_PORT_OUT` command will return `0`)
### Spawn rate
Currently, the Factory will create a new NPC every `NPC_LIFETIME / MAX_NPC_COUNT` ticks.
Lifetime for all types of NPCs is `1024` ticks and the maximum NPC count is `16`. The factory will not create an NPC if all adjacent tiles are blocked.