How to: Create a npc gossip menu - Kyoril/mmo GitHub Wiki
Introduction
In this little guide I want to describe how you can create an npc with a gossip menu for the game using the editor. In the end, you will get an npc that you can interact with in the game and when you do so, a gossip menu will be shown.
The editor
First, start the game editor. You should already have it installed and running on your machine, as well as have a copy of the current data repositories checked out.
Create the npc first
First, we need to have an npc. So open the 'Creatures' editor window by clicking the 'Creatures' button in the toolbar on the top of the editor:
After that, the creature editor should open. Now click the 'New' button in the top left to create a new creature in the editor. The new creature is added at the bottom of the list. Select the entry and give the npc a name first. You can do so by typing the name in the empty 'Name' field.
For this guide, let's name it 'Gossip Tutorial Guy' or come up with something more creative.
Configuring the npc
Okay, a creature or npc has many different properties to modify. Lets quickly go through the important ones for this guide and what values you should give them:
- Factions
- Faction Template: Choose "Human Race Npcs" here. This will make the npc friendly toward players that chose the Human race when creating their character.
- Npcs
- Gossip Menus Linked to this unit: Here, we will add our gossip menu after we created it. We will come back here later.
- Visuals
- Male Model: Choose a model for this npc when it is spawned as male npc. Preferrably use the model "Human Male Model" from the list.
- Female Model: Choose a model for this npc when it is spawned as a female npc. Preferrably use the model "Human Female Model" from the list.
- Scripting
- Add Trigger: Here you can add triggers. We need those for scripted reactions to advanced gossip menu actions later.
Thats it, the other properties are not required to be modified for this guide.
Spawning the npc in the world
Now you have a new npc, but where is it? Right, it needs to be spawned first. For this, look at the Asset Browser window in the bottom. There, open the "Worlds" folder and in there the "Development" folder. Now click on the "Development.hwld" file to open the world in the world editor. This might take a few seconds depending on your pc.
In the world editor, you can navigate by using the WASD keys while holding the right mouse button down in the editor viewport. If the mouse is outside of the viewport, you can't move in the viewport itself. When you move the mouse while you hold the right mouse button you can rotate the camera.
On the right side of the viewport you will see the "Details" panel. Activate it if it isnt active and set the Mode to "Spawn Editor". You can also do so by hitting F4 while in the viewport. Next, you need to choose a Map whose spawns should be edited. Currently, the editor does not automatically link a hwld file to a map on the server, so you need to choose the proper map here manually right now.
TODO: Continue