I'd hoped to figure this out by reading some tutorials on modifying the events of existing NPCs, but haven't been able to find any info on actually defining a new NPC or placing/positioning them. I'd like to use events tied these new NPCs to help automate setting up new test saves or to create new shops/menus, among other things.
#How do I add a new NPC to a field?
64 messages · Page 1 of 1 (latest)
Ok so from what I can tell, you can define a new NPC by adding an entry to the relevant block in the field’s .ftd file in field/data. This seems to be where you can set position/rotation? There seem to be a few other data fields in these entries but I have no idea what’s they’re for. Notably there seems to be a field to set something called a “FNT ID”? I have no idea what this is though.
Then field/npc contains a bf file where you can set event and message scripts for these NPCs, though I’m currently unsure how to set an NPC to reference a specific procedure here.
I am still no closer to figuring out how to set a model, or the name that comes up for the Talk prompt.
@undone wigeon could probably help since they have a custom debug NPC thing for CBT
I've been slowly figuring some stuff out over the last few days, but the FPT file has me really stumped. Clearly this is where you set the date and time an NPC is supposed to appear, but I have no idea how to link the data here to NPC data set up in other files.
Have you tried comparing already made FPT files and messing with them to see what changes?
I'll look into it later on today either way since this info would be great to know.
seems like you change the 'packid' U32 to get different npcs. Time to figure out how to do packids
I was trying to help them figure this stuff out in DMs but there's like 3 or 4 different files that seems to influence NPC stuff and I was just at a total loss lol
I see, could you lay out everything that you can figure out? So that I can take it from there
Or atleast tell me what files influence the npc stuff?
from what I can remember:
- the FBN file for the field has the spawn location coordinates
- the FNT file has the relevant NPC block/data (for KFE the FNT file is instead named ENT)
- the FPT file is really not that important and can be copypasted around```
Interesting, maybe the FPT is more specialized then? Since it does actually do some stuff. But i'll be testing everything anyways so thank you for this info.
npc assets
there are blocks for NPC assets that define model/animations
the specific model i wanted to use wasnt on any existing NPC so I had to add it
ah
what template do you run for RESRCNPCTBL.BIN?
there should be one in the templates repo
Ah I see, just missed it when searching.
So far I’ve been using DeathChaos’s debug NPC as a reference, and using Kanda (field 010_004_00) as my test field.
I’ve been able to convert the existing NPC in Kanda (the priest) into whatever I want, so I think I’m solid on stuff like positioning, setting a model, setting a script to run, etc.
I think my main hangup at this point is that I’m not sure how to get the new NPC that I’ve set up in FBN and FNT to actually spawn when loading into the church.
No matter what I try it’s always just the existing Priest.
the fnt/ent block has bitflags on it
it has enable/disable flags
you need to set those to -1 otherwise all the conditions have to match up
(or was it 0? i dont remember)
They are set to -1.
When I was messing with the FPT file, changing the last entry’s “block ID” field caused the priest to despawn.
I was able to add an additional entry to the file without the priest despawning as long as the block ID didn’t change.
Something else I tried was swapping out the INIT script for a dummy one
just to see if maybe something in there was keeping the new NPC from spawning in.
But no dice.
Here's my fbn and fnt just in case anyone might potentially find that useful.
NPC index 3 is my new NPC in the fbn. In the FNT it's index 9.
So a thought occured
that being, am I even using the correct templates?
p5_FNT.bt and P5_kfenpc_fpt_bin.bt are the ones I've been using up to now
those should be correct
So
interesting experimentation result
I tried pasting the entry for the kanda priest into every other entry in the vanilla FNT file
and that crashed the game
but
pasting it into every entry except for the last just caused a bunch of him to spawn.
- there should be a p5r specific template for fnt/ent
- the files have to have a dummy block as the first and last entry
if you put any entries after 2nd dummy block, game will not read them
Yeah I just figured that out.
Now I feel kind of stupid.
Since the solution was staring me in the face for the better part of a week and I didn't catch it...
anyway, only one thing left to learn here, I think:
what file is the interaction prompt text stored in?
i'm not sure what youre asking
Reworded it
