Skip to content

Adding new NPCs

Hugues Johnson edited this page Jul 22, 2018 · 2 revisions

I realized I officially made the project structure too complex when I started trying to add new NPCs to each location. There are 8 steps involved in this mess.

  1. Create the actual tiles. Due to how the tiles are loaded into the VPD and turned into a sprite, each 16x32 tile is mapped like:

0 4

1 5

2 6

3 7

This code is hard-wired to having all the characters be 16x32. Supporting other sprite sizes is not impossible but also not zero effort. The sprite frames need to be ordered like:

  1. Down frame 0,1,2
  2. Up frame 0,1,2
  3. Left frame 0,1,2
  4. Right frame 0,1.2

This code is also hard-wired to 3 frames per direction. Same disclaimer as above.

  1. Add a reference to the new tiles in inc_tiles

  2. Update the scene definition for the scene this NPC will appear in. Sometimes this is optional.

  3. Update InitNPCLocations to place this NPC in a scene. This is optional if the NPC doesn't appear in any scene at the start of the game.

  4. Add a new entry to data_CharacterDefinitions

  5. Add a new entry to table_Text to map the NPC name to a string

  6. Add the actual string to the strings file

  7. Add a new entry in const_ObjectIDs

Clone this wiki locally