Difference between revisions of "NPC (Programming)"

From Hellmoo Wiki Archive
Jump to navigation Jump to search
imported>Marvin
m
imported>Marvin
m
Line 19: Line 19:
'''.conversation''' = LIST text.  This is a list of strings of the form:  word1,word2|Here's what I say about that.  If the NPC hears any of the listed words in a directed-say to her, she will say the given text back to the person who said it.  By including words in these lists from previous spoken text, you can create a simple simulated conversation.  Some words you should probably respond to, if you define this property: name, hi, hello, job.  NOTE: when changing this property, you must '@compile <my NPC>' to make the changes take effect.
'''.conversation''' = LIST text.  This is a list of strings of the form:  word1,word2|Here's what I say about that.  If the NPC hears any of the listed words in a directed-say to her, she will say the given text back to the person who said it.  By including words in these lists from previous spoken text, you can create a simple simulated conversation.  Some words you should probably respond to, if you define this property: name, hi, hello, job.  NOTE: when changing this property, you must '@compile <my NPC>' to make the changes take effect.


You can find more functionality on '''$monster''' ([[ProgMonster]]).
You can find more functionality on '''[[Monster (Programming)|$monster]]'''.
    
    
[[Category:Programming]]
[[Category:Programming]]

Revision as of 07:54, 2 January 2009

$npc (#138)

The NPC is the basic object parent for non-player-creatures. It includes a fair bit of behavior which you can customize by setting various properties and messages on it. Let's run it down by behavior category:

Wandering

.wander_chance = INT (0-100). This is a chance, on each suggest_next_action call (see ProgActionsNPC), that the NPC will decide to wander.

.public_wander_only = INT (0-1). If set to 1, the NPC will only wander into rooms which have .public == 1.

Fighting

.wields_weapons = INT (0-1). If set to 1, the NPC will wield her best weapon, if she's carrying any.

.bravery = INT (0-100+). The higher this is, the less likely the NPC is to run from combat when wounded. At 0 the NPC is fairly cautious; at 100, she will fight to the death against all but the most terrifying foes.

Talking

.conversation = LIST text. This is a list of strings of the form: word1,word2|Here's what I say about that. If the NPC hears any of the listed words in a directed-say to her, she will say the given text back to the person who said it. By including words in these lists from previous spoken text, you can create a simple simulated conversation. Some words you should probably respond to, if you define this property: name, hi, hello, job. NOTE: when changing this property, you must '@compile <my NPC>' to make the changes take effect.

You can find more functionality on $monster.