Understanding people record data

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
Uncanny_Valley
Posts: 221
Joined: Mon Mar 23, 2015 5:47 pm

Understanding people record data

Post by Uncanny_Valley »

I been working on the my editor during the weekend and I'm trying to understand how NPC work. I would like a little help.

Does the Flags property only contain the check for the NPC gender? And being a flag, then all even number would be male, otherwise female. Do you understand that correctly?

How does the Faction ID work? I been looking through the FactionFile but I can't make sense of it. :(

Is there any NPC behavior attached to specific sprites? For example, shop keepers?

Thanks in advance!

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Understanding people record data

Post by Interkarma »

I'll try to answer best I can. Let me know if more detail needed. :)

Just to ground everything, I understand that you're referring specifically to RmbBlockPeopleRecord in DFBlock.cs.

Uncanny_Valley wrote: Sun Dec 08, 2019 11:10 pm Does the Flags property only contain the check for the NPC gender? And being a flag, then all even number would be male, otherwise female. Do you understand that correctly?
The full "Flags" usage in classic is unknown, although it's only observed use is setting gender of a flat NPC. This is all DFU reads in any case, so it's safe just to set 0x00 or 0x01 if injecting custom NPCs.

Uncanny_Valley wrote: Sun Dec 08, 2019 11:10 pm How does the Faction ID work? I been looking through the FactionFile but I can't make sense of it.
FactionID is the faction that NPC belongs to. It references an entry in FACTION.TXT. For example, faction #510 is "The Merchants".

Uncanny_Valley wrote: Sun Dec 08, 2019 11:10 pm Is there any NPC behavior attached to specific sprites? For example, shop keepers?
This is determined by the FactionID. For example, if the NPC is of faction #510 "The Merchants" and are inside of a General Store, they will offer the "Sell" service. If that same NPC of faction #510 is placed inside a bank, they will offer banking services. Various faction IDs will control services offered such as training, quest offers, repair, etc.

Post Reply