Rooms usually spawn segments in a random order, however in some cases it is preferrable to have the order predetermined, for example, to be in sync with the music. There are two ways to disable segment randomization.
Before setting up segments with confSegment(), set the mgRandomize() to some value. This sets the randomization seed and makes the segments always spawn in the same order.
function init()
...
mgRandomize(0)
...
end
Start by removing the section of the room file, that controls segments and length:
confSegment("cave/narrow/16_0", 1)
confSegment("cave/narrow/16_1", 1)
confSegment("cave/narrow/16_2", 1)
confSegment("cave/narrow/16_3", 1)
confSegment("cave/narrow/8_0", 1)
confSegment("cave/narrow/8_1", 1)
l = 0
if pStart then
l = l + mgSegment("cave/narrow/start", -l)
end
local len = 170
if pEnd then
len = 200
end
while l < len do
s = nextSegment()
l = l + mgSegment(s, -l)
end
if pEnd then
l = l + mgSegment("cave/narrow/door", -l)
end
Then, replace it with this format of specifying segments:
l = 0
l = l + mgSegment("cave/narrow/start", -l)
l = l + mgSegment("cave/narrow/16_0", -l)
l = l + mgSegment("cave/narrow/16_1", -l)
l = l + mgSegment("cave/narrow/16_2", -l)
l = l + mgSegment("cave/narrow/16_3", -l)
l = l + mgSegment("cave/narrow/8_0", -l)
l = l + mgSegment("cave/narrow/8_1", -l)
l = l + mgSegment("cave/narrow/end", -l)
The segments will spawn in the order you specified them. Note that you can have multiple of the same segment in one room. The room speed is determined by how many segments you specify (more segments = faster room).
Boss rooms
Ticking rooms