NPV - Tutorial - Part 4


Part 4 Overview - Readying The Ent And Lua


There are several over-arching files that work together to allow a character entity to appear in-game. In the case of custom entities spawned via Appearance Menu Mod (AMM), these are the .lua, the .ent, and the .app files. These files form a chain, referencing each other in order so that when you click to spawn an entity in the AMM interface the game is able to identify the correct entity and appearance for that entity, and to load the correct components.



Preparing The Ent


Due to its status as a bridge of sorts between the .lua and .app files, the .ent file must be kept up to date when any appearances are added to or renamed within the .app file. Here, the .ent file must be edited in order to properly connect it to the .app file that you prepared in Part 3 of this NPV tutorial.


Editing The Ent

Though you will need to do additional work in the .ent file in the future, these first steps will prepare the file for your initial in-game NPV testing.

  1. In Wolvenkit, locate the .ent file in the Project Explorer panel and double-click it to open it for editing.
  2. Expand the appearances entry.
  3. Click on the entTemplateAppearance entry for npv_appearance_00, so that its details are visible in the right side panel.
  4. In the Project Explorer panel, locate the .app file; right-click it and select Copy Relative Path.
  5. Locate the DepotPath portion of the appearanceResource data box in the right side panel. Erase the existing path and paste in the new path that you copied in the previous step.
  6. Near the top of the WolvenKit window, click Save File to save your changes to the .ent file.


Making Your NPV Spawnable


By this point, you have created, assembled, and edited all of the parts that you will need to test your NPV in-game for the first time, except for one. Now that you have created the underlying files for this custom character, you must make it possible for Appearance Menu Mod (AMM) to recognize and spawn your NPV by creating a .lua file with the appropriate information.


Customizing The Lua

Though you will eventually need to make further edits to the .lua file, these first steps will be sufficient to allow you to test your NPV in-game.

The .lua file contains coding that the game must be able to process and implement correctly; for this reason, it is crucial that you do not alter the text or formatting outside of the specified changes below.

  1. Download the prepared lua file from the NPV Resources page.
  2. Rename the downloaded .lua file to a unique file name.
    • You may want to follow the general format: npv_yourusername_npvfirstname_npvlastname
  3. Open the .lua file using your plain text editor of choice (such as Notepad or Visual Studio Code).
    • Do not use a program such as Word, as the formatting applied by the program may break the file's functionality.
  4. In the third line, after the text modder = , change the text between the quotation marks to reflect your modding nickname, handle, or alias.
    • This may include uppercase and lowercase letters, hyphens, or underscores, but should not include spaces or other special characters.
  5. In the seventh line, after the text unique_identifier = , change the text between the quotation marks to contain a unique identifier for this specific NPV.
    • You may wish to follow the generic format suggested in the file, but be sure to replace the relevant placeholder information with your own specific information.
    • This may include uppercase and lowercase letters, hyphens, or underscores, but should not include spaces or other special characters.
  6. In the thirteenth line, after the text name = , change the text between the quotation marks to contain the name of the character that you are creating the NPV to mimic.
    • This may include uppercase and lowercase letters, hyphens, underscores, spaces, and some special characters, but cannot include quotation marks, as one might otherwise use to denote a nickname.
  7. Save your .lua file, but do not close it.
  8. In WolvenKit, with your NPV project open, locate the .ent file in the left-side Project Explorer panel; right-click it and select Copy Relative Path.
  9. In the .lua file, in the fourteenth line, after the text path = , replace the text between the quotation marks with the file path you copied in the previous step.
  10. Edit the file path you pasted in the previous step, replacing each single backslash character (\) with a pair of backslash characters (\\).
    • For example, if you pasted in the path yourusername_npvfirstname_npvlastname\app_and_ent\npvfirstname_npvlastname.ent in the previous step, you would alter the path to be yourusername_npvfirstname_npvlastname\\app_and_ent\\npvfirstname_npvlastname.ent .
  11. Save your .lua file again.