Overview
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.
Introduction
When you play a lobby in forts in matches larger than a 1v1, forts assigns players to an order of bases. However this is not truly random. It is very easy to get the same fort over and over again if you play several matches in a row.
This guide will teach you how to drastically lower the chances of this happening in the future.
How to define Fort Order
In order to define a Fort order, after you create your map, go to the windows file directory and find your map name like in the image below:
Then open the highlighted file in a text editor. It should be something like mapname.lua
The syntax to define a Fort order is:
the numbers in the brackets are the assigned fort ID you get when making the map that shows up next to the fort. This shows the fort order for a 4v4 map. You can add or subtract to this depending on how many forts are on each team.
Make sure that you use this exact syntax otherwise the code will not work.
How to randomize fort order. (Updated)
A special thanks to Joepocalypse and Remi for refining my code!
You can copy/paste this code in your map lua file to randomize the code. Essentially what this is doing is it creates a table, shuffles it, and inserts that into FortOrder.
This specific code is for a 4v4, however scaling is easy:
in:
just change the number in RandomFortPos(4) to a 3, 2, 1, or however many forts are on that team.
This can also support maps with uneven teams.
Random Forts Assignment in Action
I currently have two maps made which show this feature in action:
[link] [link]where you can download and see it in action.