Updated NPC Factory (markdown)

Simon Fortier 2018-12-23 12:13:59 -05:00
parent e8036790d1
commit 2d5faa4baa

@ -11,6 +11,28 @@ Units with a [ComPort](https://github.com/simon987/Much-Assembly-Required/wiki/H
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`)
Example:
```assembly
to_upload:
; This is the code that will be uploaded to the Hacked NPC
mov a, 3
mov b, 0x100
hwi 0x9
brk
password: dw "12345678"
.text
; Send password
mov a, 2 ; COMPORT_FRONT_PORT_OUT
mov x, password
hwi 0x000D ; ComPort
; Send first 8 words of the program
mov a, 2 ; COMPORT_FRONT_PORT_OUT
mov x, to_upload
hwi 0x000D ; ComPort
```
### Spawn rate
Currently, the Factory will create a new NPC every `NPC_LIFETIME / MAX_NPC_COUNT` ticks.