Difference between revisions of "Basic NPC Creation Tutorial"

715 bytes added ,  15:47, 21 November 2015
m
imported>Dagit
imported>Megalomaniakaal
 
(24 intermediate revisions by 16 users not shown)
Line 1: Line 1:
==Overview==
{{Featured}}
This tutorial will cover the basics of creating a new NPC combatant and placing it in a dungeon.  The following subjects will be covered.
This tutorial will cover the basics of creating a new [[NPC]] combatant and placing it in a dungeon.  The following subjects will be covered.
* Creating a new NPC
* Creating a new NPC
* Editing NPC Stats
* Editing NPC Stats
Line 7: Line 7:
* Basic AI & Package Editing
* Basic AI & Package Editing


This tutorial will not delve into dialogue or quest creation.  Let's begin.
This tutorial will not delve into [[dialogue]] or [[quest]] creation.  Let's begin.


==Creating a new NPC==
==Creating a new NPC==
Line 15: Line 15:
</blockquote>
</blockquote>


It's often useful to use existing NPC's as templates when creating new ones.  For this example, let's look in our [[Object Window]] under NPCs and select '''"BanditBossFemale1"'''.  Double click the entry to open her properties tab.
It's often useful to use existing NPCs as templates when creating new ones.  For this example, let's look in our [[Object Window]] under NPCs and select '''"BanditBossFemale1"'''.  Double click the entry to open her properties tab.


'''Important:''' Before doing anything, change her ID to something unique.  This way we avoid accidentally saving our changes to the existing NPC.  When you hit 'OK' after changing the ID, you'll be prompted to either rename the existing object or create a new one.
'''Important:''' Before doing anything, change her ID to something unique.  This way we avoid accidentally saving our changes to the existing NPC.  When you hit 'OK' after changing the ID, you'll be prompted to either rename the existing object or create a new one.  Select 'Yes' to create a new Form.  If you select 'No' at this prompt, you will overwrite the existing NPC, rather than create your own unique version - meaning all the changes you apply here will be applied to the original, in-game NPC.


==Editing NPC Stats==
==Editing NPC Stats==
[[Image:Tut3_img2.jpg|thumb|right|The NPC properties window]]
[[Image:Tut3_img1.jpg|thumb|right|The NPC properties window]]


Let's briefly review the basic properties on the far left of this window.
Let's briefly review the basic properties on the far left of this window.
*'''ID''' Editor ID for this NPC.  Must be unique. Let's use ''CreepyCaveBoss''
*'''ID''' Editor ID for this NPC.  Must be unique. Let's use ''CreepyCaveBoss''
*'''Name''' NPC name as it will appear in-game.  We can leave this alone.
*'''Name''' NPC name as it will appear in-game.  We can leave this alone.
*'''Script''' Scripts can be attached to NPC's here.  Leave it blank for this one.
*'''Script''' Scripts can be attached to NPCs here.  Leave it blank for this one.
*'''Class''' BanditBoss is a special class.  To view the details of pre-made classes,  navigate to Character>Class... in your toolbar
*'''Class''' BanditBoss is a special class.  To view the details of pre-made classes,  navigate to Character>Class... in your toolbar
*'''Summonable''' Leave blank!
*'''Summonable''' Leave blank!
Line 34: Line 34:
*'''Combat Style''' Combat styles influence NPC choices during a fight.  For what we want this NPC to do, the default style will be just fine.
*'''Combat Style''' Combat styles influence NPC choices during a fight.  For what we want this NPC to do, the default style will be just fine.
*'''Death Item''' Used for special loot items that we don't want to show up until after an NPC is dead.  This is useful for items we don't want pick-pocketed and biological items (i.e. it's not feasible to remove an NPC's heart until said NPC has otherwise ceased to live)
*'''Death Item''' Used for special loot items that we don't want to show up until after an NPC is dead.  This is useful for items we don't want pick-pocketed and biological items (i.e. it's not feasible to remove an NPC's heart until said NPC has otherwise ceased to live)
*'''Essential''' Used for special NPC's and usually controlled via script.  Essential NPC's cannot be killed and are only knocked unconscious.
*'''Essential''' Used for special NPCs and usually controlled via script.  Essential NPCs cannot be killed and are only knocked unconscious.
*'''Respawn''' This NPC will respawn when the cell reloads if you check this - since this is an unnamed boss, we want to allow respawns.
*'''Respawn''' This NPC will respawn when the cell reloads if you check this - since this is an unnamed boss, we want to allow respawns.


You may notice that the values in the ''"Stats"'' tab are locked.  (except for personality)  This is because we have "''PC Level Offset''" checked.
You may notice that the values in the [[Stats Tab - NPC|Stats Tab]] are locked.  (except for personality)  This is because we have "''PC Level Offset''" checked.


The ''"Factions"'' tab is also important.  We'll leave the "''BanditFaction"'' in here, but if we needed to add any, we could do so from Character>Factions... in the toolbar.  Then drag the faction from the list on the left into the list of factions for the NPC.
The [[Factions Tab]] is also important.  We'll leave the "''BanditFaction"'' in here, but if we needed to add any, we could do so from Character>Factions... in the toolbar.  Then drag the faction from the list on the left into the list of factions for the NPC.  Additionally, you may set the faction rank simply by clicking once on the faction rank number in the NPC window, and typing in a new value.


==Editing NPC Appearance==
==Editing NPC Appearance==
[[Image:tut3_img2.jpg|thumb|right|Basic Facial Editing]]
[[Image:tut3_img2.jpg|border|center|Basic Facial Editing]]


[[Image:tut3_img3.jpg|Face Advanced Tab|thumb|right]]
[[Image:tut3_img3.jpg|Face Advanced Tab|thumb|right]]


Click the "'''Face'''" tab.  This tab gives us some basic controls in the form of age, complexion, and hair sliders.  Additionally we can change hair style, color, generate random facial features, and change eye color.   
Click the [[Face Tab]].  This tab gives us some basic controls in the form of age, complexion, and hair sliders.  Additionally we can change hair style, color, generate random facial features, and change eye color.   


The "Lock" radio buttons allow you to manually set sliders and then use the "'''generate''" button to randomize all ''other'' features of the face.
The "Lock" radio buttons allow you to manually set sliders and then use the "'''generate''" button to randomize all ''other'' features of the face.
Line 57: Line 57:
* press OK to preview results
* press OK to preview results


Usually it's enough to randomly generate a unique face and move on, especially for combatants like this boss NPC.  For more delicate tuning, however, we can select the "'''Face Advanced'''" tab.
Usually it's enough to randomly generate a unique face and move on, especially for combatants like this boss NPC.  For more delicate tuning, however, we can select the [[Face Advanced Tab]].


This tab opens a myriad of options and is even more robust than the in-game facial editing features.  We'll go over the basics here, but you'll learn the most by experimenting with the options available on your own.
This tab opens myriad options and is even more robust than the in-game facial editing features.  We'll go over the basics here, but you'll learn the most by experimenting with the options available on your own.
*'''Slider''' This slider will be used to edit the features you select.
*'''Slider''' This slider will be used to edit the features you select.
*'''Control Type''' Geometry mode will allow you to change the actual shape of the NPC facial structure, while texture will allow you to change the appearance of skin, facial hair, and cosmetics.  For this NPC I lowered her brows, making her look a bit meaner than the random face I had generated.
*'''Control Type''' Geometry mode will allow you to change the actual shape of the NPC facial structure, while texture will allow you to change the appearance of skin, facial hair, and cosmetics.  For this NPC I lowered her brows, making her look a bit meaner than the random face I had generated.
*'''Symmetry Type''' Usually you'll want to work in Symmetry mode.  However; Asymmetry mode (only available for geometry control) is very useful for creating interesting imperfections in character faces.  For instance, I've changed the ''Mouth - corners transverse shift'' on this NPC to -8.93, giving her the appearance of a smirk.  Just remember that it's best to be subtle, though when creating a combat-only NPC such as this, you can go a little bigger than you would with a speaking NPC.
*'''Symmetry Type''' Usually you'll want to work in Symmetry mode.  However; Asymmetry mode (only available for geometry control) is very useful for creating interesting imperfections in character faces.  For instance, I've changed the ''Mouth - corners transverse shift'' on this NPC to -8.93, giving her the appearance of a smirk.  Just remember that it's best to be subtle, though when creating a combat-only NPC such as this, you can go a little bigger than you would with a speaking NPC.
*'''Mouse Editing'''  You can use the right mouse button in the render window to make manual adjustments to the facial geometry.


==Editing NPC Inventory & Spells==
==Editing NPC Inventory & Spells==
Open the '''Inventory''' tab.  You can do this by using the small left/right arrow icons.  You'll notice a lot of items beginning with ''LL'' in this list.  This is the standard prefix for [[Leveled_Item|Leveled lists]] used when we created the game.  Since we used a template NPC we don't need to add anything to this - her inventory contains all the equipment she needs to provide the player with a challenging battle and rewarding spoils.  However; if you wanted this NPC to carry a special item (notes and keys are especially good examples), you would drag the item into this list from the [[Object Window]].
Open the [[Inventory Tab]].  You can do this by using the small left/right arrow icons.  You'll notice a lot of items beginning with ''LL'' in this list.  This is the standard prefix for [[Leveled_Item|Leveled lists]] used when we created the game.  Since we used a template NPC we don't need to add anything to this - her inventory contains all the equipment she needs to provide the player with a challenging battle and rewarding spoils.  However; if you wanted this NPC to carry a special item (notes and keys are especially good examples), you would drag the item into this list from the [[Object Window]].


Notice also that you can enter a hypothetical player level and press '''Preview Calculated Result'''.  This will open a pop-up window with a list of items that the editor chooses randomly from the list.  Running this test a few times is a good way to test your inventory without having to run the game.
Notice also that you can enter a hypothetical player level and press '''Preview Calculated Result'''.  This will open a pop-up window with a list of items that the editor chooses randomly from the list.  Running this test a few times is a good way to test your inventory without having to run the game.


Next, open the '''SpellList''' tab.  This list is empty, but let's give this boss some basic alteration ability, since she's got a little skill in that school of magic (I determined this from the stats tab).
Next, open the [[Spell_List_Tab|SpellList tab]].  This list is empty, but let's give this boss some basic alteration ability, since she's got a little skill in that school of magic (I determined this from the stats tab).


From the [[Object Window]], navigate to Magic>LeveledSpell, and drag the ''LL1AlterationMinorLvl100'' spell list into the NPC.  This will prepare her for battle with some alteration spells appropriate for the level of the player.
From the [[Object Window]], navigate to Magic>LeveledSpell, and drag the ''LL1AlterationMinorLvl100'' spell list into the NPC.  This will prepare her for battle with some alteration spells appropriate for the level of the player.
'''Video form (inventory and appearance):'''
http://www.youtube.com/watch?v=L-0XkRHwZRc


==Basic AI & Package Editing==
==Basic AI & Package Editing==
[[Image:tut3_img6.jpg|thumb|right|The Character Menu]]
[[Image:tut3_img4.gif|thumb|right|The Character Menu]]
 
[[Image:Tut3_img4.gif|thumb|right|The AI window]]


[[Image:tut3_img5.jpg|thumb|right]]
[[Image:Tut3_img6.jpg|thumb|right|The AI window]]
Finally, we want to give this NPC a little more than the standard behavior.  Press the "'''AI'''" button to open the AI window.
Finally, we want to give this NPC a little more than the standard behavior.  Press the [[AI Button]] to open the AI window.


We're only concerned with the AI Attributes and AI Package List portions of this window.  The other settings are for vendor and trainer NPCs.
We're only concerned with the AI Attributes and AI Package List portions of this window.  The other settings are for vendor and trainer NPCs.


We can leave the default AI Attributes from the original NPC we opened.  Aggression and confidence of 100 mean she will engage any enemy and never run away.  You can play with these values to get different behavior, such as lowering confidence to give the NPC a tendency to flee from battle.  Energy level and Responsibility tie into some other AI behaviors and can be left alone for this NPC.
We can leave the default AI Attributes from the original NPC we opened.  [[Aggression]] and [[confidence]] of 100 mean she will engage any enemy and never run away.  You can play with these values to get different behavior, such as lowering confidence to give the NPC a tendency to flee from battle.  Energy level and [[Responsibility]] tie into some other AI behaviors and can be left alone for this NPC.


Notice ''aaaCreatureInterior512''' and '''aaaCreatureExterior1500''' packages already in the package list.  '''aaa''' is a naming convention prefix we use to indicate basic packages which can be used on any NPC or creature.  We'll leave these two in, which will just allow the NPC to wander around and interact with the environment if no other packages are chosen.
Notice '''aaaCreatureInterior512''' and '''aaaCreatureExterior1500''' [[package]]s already in the package list.  '''aaa''' is a naming convention prefix we use to indicate basic packages which can be used on any NPC or creature.  We'll leave these two in, which will just allow the NPC to wander around and interact with the environment if no other packages are chosen.


In your toolbar, open ''Packages...''.  This is a complete list of packages created.  Select the following three and add them to the NPC's package list.
In your toolbar, open ''Packages...''.  This is a complete list of packages created.  Select the following three and add them to the NPC's package list.
Line 96: Line 98:


==Saving and Testing==
==Saving and Testing==
 
[[Image:tut3_img5.jpg|thumb|right|Changed Object ID Prompt]]
Again, be sure to have changed the ID before pressing okay, otherwise you'll overwrite the changes of the pre-existing NPC we used as our template.
Again, be sure to have changed the ID before pressing okay, otherwise you'll overwrite the changes of the pre-existing NPC we used as our template.


Now you're ready to drag the NPC into her chamber in CreepyCave02 (or any place you prefer).  It's a good idea to keep her near the bed for her sleep package, and you may want to put extra food in the room for her.
Now you're ready to drag the NPC into her chamber in CreepyCave02 (or any place you prefer).  It's a good idea to keep her near the bed for her sleep package, and you may want to put extra food in the room for her.


<blockquote>You can also add food to her inventory and set the quantity to -1, meaning she'll never run out of food.  This is helpful when NPC's searching for food in the environment begin to cause bad behavior.</blockquote>
 
<blockquote>You can also add food to her inventory and set the quantity to -1, meaning she'll never run out of food.  This is helpful when NPCs searching for food in the environment begin to cause bad behavior.</blockquote>


That's about it!  You can save this plugin and test it as normal.  Now you have a special boss just for your dungeon, and can tweak any of the settings we learned about to tailor your player experience.
That's about it!  You can save this plugin and test it as normal.  Now you have a special boss just for your dungeon, and can tweak any of the settings we learned about to tailor your player experience.
Line 107: Line 110:
[[Category:Getting Started]]
[[Category:Getting Started]]
[[Category:Tutorials]]
[[Category:Tutorials]]
[[Category:Actor_Tutorials]]
[[Category:Official_Tutorials]]