Jump to content

[Tutorial] Notes on editing npc_basic.nbsc, gen files


UberGrainy

Recommended Posts

Just dumping some notes here, in case they're useful to anybody.

 

I was trying to figure out how to disable NPC head, so that it doesn't clip through Wiggler head.
Changing gender to FF FF in the NPC cmm file sorta works, but also causes polygons to randomly explode across the screen.

So I tried editing npc_basic.nbsc, because Vuze used it to change NPC sizes.

 

EDIT: Important thing I forget to mention. Changes to npc_basic.nbsc only seem to update on game restart, not exit/enter room, nor return to title screen.

 

npc_basic.nbsc notes:
It seems like each NPC has 47 bytes of data defining their ID, their scale (in float), and whether they are a "generic/lesser" NPC or not.
Most NPCs have a scale of 1 (00 00 80 3f, backwards). The Handler is 0.93, and the Hub Provisions Girl is 0.95.
Changing the other data didn't seem to have any obvious results.

There is a specific flag that tells the game they are a generic/lesser NPC. When set to 1, it will use the NPC ID defined near the start of that NPC's data.
For example, the Handler is 02. Even if you copy paste the data from other main NPCs, the Handler remains as the Handler.
However, if you set the generic/lesser NPC ID flag to 1 (it's the 25th or 26th byte), and then change 02 to, say, one of the hub girls (eg. 2F 01), the Handler will change appearance.
But the NPC ID also seems to be an important identifier for cutscenes, and dialog.

NPC functions don't seem to change, ie. even if you replace the Handler with the Hub Provisions Girl, she still functions as Quest Counter.
However, accessing the Handler's quest book without using any of her body models (ie. with the book attached), will cause the game to crash.
You can get around this by replacing an NPC outfit with the Handler's body, but then all NPCs using that outfit will have the Handler's body.

Earlier I mentioned how NPC ID is an important identifier for cutscenes.
If you change the Handler to a generic/lesser NPC, she will disappear from cutscenes completely.
Or the cutscene will hang on loading. I'm assuming it's because it's still looking for NPC ID 02, and can't find its data.

Another problem I found is if you change NPC scale, it may prevent them from appearing in cutscenes.
For example, changing the Meowscular Chef to 10x his size, causes him to be invisible during his cutscenes. I've no idea why.

So, in the end, I wasn't able to find decent viable solutions for anything.

Gen file notes:
Variations and outfits for the generic/lesser NPC outfits are defined in the NPC gen file. Two bytes after the charamakepreset location is the outfit.
A few bytes after that is the variation. For example, 02 and 03 define whether the hub girl swimsuit is blue or green, and which parts are enabled/disabled.
The extra data at the bottom of gen files are accessories, and possibly the scale of those accessories (in float).
For example, NPCs who eat dinner at night have a mug accessory at the bottom of their gen file. Hub girls have books/notepads at the bottom of their gen file.

Edited by UberGrainy
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...