-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_syntax.txt
195 lines (143 loc) · 6.63 KB
/
script_syntax.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
########################################################################
######################## SECTION 1: MANUAL ###########################
########################################################################
Conventions
===========
Whenever you specify a FILE NAME, leave the file extension out! The
file "antika.bmp" becomes "antika". "npc3antikatown2.sc" becomes
"npc3antikatown2".
When using MAPS, keep in mind that the MAP FILE NAME mustn't contain the
file extension ".map" as well. ".ani" files are loaded automatically and
they have to have the same name as the according map. This is a very
important convention, i.e. the program will crash when there's no ".ani"
file for a ".map" file.
Oh, and whenever I use QUOTATION MARKS in an argument's description,
leave them out in the script! They're just there to separate the values
from description text.
Any script must contain a blank line in the end because BlitzBasic's
ReadLine$() method didn't work when there's no new-line-character at
the supposed end, which means the last line will be ignored when you
forget to insert a blank line. Useful for one-line-comments.
Animation-Files
===============
For each map there's an ANIMATION FILE. For "antikatown.map" there is
a file called "antikatown.ani". This HAS TO be the case, if the .ani
file is called differently, the program will crash because it can't
find the correct file. Probably I'll implement a check so the program
doesn't crash anymore. Either way, You won't be able to chose .ani
files manually -- they exist the way I designed the game or you're
screwed :)
The syntax is fairly simple and depends on the design of the tilesets
a lot! Each line represents an animated tile with 4 parameters:
X Y START END
X and Y are the tile-coordinates on the map. START and END define a
RANGE IN THE TILESET -- so if START=111 and END=118 (like I use them in
the town) the animation will iterate frames 111 to 118 in the tileset.
Remember to count from 0, not from 1.
How to implement map-teleporter
===============================
This one was screwed up a lot. More about this later.
How to implement NPCs
=====================
Place static NPCs in the script which executes upon map initialisation:
active? x y movement dir offset ??? ??? timer
frameset
x X-coordinate on map in tiles
y Y-coordinate on map in tiles
movement 1 := walk -> movement script
2 := stand still
dir 0 := down
1 := up
2 := left
3 := right
offset I think this is an y-offset in pixels
timer Milliseconds between animation ticks, translates to
movement speed
An example line:
1 17 18 1 0 4 1 1 1100
npckid1.bmp
This NPCs frameset is loaded from "npckid1" (actually: ".png", but
the old Win32 executable relies on ".bmp" here).
1 NPC is active
17 X coordinate
18 Y coordinate
1 walking (should load a file for this)
0 Facing south
4 Y-Offset (which is currently implemented by default)
1 ???
1 ???
1100 Speed of movement (actually this should read "delay")
Use a file called "npc#mapname.sc" to do something I don't understand yet.
It SHOULD control an NPCs movement and contain script files to load
when you want to talk to her. But then there's all that byte gibberish
of which I can't imagine any meaningful purpose...
########################################################################
################### SECTION 2: SCRIPT SYNTAX #########################
########################################################################
BLOCKKEYBOARD,value
------------------------------------------------------------------------
Blocks all user's input. Value might indicate a direction or just a
status (on/off).
value I'm not sure yet ...
CHECKFLAG,flagno,comp,val,tag
------------------------------------------------------------------------
Checks a "flag" against a value. On success a GOTO will be executed,
on failure the parser will continue in the script.
flagno Number of flag in global game flag array.
comp MT := >
LT := <
ST := == (I think I thought of "same than" x_x)
val Value to compare against.
tag GOTO-Tag to jump if check returns true.
END
------------------------------------------------------------------------
Ends script execution right here. Usually, the player re-gains control
over his character.
FLAG,flagno,value
------------------------------------------------------------------------
Sets a flag to a certain value.
flagno Number of the flag to be changed.
value Numeric value to set the flag to.
KOLLIDE,x,y,value
------------------------------------------------------------------------
Here, the coordinates' syntax differs from PLAYERPOS. I don't know
why, though. Probably I was confused when I implemented this command.
x X-coordinate on the map to make a collision on
y Y-coordinate to block
value "1" or "0" represents "block" and "block off" accordingly.
MAP,tileset,mapname
------------------------------------------------------------------------
Loads a map.
tileset The filename of a tileset.
mapname The filename of a map. Scripts and .ani files should be
titled accordingly, so this is a rather important part.
MOVEPLAYER,dir
------------------------------------------------------------------------
Moves the player character in a certain direction.
dir 1 := down
2 := right
PLAYERPOS,x y,dir
------------------------------------------------------------------------
Warps a player to a certain position. This should only be used right
before loading a map and not during the game.
x y A pair of coordinates. Really don't use a comma, just
separate the two values with a space. X=12, Y=67 hence
becomes "12 67" (w/o quotation marks, of course).
TAG,tagname
------------------------------------------------------------------------
Defines a tag to which a GOTO or CHECKFLAG may jump in the script.
On loading, the tags shall be parsed from the script and stored in
an array/hash.
tagname Any alphanumerical value w/o special chars to identify
the line to which the parser shall jump.
TALK,name
"line1"
"line2"
"line3"
"line4"
------------------------------------------------------------------------
Displays a box of dialogue which MUST contain 4 Lines (use " " for
empty lines!). The name of who speaks will be displayed on top of
the text (it's like a 5th line).
This time, you HAVE TO use the quotation marks at beginning and end
of each line.