Forts maps do not assign random fort positions, but instead give a fort order, which can be defined as a variable in the map script. This guide will show how to make that code variable.
This guide will teach you how to drastically lower the chances of this happening in the future.
Then open the highlighted file in a text editor. It should be something like mapname.lua
The syntax to define a Fort order is:
FortOrder = { { 1, 2, 3, 4 }, -- Team 1 { 1, 2, 3, 4 }, -- Team 2 }
Make sure that you use this exact syntax otherwise the code will not work.
It’s recommended to keep T1 and T2 orders synchronized otherwise it will get even more messy than it already is.
An example for a 4v4 map is given below (feel free to just copy/paste this for ease of use:
i = 0 if GetRandomInteger then i = GetRandomInteger(0, 22) end if i == 0 then FortOrder = { { 1, 2, 3, 4 }, { 1, 2, 3, 4 }, } elseif i == 1 then FortOrder = { { 1, 3, 2, 4 }, { 1, 3, 2, 4 }, } elseif i == 2 then FortOrder = { { 1, 3, 4, 2 }, { 1, 3, 4, 2 }, } elseif i == 3 then FortOrder = { { 1, 4, 3, 2 }, { 1, 4, 3, 2 }, } elseif i ==4 then FortOrder = { { 1, 4, 2, 3 }, { 1, 4, 2, 3 }, } elseif i ==5 then FortOrder = { { 1, 2, 4, 3 }, { 1, 2, 4, 3 }, } elseif i ==5 then FortOrder = { { 1, 2, 4, 3 }, { 1, 2, 4, 3 }, } elseif i ==6 then FortOrder = { { 2, 1, 3, 4 }, { 2, 1, 3, 4 }, } elseif i ==7 then FortOrder = { { 2, 1, 4, 3 }, { 2, 1, 4, 3 }, } elseif i ==8 then FortOrder = { { 2, 3, 1, 4 }, { 2, 3, 1, 4 }, } elseif i ==9 then FortOrder = { { 2, 3, 4, 1 }, { 2, 3, 4, 1 }, } elseif i ==10 then FortOrder = { { 2, 4, 3, 1 }, { 2, 4, 3, 1 }, } elseif i ==11 then FortOrder = { { 2, 4, 1, 3 }, { 2, 4, 1, 3 }, } elseif i ==12 then FortOrder = { { 3, 1, 2, 4 }, { 3, 1, 2, 4 }, } elseif i ==13 then FortOrder = { { 3, 1, 4, 2 }, { 3, 1, 4, 2 }, } elseif i ==14 then FortOrder = { { 3, 2, 4, 1 }, { 3, 2, 4, 1 }, } elseif i ==15 then FortOrder = { { 3, 4, 1, 2 }, { 3, 4, 1, 2 }, } elseif i ==16 then FortOrder = { { 3, 4, 2, 1 }, { 3, 4, 2, 1 }, } elseif i ==17 then FortOrder = { { 4, 1, 2, 3 }, { 4, 1, 2, 3 }, } elseif i ==18 then FortOrder = { { 4, 1, 3, 2 }, { 4, 1, 3, 2 }, } elseif i ==19 then FortOrder = { { 4, 2, 3, 1 }, { 4, 2, 3, 1 }, } elseif i ==20 then FortOrder = { { 4, 2, 1, 3 }, { 4, 2, 1, 3 }, } elseif i ==21 then FortOrder = { { 4, 3, 1, 2 }, { 4, 3, 1, 2 }, } elseif i ==22 then FortOrder = { { 4, 3, 2, 1 }, { 4, 3, 2, 1 }, } end
However, if at some point FordOrder can take integer variables, code could be easily condensed into something like this:
x = 0 y = 0 a = 0 b = 0 if GetRandomInteger then x = GetRandomInteger(1, 4) y = GetRandomInteger(1, 4) a = GetRandomInteger(1, 4) b = GetRandomInteger(1, 4) end if x == y or x == a or x == b or y == a or y == b or a == b then y = GetRandomInteger(1, 4) y = GetRandomInteger(1, 4) a = GetRandomInteger(1, 4) b = GetRandomInteger(1, 4) end FortOrder = { {x, y, a, b}, {x, y, a, b}, }
By mnmwert