Manual:DIL Manual/Ending Notes

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:54, 14 November 2026 by Agent-mud (talk | contribs) (rewritten against the compiler and interpreter; examples compile)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Where to go next

The chapters cover the language; each keyword has its own page in the Full Listing. To go further:

Read working programs

The public zones in vme/zone/ of the DikuMUD3 repository are full of DIL that runs in the game. Search them for the function you need. function.zon holds common helpers (wander_zones, rescue, max and many more), quests.zon the quest functions every quest should use, and commands.zon, baseget.zon, basemove.zon and baselook.zon the player commands written in DIL. DIL Examples has a few short ones explained.

Try a program quickly

  • Compile with -m to rebuild only the zones that changed: cd vme/zone; ../bin/vmc -m -d ../etc/ -I../include/ *.zon. -s checks the syntax without writing anything. The server reads zones only when it starts, so restart it afterwards.
  • vme -w runs the server time-warped: it doesn't sleep between ticks, so heartbeats, pause and the mud clock pass as fast as the computer allows. On a running game, a god's wtimewarp <seconds> does the same for that many seconds of game time. A program with a 90-second heartbeat can then be tried in moments.
  • log() writes a line to vme/bin/vme.log, which is the quickest way to see what a program does. The same log has the errors of running programs: "had endless loop", "Type error in ...", "Template ... not found", "Cannot resolve external reference". It starts empty at every boot, so keep a copy before restarting if you need it.
  • In the game, a god's wstat <unit> functions lists the programs a unit runs, in their order, and wstat world dil how much time and how many instructions each template has used.

The DIL test zone

vme/zone/test.zon holds tests of DIL itself, run automatically. With vme/etc/zonelist.test as the zone list, a "lab director" program copies each test template onto a room in turn, from T0nn (the number TEST_MAXIMUM) down to T001; each test does its work, logs its result with logtest(), and sends "done" back with sendtoalldil(). When all have run, the server stops, with exit code 0 if every test passed. vme/bin/intergration_test.sh runs them time-warped. A new test is one more template T0nn and a higher TEST_MAXIMUM. DIL_UNIT_TESTING.md in the repository's top folder explains how to run them.

The zone manual

DIL lives in zone files. The Zone Manual explains the rest of them: rooms, objects, NPCs, resets, and the macros in vme/include; its DIL section chapter is about where DIL goes in a zone.

When the manual is wrong

The pages of this manual were checked against the compiler and the server. Where a page and the code still disagree, the code is right: the keywords are in vme/src/vmc/diltok.h, the grammar in vme/src/vmc/dilpar.y, the functions in vme/src/dilexp.cpp, the procedures and statements in vme/src/dilinst.cpp, and the fields in vme/src/dilfld.cpp. Please report such mistakes, and bugs in DIL itself, on GitHub.

See also