Custom NPC Tutorial: Difference between revisions

From Bonfire by Hogswild Prasetto
bonfire-wiki>Sonic260
WIP, Added Section 1, working on Section 2... Saving this because my token expired...
 
bonfire-wiki>Sonic260
Line 9: Line 9:


== Interface Overview ==
== Interface Overview ==
[[File:Interface.png|centre|thumb|1600x1600px]]
[[File:Interface.png|centre|thumb|720x720px]]
# '''File Menu''' - Save your NPC; Load Existing NPCs; Import one of your profiles to use as a Custom NPC; rename the file.
# '''File Menu''' - Save your NPC; Load Existing NPCs; Import one of your profiles to use as a Custom NPC; rename the file.
# '''Character Profile''' - Give your NPC a name, and manage their inventory by clicking the '+' icon
# '''Character Profile''' - Give your NPC a name, and manage their inventory by clicking the '+' icon

Revision as of 03:42, 2 June 2019

Welcome! In this tutorial we will learn how to use Bonfire's built-in Character Editor to create Custom NPCs. First, we'll explore how to design your NPC's appearance and place them in the world, then we'll give them basic dialogue and enable them to speak to the player. Afterward, we'll learn how to create branching dialogue and Custom Actions to interact with our NPC. We'll enable our NPC to "remember" the player, and lastly we'll wrap up the lesson with a simple fetch quest.

At the end of each section, a sample Orc will be provided to demonstrate what we learned.

Setup

Before we begin, it's recommended that you have some familiarity with the Command Console as we'll be using a couple of them in this tutorial. You don't need to remember everything, but knowing some of the Basic or Debugging commands like save or rel will be useful.

The NPC Editor can be accessed from Bonfire's Main Menu. From the title screen, click Mods, then Character Editor.

Interface Overview

  1. File Menu - Save your NPC; Load Existing NPCs; Import one of your profiles to use as a Custom NPC; rename the file.
  2. Character Profile - Give your NPC a name, and manage their inventory by clicking the '+' icon
  3. Attributes - This will apply a default "state" for your NPC when they load in the scene.
  4. Location - Sets your NPCs coordinates and the scene (or level) that they will appear in
  5. Metadata - Holds data about the Mod creator and a description of the NPC. Please fill this out if you intend to share your NPCs with other players.
  6. Character Dialogue - This space holds the entire conversation
  7. Navigation - "Tiny View" allows you to collapse the entire dialogue tree so it's easier to traverse. The Jump field lets you move to a specific line number.
  8. Exit - Exits the character editor and reloads the current scene.

Section 1 - Creating the NPC

First, we'll need an Orc to import into the Character Editor. A NPC's appearance is generated by importing one of your pre-existing profiles. So we have the option of either creating a brand new profile, or, if you would rather use your own Orc as an NPC, you can skip ahead to Step 2.

  1. Create a brand new profile, or load an existing one
    • From Bonfire's Main Menu, click Profiles, then click Create New. Spend as much time as you want designing your NPC's appearance, and be sure to give them a name. When you're finished, click Enter to save your Profile and exit the character creation.
  2. Set your NPC's spawn point
    • Decide where you want your NPC to spawn in the world. Do you want them to show up in the Outback? Occupy the Inn? Lounge at the island? Etc.
    • For this tutorial, we'll spawn our NPC on the Island. Load up one of your profiles, open the console with F1, and then type:
      • travel Sea1
    • This will instantly warp you to the Island. Next, find a good location to spawn your NPC. When you're ready, open the console again and type:
      • refpos
    • refpos will save your character's current X, Y, and Z coordinates into the console.
  3. Import the character
    • We're now ready to create our NPC. Return to the character editor by opening the Main Menu, then click Mods then Character Editor. Alternatively you can open the console and type:
      • chedit
    • Click the "Import Character" button and find the Orc you created in Step 1, or import one of your pre-existing characters. You'll see that your Orc's name will appear within the Character Attributes section.
  4. Manage your NPC's Inventory
    • Expand the Items... field by clicking the " + " button next to it. This section will let you control your NPC's inventory, including their clothing. By default, new Orcs will only contain a leather Loincloth, but if you imported one of your profiles, you may see all the items you collected in-game.
    • Click New Item to add an inventory slot. Click Change to select a new item from the list. Click Remove to delete inventory slots.
    • Check in Wear this item to make your Orc equip this when they spawn.
  5. Set your NPC's attributes (Optional)
    • This section is used to apply a default "state" for your NPC when they load in the scene. For example, you could have them execute a console command, or prevent them from spawning unless the player is at a certain point within Bonfire's story. This isn't necessary for our purposes, so we will skip this part.
  6. Set the location
    • This is where we'll use the coordinates we saved in Step 2. In the Scene field, click "World1" and select "Sea1."
    • In the Position field, select "Paste from Console," and the X, Y and Z fields will populate the coordinates from the refpos command.
  7. Write the Metadata
    • Use the text boxes to sign your name as the author of this NPC, and write a brief description of this NPC. This is recommended if you intend to share your NPC with other players.
  8. Character Dialogue - Hello World
    • In the Speech section of the dialogue box, type the following message:
      • Hello @playername, my name is @playerinterest. Congrats on creating your first NPC!
    • Don't worry if you don't know what the rest of the buttons and fields in the dialogue box are for. In the next section we'll go over the functions of a dialogue box, and learn how to create basic dialog.
  9. Save your NPC and exit the Character Editor.
    • When you're finished, click the "Save" button, and this will save your NPC as a .bab file located at:
      • C:\Users\%userprofile%\AppData\LocalLow\Prasetto\Bonfire\Mods\Characters
    • Click the "Exit" button. This will immediately reload the game, and place you back at the entrance to the island.
  10. Enable your NPC
    • When the scene reloads, you'll immediately notice that your NPC hasn't spawned in the world yet! That's because we'll need to enable them.
    • From Bonfire's Main Menu, open Mods then Mod Manager. You'll see the list of modes you have installed currently. Find the name of the NPC you just created, and click the check mark.
    • Click "Done" and the scene will reload again. Back at the Island's entrance, you should see our newly created NPC. Go speak to them, and they will speak the "Hello" dialogue we gave them.
  11. Link to Section 1 Sample: []

Section 2 - Basic Dialogue

Well done on creating your first NPC! Now that they have a presence in the world, next we'll give them a voice and learn how to create basic dialogue.

Dialogue in Bonfire is made by creating several objects, called "Dialogue Boxes" and linking them together in a series. When you speak to the NPC, they will read the Speech field in first box (usually Line 0) then read the rest of the Dialogue Boxes in the order they appear.

Anatomy of a Dialogue Box: