Any way to spawn a static NPC

So I really want to use the debug menu to create NPCs in the world who will just stay in place, like the NPC you start with in many scenarios. Such an NPC could give me a mission and then actually be found when I wanted to turn it in, could stick around to be traded with, and in general wouldn’t run off in random directions with no sense grabbing random objects along the way.

I’ve experimented a bit with spawning a random NPC and then editing them, but nothing I do seems to make them stand still. It used to be that spawning one in a basement or 2nd story would make them unable to path to ground level, but that doesn’t seem to be the case anymore.

Anyone have any idea how to do this?

Edit: Doing more experimentation, I thought I’d found something when I saw ‘Static NPC’ and ‘Starting NPC’ in the mutation list, but neither seems to do anything.

Edit 2: OK, so the ‘Following’ and ‘Fleeing’ attitudes seem to make the NPC do those things, but the ‘Waiting for you’ attitude seems to do nothing, and none of the others seem to make the NPC stay put as if they were guarding.

  1. Create some update_mapgen that spawns the desired static NPC.
  2. Write a map_extra that uses the update_mapgen to create the map_extra.
  3. Use the debug menu to add the map extra with the NPC to your active game.

It’s not super easy, but it’s not too hard.

I’m… Not really sure where to start with that.

Could you point me to a resource that would explain that?

Update: I’ve found a horrifically hacky way to make this happen.

Step 1: Spawn an NPC.

Step 2: Write down the NPCs opinions and the mission they will give if friendly.

Step 3: Interact with the NPC, possibly try to recruit them, but do not begin mission dialogue.

Step 4: Assuming that NPC is friendly after initial interaction, edit them in the debug menu, edit [M]issions, and remove the mission they would give you without cleanup.

Step 5: Debug menu Add [m]ission and set it to Find_Inhaler. Then talk to them and accept that mission. NPCs with this mission active seem to freeze in place.

Step 6: Debug menu edit [M]issions, mark mission as complete. Then talk to them to complete it despite not having an inhaler. (Possibly hide your inhaler first if you have one.)

Step 7: Debug menu to add back the mission they had previously, and to reset their opinions to their prior levels.

Result: A randomly generated NPC who will remain in place and give you missions until you manage to recruit them.

The Guide for 1st time contributors