Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Build Order? help for noobs


so in all the multiplayer levels i’ve played they all have this build order thing but i don’t know how to put heroes into that order. it would be really awesome to figure out because it would help my strategy (that is yet to be made) soooo yah

P.S. it would be awesome if you could teach me how to make one :smile:


You can just put the hero name into the array, if you want. Only in Sky Span can you build more than one hero, though; in Dungeon Arena, you can only build one. And they cost 100 gold in Sky Span, so you definitely want to be sure you’re using them well to make them worth it instead of building a bunch of soldiers/archers.

var buildOrder = ['anya', 'tharin', 'hushbaum', 'tharin', 'archer', 'archer', 'tharin', 'archer', 'archer'];
var type = buildOrder[this.built.length % buildOrder.length];


So this is what i have
var buildOrder = (‘tharin’, ‘soldier’, ‘soldier’, ‘soldier’, ‘archer’);
var type = builOrder[this.built.length % buildOrder.length];
idk if having ( or [ but if it does tell me plz
but anyway on the first line it says error: unexpected token var expected ‘(’ and instead saw ‘var’. missing semicolen
can u plz help or explain thanks youve been so helpful so far

PS i figured out the second line but the first is still errored


The [] brackets make an array, which is what you want. So change this line:

var buildOrder = ('tharin', 'soldier', 'soldier', 'soldier', 'archer');


var buildOrder = ['tharin', 'soldier', 'soldier', 'soldier', 'archer'];

The () parentheses sometimes call functions, sometimes are required for control structures like if (condition) and while (condition), and sometimes group statements in the right order, like var averageTime = (end - start) / count.


so i changed the parentheses to brackets and it still says error: unxpected token var expected ‘(’ but saw ‘var’ missing semicolen

var buildOrder = [‘tharin’, ‘soldier’, ‘soldier’, ‘soldier’, ‘archer’]; this is the code btw


What is the code before that? Sounds like it’s complaining about something before that line starts.