Below is a list of functions and their explanation which are useful for map scripts.
returns the id of the army the player is controlling. e.g. if there are four players in the game, it returns 1, 2, 3 or 4. it does NOT return the slot number (e.g. 1-8 in an 8-player map), and it does also NOT return the army name you have defined in the editor (e.g. ARMY_3)
returns a list of armies in the game. this will return the NAME of the armies you specified in the editor (e.g. ARMY_1)
example, 8 player map, slots ARMY_1 to ARMY_8.
ARMY_1 is occupied with an AI player
ARMY_6 is occupied with you
then the code
for i, army in ListArmies() do LOG("ListArmies i: "..i.." army "..army); end
will result in: ListArmies i: 1 army ARMY_1 ListArmies i: 2 army ARMY_6
next func here