Difference between revisions of "Manual:Zone Manual/The NPC Section/Suggested NPC exercises"
Jump to navigation
Jump to search
(Created page with "=== Suggested NPC exercises === 1. Using the DIL function for team work found in (Link to npcdilfunc) create a guard that will help all other guards. 2. Using the DIL func...") |
(checked against the current code (wiki review 2026-11-15)) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
=== Suggested NPC exercises === | === Suggested NPC exercises === | ||
| − | + | The DIL functions named here are described, with their arguments, in | |
| + | [[Manual:Zone Manual/The NPC Section/DIL functions for NPCs|DIL functions for NPCs]]. | ||
| + | Compile each exercise, then load the NPCs in the game and try them out. | ||
| − | + | # Using <code>teamwork@function</code>, create a guard that helps all the other guards of your zone when they are attacked. | |
| − | + | # Add <code>rescue@function</code> to the guard from exercise 1, so that it rescues the other guards as well as helping them. | |
| − | + | # Using <code>shopkeepernew@function</code> (with <code>give_shopfix@function</code>, which every shopkeeper needs), make a shopkeeper who sells two kinds of food, makes five of each at a time, and buys only food. Be creative with the other arguments. | |
| + | # Turn the shopkeeper from exercise 3 into a wandering salesman. (Look at the <code>shophome</code> argument.) | ||
| + | # Using <code>aggressive@function</code>, create a dwarf that attacks any orc (<code>RACE_ORC</code>) that walks into the room. | ||
| + | # Build the same NPC twice, once field by field with <code>MSET_ABILITY</code>, <code>MSET_WEAPON</code> and <code>MSET_SPELL</code>, and once from a template in <code>macros.h</code>. Compare the two with <code>vmc -v</code>. | ||
| − | + | <div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/The_NPC_Section/Dragon_station_with_rooms_and_NPCs|Previous: Dragon station with rooms and NPCs]]</div> | |
| − | + | <div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/The_Objects_Section|Next: The Objects Section]]</div> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
Latest revision as of 06:20, 15 November 2026
Suggested NPC exercises
The DIL functions named here are described, with their arguments, in DIL functions for NPCs. Compile each exercise, then load the NPCs in the game and try them out.
- Using
teamwork@function, create a guard that helps all the other guards of your zone when they are attacked. - Add
rescue@functionto the guard from exercise 1, so that it rescues the other guards as well as helping them. - Using
shopkeepernew@function(withgive_shopfix@function, which every shopkeeper needs), make a shopkeeper who sells two kinds of food, makes five of each at a time, and buys only food. Be creative with the other arguments. - Turn the shopkeeper from exercise 3 into a wandering salesman. (Look at the
shophomeargument.) - Using
aggressive@function, create a dwarf that attacks any orc (RACE_ORC) that walks into the room. - Build the same NPC twice, once field by field with
MSET_ABILITY,MSET_WEAPONandMSET_SPELL, and once from a template inmacros.h. Compare the two withvmc -v.