data dirs renamed
[k8-i-v-a-n.git] / Doc / script_course / lecture3.html
blob7fa893578619efb5ce9457ce3fd92af8a387850f
1 <html>
2 <head>
3 <title>IVAN script lecture 3</title>
4 </head>
5 <body>
7 <h2>holybanana's IVAN script course, lecture III</h2>
8 <h4>Overview of the structure of IVAN and its script and graphics files</h4>
10 <p>The <i>world map</i> of IVAN is hard-coded. In the world map there are
11 <i>dungeons</i>, currently Attnam, New Attnam, UT and GC. In dungeons there
12 is a number of <i>levels</i>. Levels consist of <i>squares</i>. Some, but not all squares
13 belong to a <i>room</i>. The <i>entities</i> which
14 can occur in a square of a level of IVAN include <i>objects</i> and <i>characters</i>.
15 Objects are things that can be made of <i>materials</i>. <i>Terrains</i> and <i>items</i>
16 are objects. There is always a <i>ground terrain</i> in a square. There may
17 also be an <i>over terrain</i> over it, for instance a wall or a throne.
18 Characters are made up from special items called <i>bodyparts</i>.
19 Every character belongs to a <i>team</i>.
20 The content of dungeons and levels and the properties of the aforementioned
21 entities are mostly defined by the script. There are special entities, for
22 instance webs, which are hard-coded, and many entities have special
23 properties which are too difficult to be defined by the simple language
24 of the script, so they are hard-coded, too.</p>
26 <p>We will now fully list the things that can be defined in the script and the
27 files where their data is located.</p>
29 <p>dungeons: dungeon.dat<br>
30 levels: dungeon.dat<br>
31 rooms: dungeon.dat<br>
32 squares: dungeon.dat<br>
33 teams: dungeon.dat<br>
34 materials: material.dat<br>
35 ground terrains: glterra.dat<br>
36 over terrains: olterra.dat<br>
37 items: item.dat<br>
38 characters: char.dat</p>
40 <p>The names glterra.dat and olterra.dat come from the class names ground level terrain
41 and over level terrain. In the game there are also ground world map terrains
42 and over world map terrains, but their properties cannot be defined in the script.</p>
44 <p>Note that characters are divided further to <i>humanoids</i>
45 and <i>nonhumanoids</i>. The former have seven bodyparts, the latter
46 only one, the torso. You currently have to look at the source code
47 to know which characters are humanoids and which nonhumanoids, if you
48 don't remember it from the game. We apologize for the inconvenience
49 and will correct this.</p>
51 <p>There is also define.dat which contains definitions of the form
52 #define DEFINITION expression. If DEFINITION is encountered when parsing
53 the script, the value of expression is substituted for it. So
54 since the file contains a line #define WAR_LADY 3 every string WAR_LADY in the
55 script is really just number 3, the config number of mistress warladies.
56 The syntax is chosen so that the same definition can be used in
57 the source code, too. In the file Main/Include/confdef.h there is
58 the same line #define WAR_LADY 3, and this is a valid C++ macro definition.
59 So WAR_LADY may be used both in the script and the code and has the
60 same meaning.</p>
62 <p>In <a href="lecture1.html">lecture I</a> we noted that the graphics
63 of ground terrains must be chosen from GLTerra.pcx. We now list
64 the graphics files associated with each type of entities.</p>
66 <p>ground terrains: GLTerra.pcx<br>
67 over terrains: OLTerra.pcx<br>
68 items: Item.pcx<br>
69 humanoids: Humanoid.pcx<br>
70 nonhumanoids: Char.pcx</p>
72 <p>That is, the BitmapPos database value of ground terrains, over
73 terrains and items means the location of the upper left corner
74 of the 16x16 or 32x32 picture of the entity in the respective file above.
75 For humanoids and nonhumanoids the same holds for the database
76 values TorsoBitmapPos, HeadBitmapPos, etc. More information about
77 the graphics files may be found in the
78 <a href="http://ivan.cvs.sourceforge.net/*checkout*/ivan/ivan/Doc/Data/Graphics.txt?revision=1.2">graphics documentation</a>.</p>
80 <p>Exercise: randomly generated orc slaughterers may carry potions
81 of troll blood. Find out in which file this detail is defined. Present the line.
82 Then find out where it is defined that the orc general and
83 the orc officers in the orc room of GC have some more expensive potions
84 in their inventory. Present the lines.</p>
86 <hr>
88 <p>
89 <a href="lecture2.html">Previous lecture</a>
90 <a href="lecture4.html">Next lecture</a>
91 <a href="index.html">Back to main</a>
92 </p>
94 <hr>
96 <p>Last modified August 30 2006.</p>
98 </body>
99 </html>