Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Country Info
- function onLoad()
- tColor = {1,1,1}
- contReference = {
- alaska = "nAmerica",
- northwestterritory = "nAmerica",
- greenland = "nAmerica",
- alberta = "nAmerica",
- ontario = "nAmerica",
- quebec = "nAmerica",
- westernunitedstates = "nAmerica",
- easternunitedstates = "nAmerica",
- centralamerica = "nAmerica",
- venezuela = "sAmerica",
- brazil = "sAmerica",
- peru = "sAmerica",
- argentina = "sAmerica",
- iceland = "europe",
- scandinavia = "europe",
- ukrane = "europe",
- greatbritain = "europe",
- northerneurope = "europe",
- westerneurope = "europe",
- southerneurope = "europe",
- northafrica = "africa",
- egypt = "africa",
- eastafrica = "africa",
- congo = "africa",
- madagascar = "africa",
- southafrica = "africa",
- ural = "asia",
- siberia = "asia",
- yakutsk = "asia",
- kamchatka = "asia",
- irkutsk = "asia",
- mongolia = "asia",
- japan = "asia",
- afghanistan = "asia",
- china = "asia",
- middleeast = "asia",
- india = "asia",
- siam = "asia",
- indonesia = "australia",
- newguinea = "australia",
- westernaustralia = "australia",
- easternaustralia = "australia",
- }
- continents = {
- nAmerica = {
- alaska = {
- borders = {"northwestterritory","alberta","kamchatka"},
- owner = "test",
- units = 0,
- buttonindex = 0,
- button = {
- index = 0, click_function = 'alaska', function_owner = self,
- label = 'Alaska', position = {x = -1.2, y = 0.94, z = -0.62}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
- }
- },
- northwestterritory = {
- borders = {"alaska","alberta","ontario","greenland"},
- owner = nil,
- units = 0,
- buttonindex = 1,
- button = {
- index = 1, click_function = 'northwestterritory', function_owner = self,
- label = 'North West Territory', position = {x = -0.94, y = 0.94, z = -0.62}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
- }
- },
- greenland = {
- borders = {"northwestterritory","ontario","quebec","iceland"},
- owner = nil,
- units = 0,
- buttonindex = 2,
- button = {
- index = 2, click_function = 'greenland', function_owner = self,
- label = 'Greenland', position = {x = -0.41, y = 0.94, z = -0.72}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
- }
- },
- alberta = {
- borders = {"alaska","northwestterritory","ontario","westernunitedstates"},
- owner = nil,
- units = 0,
- buttonindex = 3,
- button = {
- index = 3, click_function = 'alberta', function_owner = self,
- label = 'Alberta', position = {x = -0.96, y = 0.94, z = -0.47}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
- }
- },
- ontario = {
- borders = {"northwestterritory","alberta","westernunitedstates","easternunitedstates","quebec","greenland"},
- owner = nil,
- units = 0,
- buttonindex = 4,
- button = {
- index = 4, click_function = 'ontario', function_owner = self,
- label = 'Ontario', position = {x = -0.78, y = 0.94, z = -0.43}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- quebec = {
- borders = {"ontario","easternunitedstates","greenland"},
- owner = nil,
- units = 0,
- buttonindex = 5,
- button = {
- index = 5, click_function = 'quebec', function_owner = self,
- label = 'Quebec', position = {x = -0.59, y = 0.94, z = -0.43}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- westernunitedstates = {
- borders = {"alberta","ontario","easternunitedstates","centralamerica"},
- owner = nil,
- units = 0,
- buttonindex = 6,
- button = {
- index = 6, click_function = 'westernunitedstates', function_owner = self,
- label = 'Western United States', position = {x = -0.95, y = 0.94, z = -0.27}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- easternunitedstates = {
- borders = {"ontario","quebec","westernunitedstates","centralamerica"},
- owner = nil,
- units = 0,
- buttonindex = 7,
- button = {
- index = 7, click_function = 'easternunitedstates', function_owner = self,
- label = 'Eastern United States', position = {x = -0.76, y = 0.94, z = -0.18}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- centralamerica = {
- borders = {"westernunitedstates","easternunitedstates","venezuela"},
- owner = nil,
- units = 0,
- buttonindex = 8,
- button = {
- index = 8, click_function = 'centralamerica', function_owner = self,
- label = 'Central America', position = {x = -0.87, y = 0.94, z = 0.01}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- },
- sAmerica = {
- venezuela = {
- borders = {"centralamerica","peru","brazil"},
- owner = nil,
- units = 0,
- buttonindex = 9,
- button = {
- index = 9, click_function = 'venezuela', function_owner = self,
- label = 'Venezuela', position = {x = -0.75, y = 0.94, z = 0.14}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- peru = {
- borders = {"venezuela","brazil","argentina"},
- owner = nil,
- units = 0,
- buttonindex = 10,
- button = {
- index = 10, click_function = 'peru', function_owner = self,
- label = 'Peru', position = {x = -0.68, y = 0.94, z = 0.39}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- brazil = {
- borders = {"venezuela","peru","argentina","northafrica"},
- owner = nil,
- units = 0,
- buttonindex = 11,
- button = {
- index = 11, click_function = 'brazil', function_owner = self,
- label = 'Brazil', position = {x = -0.53, y = 0.94, z = 0.31}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- argentina = {
- borders = {"peru","brazil"},
- owner = nil,
- units = 0,
- buttonindex = 12,
- button = {
- index = 12, click_function = 'argentina', function_owner = self,
- label = 'Argentina', position = {x = -0.64, y = 0.94, z = 0.58}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- },
- europe = {
- iceland = {
- borders = {"greenland","scandinavia","greatbritain"},
- owner = nil,
- units = 0,
- buttonindex = 13,
- button = {
- index = 13, click_function = 'iceland', function_owner = self,
- label = 'Iceland', position = {x = -0.19, y = 0.94, z = -0.53}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- scandinavia = {
- borders = {"iceland","ukrane","greatbritain","northerneurope"},
- owner = nil,
- units = 0,
- buttonindex = 14,
- button = {
- index = 14, click_function = 'scandinavia', function_owner = self,
- label = 'Scandinavia', position = {x = 0.04, y = 0.94, z = -0.59}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- ukrane = {
- borders = {"scandinavia","northerneurope","southerneurope","middleeast","afghanistan","ural"},
- owner = nil,
- units = 0,
- buttonindex = 15,
- button = {
- index = 15, click_function = 'ukrane', function_owner = self,
- label = 'Ukrane', position = {x = 0.29, y = 0.94, z = -0.41}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- greatbritain = {
- borders = {"iceland","scandinavia","northerneurope","westerneurope"},
- owner = nil,
- units = 0,
- buttonindex = 16,
- button = {
- index = 16, click_function = 'greatbritain', function_owner = self,
- label = 'Great Britain', position = {x = -0.23, y = 0.94, z = -0.3}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- northerneurope = {
- borders = {"greatbritain","westerneurope","southerneurope","ukrane","scandinavia"},
- owner = nil,
- units = 0,
- buttonindex = 17,
- button = {
- index = 17, click_function = 'northerneurope', function_owner = self,
- label = 'Northern Europe', position = {x = 0.07, y = 0.94, z = -0.26}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- westerneurope = {
- borders = {"greatbritain","northafrica","southerneurope","northerneurope"},
- owner = nil,
- units = 0,
- buttonindex = 18,
- button = {
- index = 18, click_function = 'westerneurope', function_owner = self,
- label = 'Western Europe', position = {x = -0.19, y = 0.94, z = 0}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- southerneurope = {
- borders = {"northerneurope","westerneurope","northafrica","egypt","middleeast","ukrane"},
- owner = nil,
- units = 0,
- buttonindex = 19,
- button = {
- index = 19, click_function = 'southerneurope', function_owner = self,
- label = 'Southern Europe', position = {x = 0.07, y = 0.94, z = -0.12}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- },
- africa = {
- northafrica = {
- borders = {"westerneurope","brazil","congo","eastafrica","egypt","southerneurope"},
- owner = nil,
- units = 0,
- buttonindex = 20,
- button = {
- index = 20, click_function = 'northafrica', function_owner = self,
- label = 'North Africa', position = {x = -0.07, y = 0.94, z = 0.28}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- egypt = {
- borders = {"southerneurope","northafrica","eastafrica","middleeast"},
- owner = nil,
- units = 0,
- buttonindex = 21,
- button = {
- index = 21, click_function = 'egypt', function_owner = self,
- label = 'Egypt', position = {x = 0.13, y = 0.94, z = 0.18}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- eastafrica = {
- borders = {"egypt","northafrica","congo","southafrica","madagascar","middleeast"},
- owner = nil,
- units = 0,
- buttonindex = 22,
- button = {
- index = 22, click_function = 'eastafrica', function_owner = self,
- label = 'East Africa', position = {x = 0.26, y = 0.94, z = 0.39}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- congo = {
- borders = {"northafrica","southafrica","eastafrica"},
- owner = nil,
- units = 0,
- buttonindex = 23,
- button = {
- index = 23, click_function = 'congo', function_owner = self,
- label = 'Congo', position = {x = 0.14, y = 0.94, z = 0.5}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- southafrica = {
- borders = {"congo","madagascar","eastafrica"},
- owner = nil,
- units = 0,
- buttonindex = 24,
- button = {
- index = 24, click_function = 'southafrica', function_owner = self,
- label = 'South Africa', position = {x = 0.15, y = 0.94, z = 0.78}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- madagascar = {
- borders = {"southafrica","eastafrica"},
- owner = nil,
- units = 0,
- buttonindex = 25,
- button = {
- index = 25, click_function = 'madagascar', function_owner = self,
- label = 'Madagascar', position = {x = 0.38, y = 0.94, z = 0.69}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- },
- asia = {
- ural = {
- borders = {"ukrane","afghanistan","china","siberia"},
- owner = nil,
- units = 0,
- buttonindex = 26,
- button = {
- index = 26, click_function = 'ural', function_owner = self,
- label = 'Ural', position = {x = 0.56, y = 0.94, z = -0.48}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- siberia = {
- borders = {"ural","china","mongolia","irkutsk","yakutsk"},
- owner = nil,
- units = 0,
- buttonindex = 27,
- button = {
- index = 27, click_function = 'siberia', function_owner = self,
- label = 'Siberia', position = {x = 0.7, y = 0.94, z = -0.58}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- yakutsk = {
- borders = {"siberia","irkutsk","kamchatka"},
- owner = nil,
- units = 0,
- buttonindex = 28,
- button = {
- index = 28, click_function = 'yakutsk', function_owner = self,
- label = 'Yakutsk', position = {x = 0.91, y = 0.94, z = -0.67}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- kamchatka = {
- borders = {"yakutsk","irkutsk","mongolia","japan","alaska"},
- owner = nil,
- units = 0,
- buttonindex = 29,
- button = {
- index = 29, click_function = 'kamchatka', function_owner = self,
- label = 'Kamchatka', position = {x = 1.12, y = 0.94, z = -0.65}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- irkutsk = {
- borders = {"yakutsk","siberia","mongolia","kamchatka","yakutsk"},
- owner = nil,
- units = 0,
- buttonindex = 30,
- button = {
- index = 30, click_function = 'irkutsk', function_owner = self,
- label = 'Irkutsk', position = {x = 0.88, y = 0.94, z = -0.43}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- mongolia = {
- borders = {"irkutsk","siberia","china","japan","kamchatka"},
- owner = nil,
- units = 0,
- buttonindex = 31,
- button = {
- index = 31, click_function = 'mongolia', function_owner = self,
- label = 'Mongolia', position = {x = 0.9, y = 0.94, z = -0.26}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- afghanistan = {
- borders = {"ukrane","middleeast","india","china","ural"},
- owner = nil,
- units = 0,
- buttonindex = 32,
- button = {
- index = 32, click_function = 'afghanistan', function_owner = self,
- label = 'Afghanistan', position = {x = 0.52, y = 0.94, z = -0.21}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- japan = {
- borders = {"mongolia","kamchatka"},
- owner = nil,
- units = 0,
- buttonindex = 33,
- button = {
- index = 33, click_function = 'japan', function_owner = self,
- label = 'Japan', position = {x = 1.21, y = 0.94, z = -0.3}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- china = {
- borders = {"siberia","ural","afghanistan","india","siam","mongolia"},
- owner = nil,
- units = 0,
- buttonindex = 34,
- button = {
- index = 34, click_function = 'china', function_owner = self,
- label = 'China', position = {x = 0.83, y = 0.94, z = -0.08}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- middleeast = {
- borders = {"ukrane","southerneurope","egypt","eastafrica","india","afghanistan"},
- owner = nil,
- units = 0,
- buttonindex = 35,
- button = {
- index = 35, click_function = 'middleeast', function_owner = self,
- label = 'Middle East', position = {x = 0.38, y = 0.94, z = 0.02}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- india = {
- borders = {"afghanistan","middleeast","siam","china"},
- owner = nil,
- units = 0,
- buttonindex = 36,
- button = {
- index = 36, click_function = 'india', function_owner = self,
- label = 'India', position = {x = 0.66, y = 0.94, z = 0.06}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- siam = {
- borders = {"india","china","indonesia"},
- owner = nil,
- units = 0,
- buttonindex = 37,
- button = {
- index = 37, click_function = 'siam', function_owner = self,
- label = 'Siam', position = {x = 0.9, y = 0.94, z = 0.16}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- },
- australia = {
- indonesia = {
- borders = {"siam","westernaustralia","newguinea"},
- owner = nil,
- units = 0,
- buttonindex = 38,
- button = {
- index = 38, click_function = 'indonesia', function_owner = self,
- label = 'Indonesia', position = {x = 1.02, y = 0.94, z = 0.48}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- newguinea = {
- borders = {"indonesia","easternaustralia"},
- owner = nil,
- units = 0,
- buttonindex = 39,
- button = {
- index = 39, click_function = 'newguinea', function_owner = self,
- label = 'New Guinea', position = {x = 1.26, y = 0.94, z = 0.42}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- westernaustralia = {
- borders = {"indonesia","easternaustralia"},
- owner = nil,
- units = 0,
- buttonindex = 40,
- button = {
- index = 40, click_function = 'westernaustralia', function_owner = self,
- label = 'Western Austrailia', position = {x = 1.06, y = 0.94, z = 0.64}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- },
- easternaustralia = {
- borders = {"newguinea","westernaustralia"},
- owner = nil,
- units = 0,
- buttonindex = 41,
- button = {
- index = 41, click_function = 'easternaustralia', function_owner = self,
- label = 'Eastern Austrailia', position = {x = 1.28, y = 0.94, z = 0.68}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 80, height = 54, font_size = 50,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}}
- }
- }
- }
- pColors = {
- White = {{1,1,1},{0.25, 0.25, 0.25}},
- Brown = {{0.443, 0.231, 0.09},{0.25, 0.25, 0.25}},
- Red = {{0.856, 0.1, 0.094},{0.25, 0.25, 0.25}},
- Orange = {{0.956, 0.392, 0.113},{0.25, 0.25, 0.25}},
- Yellow = {{0.905, 0.898, 0.172},{0.25, 0.25, 0.25}},
- Green = {{0.192, 0.701, 0.168},{0.25, 0.25, 0.25}},
- Teal = {{0.129, 0.694, 0.607},{0.25, 0.25, 0.25}},
- Blue = {{0.118, 0.53, 1},{0.25, 0.25, 0.25}},
- Purple = {{0.627, 0.125, 0.941},{0.25, 0.25, 0.25}},
- Pink = {{0.96, 0.439, 0.807},{0.25, 0.25, 0.25}}
- }
- neutralColor = "Yellow"
- pList = {}
- territoryCount = {}
- -- holder variables
- phase = "pregame"
- currentturn = "pregame"
- --[[ Button numbers -
- 0 - 41 territories
- 42 start button
- ]]--
- startButton = {
- index = 42, click_function = 'setupTerritories', function_owner = self,
- label = 'Start Game', position = {x = 0.0, y = 1.0, z = 0.0}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 0.5, y = 1, z = 0.5}, width = 700, height = 120, font_size = 100,
- color = {r = 1, g = 1, b = 1, a = 1}, font_color = {r = 0, g = 0, b = 0, a = 1}
- }
- self.createButton(startButton)
- end
- -- Setup
- function createTerritoryButtons()
- for i,c in pairs(continents) do
- for j,t in pairs(c) do
- self.createButton(t.button)
- end
- end
- end
- -- set up
- function setupTerritories()
- createTerritoryButtons()
- --count players and get colour and set starting unit count
- local pList = getSeatedPlayers()
- local numPlayers = #pList
- -- check for enough players
- if pList == nil or numPlayers < 1 then
- broadcastToAll("Not enough players seated to start the game!",tColor)
- return false
- end
- -- determine if there is a neutral player
- neutralPlayer = 0
- if numPlayers == 2 then
- neutralPlayer = 1
- table.insert(pList,neutralColor)
- end
- local t = {}
- -- initialize territory counts
- for i,v in pairs(pList) do
- territoryCount[v] = 0
- end
- -- get a list of territories
- for i,v in pairs(contReference) do
- table.insert(t,i)
- end
- local pIndex = 1
- --deal territory to players add 1 to all of the player owned territory
- repeat
- local rand = math.random(#t)
- updateTroopCount(t[rand],1)
- updateOwner(t[rand],pList[pIndex])
- territoryCount[pList[pIndex]] = territoryCount[pList[pIndex]] + 1
- pIndex = pIndex + 1
- if pIndex > numPlayers + neutralPlayer then
- pIndex = 1
- end
- table.remove(t,rand)
- until #t <= 0 or #t == nil
- local startUnits = {0,40,35,30,25,20}
- local unitsLeft = {}
- for i,v in pairs(pList) do
- unitsLeft[v] = startUnits[numPlayers] - territoryCount[v]
- broadcastToAll(v .. " has " .. unitsLeft[v] .. " units left to place.",tColor)
- end
- --roll for who goes 1st
- rand = math.random(numPlayers)
- currentturn = pList[rand]
- broadcastToAll(currentturn .. " gets first placement.",tColor)
- --players from 1st to last add to a territory clockwise until number for the game
- -- start up end
- end
- function territoryClicked(territory,color)
- if currentturn ~= color then
- broadcastToColor("Cannot do that. It is not your turn.",color,tColor)
- return
- end
- if phase == "pregame" then
- broadcastToColor("Cannot do that. The game has not been started.",color,tColor)
- return
- end
- broadcastToAll(getOwner(territory) .. "'s " .. territory .. " with " .. getUnitAmount(territory) .. " units was clicked by " .. color, tColor)
- end
- --turn start
- --turn setup phase start
- --unit re-enforcement calculation
- --player may hand in complete sets/ if player has 5 or more cards in hand they must hand in set and set value is added to unit re-enforcement and set value is incremented
- --unit re-enforcement placement
- -- turn setup phase end
- --combat phase start
- --highlight country's that are valid to attack/if there is none end turn
- --highlight the country's that selected country can attack
- -----------------------
- -- SUPPORT FUNCTIONS --
- -----------------------
- function st(t)
- broadcastToAll(t,tColor)
- end
- function updateTroopCount(territory,amount)
- --broadcastToAll("Got passed: territory - " .. territory .. " amount - " .. amount,tColor)
- continents[contReference[territory]][territory].button.label = amount
- continents[contReference[territory]][territory].units = amount
- self.editButton(continents[contReference[territory]][territory].button)
- end
- function updateOwner(territory,owner)
- --broadcastToAll("Got passed: territory - " .. territory,tColor)
- --broadcastToAll(" owner - " .. owner,tColor)
- continents[contReference[territory]][territory].owner = owner
- continents[contReference[territory]][territory].button.color = pColors[owner][1]
- continents[contReference[territory]][territory].button.font_color = pColors[owner][2]
- self.editButton(continents[contReference[territory]][territory].button)
- end
- function getOwner(territory)
- return continents[contReference[territory]][territory].owner
- end
- function getUnitAmount(territory)
- return continents[contReference[territory]][territory].units
- end
- -- Button click re-reference functions
- function alaska(o,c) territoryClicked("alaska",c) end
- function northwestterritory(o,c) territoryClicked("northwestterritory",c) end
- function greenland(o,c) territoryClicked("greenland",c) end
- function alberta(o,c) territoryClicked("alberta",c) end
- function ontario(o,c) territoryClicked("ontario",c) end
- function quebec(o,c) territoryClicked("quebec",c) end
- function westernunitedstates(o,c) territoryClicked("westernunitedstates",c) end
- function easternunitedstates(o,c) territoryClicked("easternunitedstates",c) end
- function centralamerica(o,c) territoryClicked("centralamerica",c) end
- function venezuela(o,c) territoryClicked("venezuela",c) end
- function brazil(o,c) territoryClicked("brazil",c) end
- function peru(o,c) territoryClicked("peru",c) end
- function argentina(o,c) territoryClicked("argentina",c) end
- function iceland(o,c) territoryClicked("iceland",c) end
- function scandinavia(o,c) territoryClicked("scandinavia",c) end
- function ukrane(o,c) territoryClicked("ukrane",c) end
- function greatbritain(o,c) territoryClicked("greatbritain",c) end
- function northerneurope(o,c) territoryClicked("northerneurope",c) end
- function westerneurope(o,c) territoryClicked("westerneurope",c) end
- function southerneurope(o,c) territoryClicked("southerneurope",c) end
- function northafrica(o,c) territoryClicked("northafrica",c) end
- function egypt(o,c) territoryClicked("egypt",c) end
- function eastafrica(o,c) territoryClicked("eastafrica",c) end
- function congo(o,c) territoryClicked("congo",c) end
- function madagascar(o,c) territoryClicked("madagascar",c) end
- function southafrica(o,c) territoryClicked("southafrica",c) end
- function ural(o,c) territoryClicked("ural",c) end
- function siberia(o,c) territoryClicked("siberia",c) end
- function yakutsk(o,c) territoryClicked("yakutsk",c) end
- function kamchatka(o,c) territoryClicked("kamchatka",c) end
- function irkutsk(o,c) territoryClicked("irkutsk",c) end
- function mongolia(o,c) territoryClicked("mongolia",c) end
- function japan(o,c) territoryClicked("japan",c) end
- function afghanistan(o,c) territoryClicked("afghanistan",c) end
- function china(o,c) territoryClicked("china",c) end
- function middleeast(o,c) territoryClicked("middleeast",c) end
- function india(o,c) territoryClicked("india",c) end
- function siam(o,c) territoryClicked("siam",c) end
- function indonesia(o,c) territoryClicked("indonesia",c) end
- function newguinea(o,c) territoryClicked("newguinea",c) end
- function westernaustralia(o,c) territoryClicked("westernaustralia",c) end
- function easternaustralia(o,c) territoryClicked("easternaustralia",c) end
Advertisement
Add Comment
Please, Sign In to add comment