PSWC: Defining an NPC
main
This is where you define the basics of any NPC you have created. Most of this page is self evident, though you may find something useful in the comments below, especially the section on Specific Knowledge.
Type an atmospheric textual description in here. Always try to make NPC descriptions vivid and colourful so that they stick in players' minds and bring the game world to life for them.
Remember that the info you type here may be used to give subtle clues to players about what is not immediately obvious from what they see or what the NPC says without further exploration.
I dont know the exact details of how this aspect of the page works yet. My guess is that you can previously define another NPC and then set this value to the ID of that NPC's record in the characters table and then this NPC will conform to the definition of that NPC to some extent. IE that, having typed in a Master NPC ID other than this NPC's own ID, that this NPC will then draw the remainder of its data from the Master NPC.
Can I suggest that all NPC's which are defined to be used as templates for other NPC's should be given the surname NPC_Template and that, instead of a text entry box, a selector is displayed showing an entry Use This Definition as the default and all NPC_Templates as the alternatives.
This defines what area of the world the NPC starts in.
This would be better as a selector that presented a choice of the available sectors rather than as a text entry box.
Here, you type in the coordinates in the above sector where you want the NPC to appear.
You can get accurate coordinates by starting up the game client, walking to the place where you want to put your NPC, turning to face the appropriate direction and then typing /pos in the chat panel.
The entire NPC placement process is a bit difficult to use, in the sense that typing in sector and location details is slow and cumbersome. It would be really nice to see admin or quest admin commands that let quest designers place new NPC's from inside the game in the sector and at the coordinates where admin character is standing.
create and spawn a new npc actor where the quest admin character is standing
move and/or spawn the named NPC to where the admin character is standing
Hrmm ;) I guess this might be where you decide what race and gender the NPC is. Remember that not all races have got graphics yet, so if you choose one and see a dwarf or something instead of what you expect, it is not a bug.
You currently have to type in stats for your NPC and, even if the console took the stats from the race_info table, the stats defined there are incorrect in the current CVS.
It would be nice if there was a button to populate these boxes with correct start out stats for each race and if the same happened when the Race & Gender selector was changed.
This is the max HP your NPC starts out with. It is not the actual HP they start with, since they start at zero hp and regenerate the same way a player character does. You can estimate base HP as about (3 * (STR+END)) / 4
If you want your NPC to start out with full HP you can manually insert their HP into the mod_hitpoints filed in the planeshift.characters table.
If you let me know the formula for calculating HP, I can write a bit of javascript to calculate this.
Currently, NPC's are not spawned at max HP.
The same observations apply as were made above. Estimate Base Mana as the average of INT, WIL, CHA. (?)
Set to Yes for the majority of NPC characters and to No for the majority of NPC monsters.
How much experience is this NPC worth if you kill it? Estimate the average value of the Stats plus the average value of the skills.
If you set this to 1 the NPC will be loaded when the server spawn command is executed.
Dev Darkmoon says: If you set this to 1 (or greater) the NPC will be loaded with the appropriate rule when the server spawn command is executed. There is more than 1 spawn rule, though it isn't apparent from SC.
Don't forget to click the Save button at the bottom of the page!
skills
Set this selector to the name of the skill that you want a character to have.
Type in a number for how good the character already is at this skill.
Type in a number to reflect how many Knowledge Points (the yellow part of the bar on the in game skills display) the NPC has.
Type how many Practice Points (the green part of the bar) that the NPC has.
Click the button to add the skill to the character.
After you add skills they will appear in the list at the top of the page. Use the delete button beside any skill to remove that skill from the NPC.
traits
This option allows you to add different looks to your NPC. By editing one of the *.bmp files in ./art/models.zip or by creating your own texture to be applied to the model, and adding the name of the file to the planeshift.traits table, you should be able to select the trait from this selector and use it to change how your NPC looks.
EG Open klyrosm_head.bmp from the models.zip, add a tattoo or some other ornamentation or difference in colouring, save the file with a different name, add the file details to the traits table and then Add that trait to your NPC.
Dev Darkmoon says: Traits section is unused atm, but will come into play with more 2D assets like you describe.
Would be nice to know what are valid settings for the contents of the fields in the planeshift.traits table.
Would be nice if predefined traits were available that could be applied to underlying textures to implement things like scars, tattoos, circlets, earrings and so on.
knowledge areas
This selector lists all previously defined knowledge areas. See general info about knowledge areas for more info on what a Knowledge Area is.
This setting lets you define the order of evaluation of the various knowledge areas that an NPC has. An NPC's Specific Knowledge (see below) is evaluated first and the KA's that you add here are then evaluated in order of the priorities that you assign to them.
items
Select an item that you want your NPC to have in his inventory
Type in how many of that item you want the NPC to have. Note that some items are stackable and some items are not.
If you try to put 10 non stackable items in one slot, you may find that your NPC does not get spawned by the game server, that it is spawned with only one of the items or that it is not spwawned at all. I dont know exactly what happens in that situation.
Dev Darkmoon says: Assigning multiple non-stackable items to NPC inventory results in only the first assigned is displayed. All others are unavailable until they are assigned to other slots.
Add the item to the character
After you Add your item(s) to the NPC they will appear in the list at the top of the page. The only part of the listing that needs any comment is the Change Location button. You should make a point of updating the location for each item you add after you add it. Again, trying to put two or more items that you have added into the same slot may cause problems.
trainer
This page lets you make your NPC able to train player characters in the skills that you select. Select one of the skills from the selector that you want your NPC to be able to train.
If this is not zero, then the people that your character trains must already have at least this level of skill before your NPC will train them.
Your NPC cannot train anyone to a skill rank higher than the number you type in here.
The number you type in here should dictate that a player character must have at least as many points in your NPC's faction before they will be able to train with him/her.
I do not know how you allocate your NPC to a faction, ie I do not know how you would create an NPC in Ojaheva(?) and affiliate him with a faction like The Ojaheva Merchant;s Guild.
It may be possible to have a unique faction for that particular NPC so that you could have a script like <faction name="MyNPCname" value="1" /> which explicitly adds faction with a particular NPC and which is then automatically tested if you try to get training from that NPC. At time of writing, I have not yet tried that.
Dev Darkmoon says: Attitude relates to faction (I assume that means that they are the same). Some dialog will have attitudes for different responses based on faction, others will be simple stock responses irregardless of faction.
Some dialog will have attitudes for different responses based on faction, others will be simple stock responses regardless of faction. (That means that there will be a faction check and then an attitude check after the faction has been checked).
merchant
Ingame items are divided into various categories and merchants then deal in those categories. If you want your NPOC to be able to buy and sell things then select the type(s) of item that you wantit to be able to deal in and Add them.
specific knowledge
This is the most complex part of defining your NPC. It allows you to define trigger phrases that player characters can type into the chat panel and what sort of responses they might get in return.
The three boxes at the top of the page let you type in up to three different trigger phrases at one time. For a player character to get a response when they talk to your NPC, the player must type exactly what you type in as the trigger phrase.
This is a cumbersome way of implementing dialog. Real people do not all think alike or express themselves in the same way. Forcing them to type a rigidly defined phrase in order to get a response from an NPC is not going to be very flexible when trying to design quests.
eg if my NPC said something like "Will you bring me ten rat hides?", one player might type "yes", another "yes, I will bring you them", and another "I will bring ten rat hides".
It would be much better if trigger phrases, by default did not have to be exactly matched but could be partially matched or exactly matched at the choice of the quest designer. For example, in the above example it would be nice to be able to type any one as a trigger phrase ...
At the bottom of the page there are three groups of boxes labelled Attitude 1..3. These boxes let you define that an NPC will react to a trigger phrase when the NPC's attitude to the player character is between the minumum and maximum values that you type in.
I do not know if the Attitude ranges that are defined here and the Min Faction rating that is defined in the section on training are different or the same.
Once you have set the parameters, click the Add Trigger button at the bottom of the page. If you have typed in more than one trigger phrase, then each of the phrases that you have typed in will be created with the ability for you to define how your NPC responds to that trigger when your NPC's attitude toward the player character that it is dealing with falls into one of the attitude ranges that you have defined.
I do not know what happens if you define attitude ranges like 0..50 and 75..125 that do not join or overlap. This may or may not cause a problem for the game server.
After you click the Add Trigger button, you will see one entry for each trigger appear in the menu on the left. When you click one of these you will see the following submenu.
Do not type anything in the Add Phrase box or click the Add button. I suspect that this is supposed to let you add new phrases at the same level with the same attiutude ranges, but it actually breaks the database or, at least, it breaks the pages here that let you define your NPC.
Using the Delete this trigger button appears to work okay.
Below this option in the left hand menu, you will see two further options ...
This part lets you set general options for the trigger as follows ...
Here you can change the value of the trigger phrase and click Save to update the value of the trigger. For example, if you mispelled your trigger phrase, you could use this to correct the spelling.
When you click this button, you transform the trigger from a text trigger to an action that is triggered when a player character gives your NPC what you specify in the left hand menu option phrase !EXCHANGE SCRIPT!.
You can specify any combination of items to be given to your NPC in order to trigger a response. If you include an Item or a Quest Item as what your NPC must get to activate the trigger, then you must also type a number greater than zero into the Count box.
To define how your NPC actually reacts to what a player character has typed or offered, depending on the NPC's attitude to the player, click this link in the left hand menu.
On the right hand side you will see a page that is exactly the same as the page that you got when you clicked the specific knowledge link at the top of these submenus.
I am guessing that this page lets you create more triggers that require that the trigger you are currently defining has already been typed or that the items needed to activate it have already been given.
If you wanted to create a trigger like that, you would do it at this part of the trigger definition.
This link will let you define what the NPC actually says or does when the player says or does what activates the trigger.
These five boxes let you type in from zero to five lines of text that the NPC might say when it's attitude to the player character who has activated the trigger is in the range XX YY.
Click this to save what you have typed in or to save any alterations that you have made. Remember to do this! It is frustrating to have to type it in all over again if you forget.
The bottom half of the page lets you tell your NPC to do certain things when the player character activates the trigger ...
Select this option and click add action to script and your NPC will say one of the things that you have type into the boxes above.
Select this option and click add action to script and your NPC will will visually greet your character by waving or bowing or doing whatever that race and gender does when they meet someone.
Note that you can select one action and add it and then select another action and add it as well. Your NPC can do several things in response to one trigger.
Train the player up one knowledge point in a skill that you have selected from the use only for train selector.
This action will let you add the quest whose name you type into the quest name box to the player character's quest journal.
You should make sure that you have already created the quest before you use this option. Doing so may not be absolutely necessary, but it probably is so do it that way anyway. See the section on quests for more info about this.
The quest name box would probably be better off as a selector to ensure that people do not mispell quest names or type in the names of quests that do not exist.
An alternative/additional improvement might be to warn people when a quest was not defined and offer them the chance to create it at the same time.
As above, type in the name of the quest and then click the add this action button, in this case to finalise the quest.
Type the ID of the item that you want your NPC to give to the player character into the items id given box before you add this to the action script.
You can find out the ID of the item you want to give by looking it up in the table planeshift.item_stats.
These should be self explanatory.