Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up[WiP][CR]Remove hardcoded NPC item spawn fallbacks #20616
Conversation
Coolthulhu
added some commits
Mar 21, 2017
This comment has been minimized.
This comment has been minimized.
|
Pinging @SunshineDistillery |
This comment has been minimized.
This comment has been minimized.
|
Question. Will override work correctly, if more are added? I was recently made aware of an issue wherein adding additional NPC classes with overrides fail to function. At least according to a ping by @chaosvolt earlier tonight, this hardcoded fallback appears to entirely preclude adding custom NC files for custom NPC classes. Ping was received from this issue in their repository, some time before I returned home: chaosvolt/cdda-arcana-mod#2 |
This comment has been minimized.
This comment has been minimized.
|
Further information on this, my own testing has led me to suspect that the mod author encountered a problem with adding new classes to dynamic NPCs (and the initial companion NPC), as I have found that custom classes can add overrides that will work for fixed NPCs spawned in mapgen. |
This comment has been minimized.
This comment has been minimized.
|
I'll re-PR it if there is any interest after 0.D. |
Coolthulhu commentedMar 21, 2017
Closes #20461
Unfortunately lots of boilerplate here. The alternative would be to autogenerate the item groups.
Item groups for NPC spawns are of 3 types:
Worn items
Default group: NC_CLASS_worn_male/female
Fallback: npc_worn_male/female
Items from this group are worn if possible. Otherwise they aren't spawned.
Inventory
Default group: NC_CLASS_inventory
Fallback: npc_inventory
Items from this group will get their containers and be placed in the inventory.
Weapon by skill
Default groups: NC_CLASS_SKILL
Fallback: npc_SKILL
One group per skill.
Those are checked in descending order of NPC's combat skills. If the NPC has no combat skills, it gets a stabbing skill of 0 for the purposes of weapon spawns.
The best weapon of this group (one with highest weapon value) is wielded. Others are added to inventory, as they're probably ammo or spare throwables.