NPC Scripting Language

Everything about Illarion that fits nowhere else. / Alles über Illarion was inhaltlich in kein anderes Board passt.

Moderator: Gamemasters

User avatar
Estralis Seborian
Posts: 12308
Joined: Wed Nov 10, 2004 9:14 pm
Location: Sir Postalot
Contact:

Post by Estralis Seborian »

I've compiled some guidelines how you can create a good NPC that helps the game. Note that these guidelines aren't carved in stone, but they should give you an idea what to avoid and what is good.
  • All NPCs should react on "help" with OOC informations on how to use them. I use informs for this information, like: [Game help] This NPC is the butcher Bruno. Keyphrases: Blab, bleh, blubb.
  • Use as many (simple) triggers as possible, the more words the NPC reacts on, the better.
  • Avoid misleading triggers that are included in other words or random speech, like "hi", "no", "ja"
  • Do not use sentences as triggers, like "I want to have item %number". This is just annoying.
  • Do not make too strict use of the language checks; a german player could speak english or vice versa! Use language check only for phrases that exist in both languages, like "Mission", "Quest", "Hallo". There is nothing more frustrating as when player A and B say the same to a NPC and only B gets a reaction because of his language settings.
  • If NPC 1 refers to NPC 2, NPC 2 should at least react on the name of NPC 1
  • Let NPCs react on aspects of the game world, like gods, towns, historic triggers, locations,...
  • Add as many cycletexts as possible or none at all. If the same three cycletexts are repeated over and over again, nobody will enjoy the presence of a NPC
  • Give each NPC a unique profile. That includes a connection to the game world, maybe a job, and a distinct way of speaking.
  • If you use triggers for important aspects (quests etc), these triggers either have to be present in the help text or need to be included in responses of the NPC. Nobody wants to guess triggers.
  • Keep in mind that the last triggers are only reached in the script if no trigger above of it is hit. So, if you use ".+" at the beginning of your script, all triggers below are never reached.
  • Make broad use of informs to display OOC infos, e.g. when the player accepted a quest or solved it. Give informations on rewards, so that the player is not surprised over an item that suddenly appeared in his inventory.
  • If you give out rewards, do not hesitate to raise skills, give money and items. Be generous!
  • Do not use "technical" numbers and expressions. So, instead of "bring me 6x gold ring and I give you 378cp" write "Bring me half a dozen golden rings and I award you with fourhundred copper coins."
  • Always give your NPC a background in the game world; every NPC has opinions, dislikes and flaws. Spend some time into making up the character of the NPC, just like you do when creating a player character
  • All NPCs should have some kind of job or profile; no NPC gives out quest rewards without a motivation!
  • Do not make NPCs too specific; NPCs should not be restricted to certain guilds, just imagine this guild is no more one day - you wasted time to create a NPC from which just a couple of players benefited
User avatar
Estralis Seborian
Posts: 12308
Joined: Wed Nov 10, 2004 9:14 pm
Location: Sir Postalot
Contact:

Post by Estralis Seborian »

One question on expr and chance: Will this work?

Code: Select all

".+",chance(expr(1000/95)),queststatus=2,english->"ENGLISH.",queststatus=1,item(390,1,333,0),inform ( [Quest solved] You are awarded a bottle of lamp oil. )
".+",chance(expr(1000/95)),queststatus=2->"GERMAN.",queststatus=1,item(390,1,333,0),inform ( [Quest gelöst] Du erhältst eine Flasche Lampenöl. )
User avatar
Wind
Posts: 4
Joined: Sun Apr 18, 2010 6:59 pm

Post by Wind »

Hey,
Couple questions:

1) Is it possible to have NPCs walk a set path, like patrolling around an area or going from one location to another (given a trigger or not)?
2) Is it possible to have a NPC follow a character (like what mules do)?

3) If NPCs can't cast spells, is there a way to make the spell graphic/sound combo show up in a specific location or area around the NPC (either on trigger or as an ambient effect around the NPC)?

4) Is it possible to make an NPC invisible?
5) Is it possible to make monsters on the field (preferably on trigger)?
(4 & 5 = if things went sour, the NPC could set to invisible and a bandit or somthin could be made between them and the character :wink: )

6) I read through the thread, but I can't find any mention of how to make NPCs only talk in one+ race languages. Did I miss it?
6 Corollary) Is it possible to make them only understand specific race languages?

Thanks
User avatar
Estralis Seborian
Posts: 12308
Joined: Wed Nov 10, 2004 9:14 pm
Location: Sir Postalot
Contact:

Post by Estralis Seborian »

A couple of answers ;-):

1. Yes, but not with the simple scripting language
2. Yes, but not with the simple scripting language
3. NPCs can 'cast'. SFX and GFX can be invoked, but not with the simple scripting language
4. Yes, but not with the simple scripting language
5. Yes, but not with the simple scripting language
4. & 5.: 'Replacing' an NPC with a monster is considered a dirty hack and is not encouraged
6. NPCs can be adjusted in a way that they understand only certain languages. Likewise, they can be tuned to speak in a certain language... but not with the simple scripting language

The answer is, basically, that all this is possible with Lua. Lua is a mighty and powerful scripting language. However, one should keep in mind that scripting things like "follow a character" is not trivial and the simple language currently offers tons of possibilities that are not used.
Post Reply