/advtrains_train_steam/sounds/

'>
aboutsummaryrefslogtreecommitdiff
path: root/advtrains/api_doc.txt
blob: 5668ba32b6881893e83906c92d4ff538b0046c81 (plain)
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
196
197
198
199
200
201
202
203
204
205
206
Advanced Trains [advtrains] API documentation
--------
To use the API, mods must depend on 'advtrains'.
All boolean values in definition tables default to 'false' and can be omitted.
### Wagons
Wagons are registered using the function

advtrains.register_wagon(name, prototype, description, inventory_image)
- 'name' is the internal name of the wagon. It should follow the mod naming convention, however, this is not enforced.
	For compatibility reasons, if a mod name is omitted, the wagon will be registered in the advtrains: namespace.
	Example: A wagon with name="engine_tgv" will be registered as "advtrains:engine_tgv".
	!IMPORTANT! You must not append a ":" at the start of the name, even if you want to bypass the mod naming convention check. This is because internally the register_wagon function
	appends a ":" automatically.
- 'prototype' is the lua entity prototype. The regular definition keys for luaentites apply. Additional required and optional properties see below. DO NOT define 'on_step', 'on_activate', 'on_punch', 'on_rightclick' and 'get_staticdata' since these will be overridden. Use 'custom_*' instead.
- 'description' is the description of the inventory item that is used to place the wagon.
- 'inventory_image' is the inventory image of said item.

# Wagon prototype properties
{
	... all regular luaentity properties (mesh, textures, collisionbox a.s.o)...
	drives_on = {default=true},
	^- used to define the tracktypes (see below) that wagon can drive on. The tracktype identifiers are given as keys, similar to privileges)
	max_speed = 10,
	^- optional, default 10: defines the maximum speed this wagon can drive. The maximum speed of a train is determined by the wagon with the lowest max_speed value.
	seats = {
	^- contains zero or more seat definitions. A seat is a place where a player can be attached when getting on a wagon.
		{
			name="Left front window",
			^- display name of this seat
			attach_offset={x=0, y=10, z=0},
			^- this value is passed to 'set_attach'
			view_offset={x=0, y=6, z=0},
			^- player:set_eye_offset is called with this parameter.