Sign in
mod

Rails and carts

by Potluck · version 1 · Checked for all ages

Lay rails and ride a cart along them. Rails join the rails beside them by themselves, bending around corners and sloping up a block. Powered rails beside live wire, a pulled lever or a lit inverter speed a cart up, and without power they slow it to a stop. Make rails, powered rails and carts at a workbench.

1name = "Rails and carts"
2by = "Potluck"
3kind = "mod"
4about = "Lay rails and ride a cart along them. Rails join the rails beside them by themselves, bending around corners and sloping up a block. Powered rails beside live wire, a pulled lever or a lit inverter speed a cart up, and without power they slow it to a stop. Make rails, powered rails and carts at a workbench."
5main = "main.luau"
6version = 1
7license = "CC-BY-4.0"
8
9[needs]
10world = "0.23"
11tweak = "0.1"
12store = "0.1"
13input = "0.1"
14ui = "0.2"
15sound = "0.2"
16
17# Buttons while riding a cart
18[actions.push]
19name = "Push off"
20pad = "A"
21keys = "Space"
22
23[actions.brake]
24name = "Brake"
25pad = "X"
26keys = "F"
27
28[sounds.rumble]
29caption = "A cart rumbles"
30wave = "noise"
31pitch = 260
32length = 0.5
33attack = 0.05
34lowpass = 500
35
36[sounds.clack]
37caption = "Wheels clack"
38wave = "square"
39pitch = [160, 120]
40length = 0.08
41attack = 0.003
42lowpass = 1200
43
44# The rails, drawn running north to south: a bed of gravel and sleepers a
45# little above the ground. A bend joins the south side to the east, and a
46# slope climbs a block toward the north, in steps.
47
48[blocks.rail]
49name = "Rail"
50kind = "hard"
51hardness = 0.7
52solid = false
53turns = true
54boxes = [[0, 0, 0, 16, 2, 16]]
55colors = { g = "#5b5651", h = "#4a4541", k = "#696460", w = "#7a5634", x = "#5e4127", r = "#c3c8ce", s = "#7f858c", o = "#e0b24a", p = "#9c7a2c", c = "#d8743c" }
56top = """
57hggrshgggkhrsgkh
58kkkrskkkkkkrskkk
59gwwrswwwwwwrswwg
60gxxrsxxxxxxrsxxg
61gghrsgghgkgrsgkg
62hggrshgggkhrsgkh
63kwwrswwwwwwrswwk
64gxxrsxxxxxxrsxxg
65ghgrsghggkgrsgkg
66gghrsgghgkgrsgkg
67hwwrswwwwwwrswwh
68kxxrsxxxxxxrsxxk
69gggrsggghkgrshkg
70ghgrsghggkgrsgkg
71gwwrswwwwwwrswwg
72hxxrsxxxxxxrsxxh
73"""
74side = """
75................
76................
77................
78................
79................
80................
81................
82................
83................
84................
85................
86................
87................
88................
89xsssxsssxsssxsss
90hgggkhgggkhgggkh
91"""
92bottom = """
93hgggkhgggkhgggkh
94kkkkkkkkkkkkkkkk
95ggghkggghkggghkg
96ghggkghggkghggkg
97gghgkgghgkgghgkg
98hgggkhgggkhgggkh
99kkkkkkkkkkkkkkkk
100ggghkggghkggghkg
101ghggkghggkghggkg
102gghgkgghgkgghgkg
103hgggkhgggkhgggkh
104kkkkkkkkkkkkkkkk
105ggghkggghkggghkg
106ghggkghggkghggkg
107gghgkgghgkgghgkg
108hgggkhgggkhgggkh
109"""
110
111[blocks.powered_rail]
112name = "Powered rail"
113kind = "hard"
114hardness = 0.7
115solid = false
116turns = true
117boxes = [[0, 0, 0, 16, 2, 16]]
118colors = { g = "#5b5651", h = "#4a4541", k = "#696460", w = "#7a5634", x = "#5e4127", r = "#c3c8ce", s = "#7f858c", o = "#e0b24a", p = "#9c7a2c", c = "#d8743c" }
119top = """
120hggophgcckhopgkh
121kkkopkkkkkkopkkk
122gwwopwwccwwopwwg
123gxxopxxxxxxopxxg
124gghopggcckgopgkg
125hggophgggkhopgkh
126kwwopwwccwwopwwk
127gxxopxxxxxxopxxg
128ghgopghcckgopgkg
129gghopgghgkgopgkg
130hwwopwwccwwopwwh
131kxxopxxxxxxopxxk
132gggopggcckgophkg
133ghgopghggkgopgkg
134gwwopwwccwwopwwg
135hxxopxxxxxxopxxh
136"""
137side = """
138................
139................
140................
141................
142................
143................
144................
145................
146................
147................
148................
149................
150................
151................
152xsssxsssxsssxsss
153hgggkhgggkhgggkh
154"""
155bottom = """
156hgggkhgggkhgggkh
157kkkkkkkkkkkkkkkk
158ggghkggghkggghkg
159ghggkghggkghggkg
160gghgkgghgkgghgkg
161hgggkhgggkhgggkh
162kkkkkkkkkkkkkkkk
163ggghkggghkggghkg
164ghggkghggkghggkg
165gghgkgghgkgghgkg
166hgggkhgggkhgggkh
167kkkkkkkkkkkkkkkk
168ggghkggghkggghkg
169ghggkghggkghggkg
170gghgkgghgkgghgkg
171hgggkhgggkhgggkh
172"""
173
174[blocks.rail_bend]
175name = "Rail bend"
176kind = "hard"
177hardness = 0.7
178solid = false
179turns = true
180boxes = [[0, 0, 0, 16, 2, 16]]
181colors = { g = "#5b5651", h = "#4a4541", k = "#696460", w = "#7a5634", x = "#5e4127", r = "#c3c8ce", s = "#7f858c", o = "#e0b24a", p = "#9c7a2c", c = "#d8743c" }
182top = """
183hgggkhgggkhgggkh
184kkkkkkkkkkkkkkkk
185ggghkggghkggghkg
186ghggkghggkgwssss
187gghgkgghgksssrrr
188hgggkhgwssrrrgkh
189kkkkkkwssrkkwkkk
190ggghkgssrkggwwkg
191ghggkssrwwghgwkg
192gghgwsrhgwwghwkg
193hggwsrgggkwwggkh
194kkkksrwwkkkwkkss
195gggssrggwwggssrr
196ghgsrghggkwwsrkg
197ggwsrgghgkgsrgwg
198hgwsrwwwwwwsrgkh
199"""
200side = """
201................
202................
203................
204................
205................
206................
207................
208................
209................
210................
211................
212................
213................
214................
215xsssxsssxsssxsss
216hgggkhgggkhgggkh
217"""
218bottom = """
219hgggkhgggkhgggkh
220kkkkkkkkkkkkkkkk
221ggghkggghkggghkg
222ghggkghggkghggkg
223gghgkgghgkgghgkg
224hgggkhgggkhgggkh
225kkkkkkkkkkkkkkkk
226ggghkggghkggghkg
227ghggkghggkghggkg
228gghgkgghgkgghgkg
229hgggkhgggkhgggkh
230kkkkkkkkkkkkkkkk
231ggghkggghkggghkg
232ghggkghggkghggkg
233gghgkgghgkgghgkg
234hgggkhgggkhgggkh
235"""
236
237[blocks.rail_slope]
238name = "Rail slope"
239kind = "hard"
240hardness = 0.7
241solid = false
242turns = true
243boxes = [[0, 0, 14, 16, 2, 16], [0, 0, 12, 16, 4, 14], [0, 0, 10, 16, 6, 12], [0, 0, 8, 16, 8, 10], [0, 0, 6, 16, 10, 8], [0, 0, 4, 16, 12, 6], [0, 0, 2, 16, 14, 4], [0, 0, 0, 16, 16, 2]]
244colors = { g = "#5b5651", h = "#4a4541", k = "#696460", w = "#7a5634", x = "#5e4127", r = "#c3c8ce", s = "#7f858c", o = "#e0b24a", p = "#9c7a2c", c = "#d8743c" }
245top = """
246hggrshgggkhrsgkh
247kkkrskkkkkkrskkk
248gwwrswwwwwwrswwg
249gxxrsxxxxxxrsxxg
250gghrsgghgkgrsgkg
251hggrshgggkhrsgkh
252kwwrswwwwwwrswwk
253gxxrsxxxxxxrsxxg
254ghgrsghggkgrsgkg
255gghrsgghgkgrsgkg
256hwwrswwwwwwrswwh
257kxxrsxxxxxxrsxxk
258gggrsggghkgrshkg
259ghgrsghggkgrsgkg
260gwwrswwwwwwrswwg
261hxxrsxxxxxxrsxxh
262"""
263side = """
264..............ss
265..............kk
266............sskg
267............ggkg
268..........sshgkg
269..........hgggkh
270........sskkkkkk
271........hkggghkg
272......ssgkghggkg
273......ghgkgghgkg
274....ssgggkhgggkh
275....kkkkkkkkkkkk
276..sskggghkggghkg
277..ggkghggkghggkg
278sshgkgghgkgghgkg
279hgggkhgggkhgggkh
280"""
281bottom = """
282hgggkhgggkhgggkh
283kkkkkkkkkkkkkkkk
284ggghkggghkggghkg
285ghggkghggkghggkg
286gghgkgghgkgghgkg
287hgggkhgggkhgggkh
288kkkkkkkkkkkkkkkk
289ggghkggghkggghkg
290ghggkghggkghggkg
291gghgkgghgkgghgkg
292hgggkhgggkhgggkh
293kkkkkkkkkkkkkkkk
294ggghkggghkggghkg
295ghggkghggkghggkg
296gghgkgghgkgghgkg
297hgggkhgggkhgggkh
298"""
299
300# A cart to carry and put down on a rail, where it becomes one to ride.
301[blocks.cart]
302name = "Cart"
303kind = "hard"
304hardness = 0.5
305solid = false
306boxes = [[1, 1, 2, 15, 8, 14], [3, 0, 3, 5, 1, 5], [11, 0, 3, 13, 1, 5], [3, 0, 11, 5, 1, 13], [11, 0, 11, 13, 1, 13]]
307colors = { a = "#3a3e43", b = "#2b2e32", m = "#5d6268", n = "#4c5157", t = "#26282b" }
308top = """
309.a............a.
310.a............a.
311aaaaaaaaaaaaaaaa
312.abbbbbbbbbbbba.
313.abbbbbbbbbbbba.
314.abbbbbbbbbbbba.
315.abbbbbbbbbbbba.
316.abbbbbbbbbbbba.
317.abbbbbbbbbbbba.
318.abbbbbbbbbbbba.
319.abbbbbbbbbbbba.
320.abbbbbbbbbbbba.
321.abbbbbbbbbbbba.
322aaaaaaaaaaaaaaaa
323.a............a.
324.a............a.
325"""
326side = """
327................
328................
329................
330................
331................
332................
333................
334.aaaaaaaaaaaaaa.
335.mmmmmmmmmmmmmm.
336.nnnnnnnnnnnnnn.
337.mmmmmmmmmmmmmm.
338.mmmmmmmmmmmmmm.
339.nnnnnnnnnnnnnn.
340.mmmmmmmmmmmmmm.
341.mmmmmmmmmmmmmm.
342...ttt....ttt...
343"""
344bottom = """
345................
346................
347.nnnnnnnnnnnnnn.
348.nnnnnnnnnnnnnn.
349.nnnnnnnnnnnnnn.
350.nnnnnnnnnnnnnn.
351.nnnnnnnnnnnnnn.
352.nnnnnnnnnnnnnn.
353.nnnnnnnnnnnnnn.
354.nnnnnnnnnnnnnn.
355.nnnnnnnnnnnnnn.
356.nnnnnnnnnnnnnn.
357.nnnnnnnnnnnnnn.
358.nnnnnnnnnnnnnn.
359................
360................
361"""