diff --git a/Assets/Models/Maps/2lakes/2lakes.jpg b/Assets/Models/Maps/2lakes/2lakes.jpg old mode 100755 new mode 100644 index a1451cc..7c25401 Binary files a/Assets/Models/Maps/2lakes/2lakes.jpg and b/Assets/Models/Maps/2lakes/2lakes.jpg differ diff --git a/Assets/Models/Maps/2lakes/2lakes.lua b/Assets/Models/Maps/2lakes/2lakes.lua index 2c3ae15..e10994e 100644 --- a/Assets/Models/Maps/2lakes/2lakes.lua +++ b/Assets/Models/Maps/2lakes/2lakes.lua @@ -6,19 +6,54 @@ metadata = { impassibleNodeValue = 65535, spawnPoints = { {x = -105.929001, y = -0.110725, z = -404.756104}, - {x = 17.326164, y = 0.000046, z = 360.545441}, + {x = 105.326164, y = 0.000046, z = 360.545441}, }, choosablePlayers = { { units = { - {id = 10, pos = {x = -105.929001, y = -0.110725, z = -404.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -100, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -95, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -90, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -85, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -80, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -75, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -70, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -65, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -60, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -55, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -50, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -45, y = -0.110725, z = -420.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -100, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -95, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -90, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -85, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -80, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -75, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -70, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -65, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -60, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -55, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -50, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -45, y = -0.110725, z = -415.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -100, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -95, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -90, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -85, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -80, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -75, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -70, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -65, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -60, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -55, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -50, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -45, y = -0.110725, z = -410.756104}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, } }, { units = { - {id = 10, pos = {x = -20.215218, y = 0.000000, z = 365.251648}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 0, pos = {x = -20.215218, y = 0.000000, z = 365.251648}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, } }, diff --git a/Assets/Models/Maps/2lakes/minimap.jpg b/Assets/Models/Maps/2lakes/minimap.jpg index 2ecf3e0..5064f38 100644 Binary files a/Assets/Models/Maps/2lakes/minimap.jpg and b/Assets/Models/Maps/2lakes/minimap.jpg differ diff --git a/Assets/Models/Maps/3islands/3islands.jpg b/Assets/Models/Maps/3islands/3islands.jpg old mode 100755 new mode 100644 index a1451cc..7c25401 Binary files a/Assets/Models/Maps/3islands/3islands.jpg and b/Assets/Models/Maps/3islands/3islands.jpg differ diff --git a/Assets/Models/Maps/3islands/3islands.lua b/Assets/Models/Maps/3islands/3islands.lua index ee0b1a7..30cff7c 100644 --- a/Assets/Models/Maps/3islands/3islands.lua +++ b/Assets/Models/Maps/3islands/3islands.lua @@ -11,25 +11,15 @@ metadata = { }, choosablePlayers = { { - units = { - {id = 10, pos = {x = 50.410851, y = 0.000046, z = -472.358398}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = UnitId.ACS_TANK, pos = {x = -280.500000, y = 0, z = -496.500000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = 24, pos = {x = 403.000000, y = -18.453316, z = -343.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - } - + units = {} }, { - units = { - {id = 0, pos = {x = 387.292053, y = 0.035400, z = 482.050964}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - } - + units = {} }, { - units = { - {id = 10, pos = {x = -450.032196, y = 0.000031, z = 417.242737}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - } + units = {} }, }, diff --git a/Assets/Models/Maps/3islands/minimap.jpg b/Assets/Models/Maps/3islands/minimap.jpg index 4ed34ce..20b3e97 100644 Binary files a/Assets/Models/Maps/3islands/minimap.jpg and b/Assets/Models/Maps/3islands/minimap.jpg differ diff --git a/Assets/Models/Maps/W3/W3.jpg b/Assets/Models/Maps/W3/W3.jpg deleted file mode 100755 index a1451cc..0000000 Binary files a/Assets/Models/Maps/W3/W3.jpg and /dev/null differ diff --git a/Assets/Models/Maps/aaa/aaa.jpg b/Assets/Models/Maps/aaa/aaa.jpg deleted file mode 100755 index a1451cc..0000000 Binary files a/Assets/Models/Maps/aaa/aaa.jpg and /dev/null differ diff --git a/Assets/Models/Maps/aaa/aaa.lua b/Assets/Models/Maps/aaa/aaa.lua deleted file mode 100644 index 826e42b..0000000 --- a/Assets/Models/Maps/aaa/aaa.lua +++ /dev/null @@ -1,62 +0,0 @@ -metadata = { - lights = { - {type = 3, color = {x = 0.900000, y = 0.900000, z = 0.900000}}, - }, - size = {x = 444.000000, y = 49.563534, z = 444.000000}, - impassibleNodeValue = 65535, - spawnPoints = { - {x = -170.000000, y = 0.000000, z = 140.000000}, - {x = 120.000000, y = 0.000000, z = -160.000000}, - {x = 170.000000, y = 0.000000, z = 140.000000}, - }, - choosablePlayers = { - { - resourceDeposits = {}, - units = { - {id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = -180.000000, y = 0.000000, z = 140.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - {id = UnitId.AINC_LAND_FACTORY, pos = {x = -200.000000, y = 0.000000, z = 140.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - {id = UnitId.AINC_TANK, pos = {x = -0.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - {id = UnitId.AINC_MECH, pos = {x = -30.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - {id = UnitId.AINC_MECH, pos = {x = -60.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - {id = UnitId.AINC_MECH, pos = {x = -90.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - {id = UnitId.AINC_MECH, pos = {x = -120.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - {id = UnitId.AINC_MECH, pos = {x = -150.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - } - }, - { - resourceDeposits = {}, - units = { - --{id = UnitId.AINC_ROBO_ENGINEER, pos = {x = 100.000000, y = 0.000000, z = 10.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - --{id = UnitId.RESOURCE_ROVER, pos = {x = 100.000000, y = 0.000000, z = -10.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.TRADE_CENTER, pos = {x = 130.000000, y = 0.000000, z = 10.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - --{id = UnitId.LAB, pos = {x = 100.000000, y = 0.000000, z = 20.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - --{id = UnitId.ACS_REFINERY, pos = {x = 100.000000, y = 0.000000, z = 50.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - {id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 150.000000, y = 0.000000, z = -120.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - } - }, - {resourceDeposits = {},units = {}}, - --[[ - {resourceDeposits = {},units = {}}, - {resourceDeposits = {},units = {}}, - {resourceDeposits = {},units = {}}, - {resourceDeposits = {},units = {}}, - {resourceDeposits = {},units = {}}, - {resourceDeposits = {},units = {}}, - {resourceDeposits = {},units = {}}, - ]]-- - }, - civilianPlayer = { - resourceDeposits = { - {id = 0, pos = {x = -150.000000, y = 0.000000, z = 150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - {id = 0, pos = {x = 150.000000, y = 0.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - {id = 0, pos = {x = 150.000000, y = 0.000000, z = -130.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - {id = 0, pos = {x = 150.000000, y = 0.000000, z = -110.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - }, - units = { - --{id = UnitId.AINC_LAND_FACTORY, pos = {x = 170.000000, y = 0.000000, z = -170.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - } - }, - skybox = "Skybox1", - terrain = {model = "aaa.xml", albedo = "aaa.jpg"}, - waterbodies = {} -} diff --git a/Assets/Models/Maps/aaa/minimap.jpg b/Assets/Models/Maps/aaa/minimap.jpg deleted file mode 100644 index 7adee8c..0000000 Binary files a/Assets/Models/Maps/aaa/minimap.jpg and /dev/null differ diff --git a/Assets/Models/Maps/aaa/cells.lua b/Assets/Models/Maps/land/cells.lua similarity index 100% rename from Assets/Models/Maps/aaa/cells.lua rename to Assets/Models/Maps/land/cells.lua diff --git a/Assets/Models/Maps/land/land.jpg b/Assets/Models/Maps/land/land.jpg new file mode 100644 index 0000000..7c25401 Binary files /dev/null and b/Assets/Models/Maps/land/land.jpg differ diff --git a/Assets/Models/Maps/land/land.lua b/Assets/Models/Maps/land/land.lua new file mode 100644 index 0000000..097f95f --- /dev/null +++ b/Assets/Models/Maps/land/land.lua @@ -0,0 +1,38 @@ +metadata = { + lights = { + {type = 3, color = {x = 0.900000, y = 0.900000, z = 0.900000}}, + }, + size = {x = 444.000000, y = 49.563534, z = 444.000000}, + impassibleNodeValue = 65535, + spawnPoints = { + {x = -170.000000, y = 0.000000, z = 140.000000}, + {x = 120.000000, y = 0.000000, z = -160.000000}, + --{x = 170.000000, y = 0.000000, z = 140.000000}, + }, + choosablePlayers = { + { + resourceDeposits = {}, + units = { + } + }, + { + resourceDeposits = {}, + units = { + } + }, + --{resourceDeposits = {},units = {}}, + }, + civilianPlayer = { + resourceDeposits = { + {id = 0, pos = {x = -150.000000, y = 0.000000, z = 150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = -150.000000, y = 0.000000, z = 130.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = -150.000000, y = 0.000000, z = 110.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = 150.000000, y = 0.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = 150.000000, y = 0.000000, z = -130.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = 150.000000, y = 0.000000, z = -110.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + }, + }, + skybox = "Skybox1", + terrain = {model = "land.xml", albedo = "land.jpg"}, + waterbodies = {} +} diff --git a/Assets/Models/Maps/aaa/aaa.xml b/Assets/Models/Maps/land/land.xml similarity index 100% rename from Assets/Models/Maps/aaa/aaa.xml rename to Assets/Models/Maps/land/land.xml diff --git a/Assets/Models/Maps/land/minimap.jpg b/Assets/Models/Maps/land/minimap.jpg new file mode 100644 index 0000000..a00cf34 Binary files /dev/null and b/Assets/Models/Maps/land/minimap.jpg differ diff --git a/Assets/Models/Maps/w5/cells.lua b/Assets/Models/Maps/river/cells.lua similarity index 100% rename from Assets/Models/Maps/w5/cells.lua rename to Assets/Models/Maps/river/cells.lua diff --git a/Assets/Models/Maps/river/minimap.jpg b/Assets/Models/Maps/river/minimap.jpg new file mode 100644 index 0000000..89f367b Binary files /dev/null and b/Assets/Models/Maps/river/minimap.jpg differ diff --git a/Assets/Models/Maps/river/river.jpg b/Assets/Models/Maps/river/river.jpg new file mode 100644 index 0000000..7c25401 Binary files /dev/null and b/Assets/Models/Maps/river/river.jpg differ diff --git a/Assets/Models/Maps/river/river.lua b/Assets/Models/Maps/river/river.lua new file mode 100644 index 0000000..342e4a3 --- /dev/null +++ b/Assets/Models/Maps/river/river.lua @@ -0,0 +1,38 @@ +metadata = { + lights = { + {type = 3, color = {x = 0.900000, y = 0.900000, z = 0.900000}}, + }, + size = {x = 1000.000000, y = 315.232758, z = 1000.000000}, + impassibleNodeValue = 65535, + spawnPoints = { + {x = -396.000000, y = 0.000000, z = -374.000000}, + {x = 300.000000, y = 0.000000, z = 400.000000}, + --{x = -326.000000, y = 0.000000, z = 374.000000}, + }, + choosablePlayers = { + { + units = {} + + }, + { + units = {} + }, + }, + civilianPlayer = { + resourceDeposits = { + {id = 0, pos = {x = 450.000000, y = 0.000000, z = 450.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = 450.000000, y = 0.000000, z = 430.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = 450.000000, y = 0.000000, z = 410.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = 450.000000, y = 0.000000, z = 390.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = -450.000000, y = 0.000000, z = -450.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = -450.000000, y = 0.000000, z = -430.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = -450.000000, y = 0.000000, z = -410.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + {id = 0, pos = {x = -450.000000, y = 0.000000, z = -390.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, + }, + + }, + skybox = "Skybox1", + terrain = {model = "river.xml", albedo = "river.jpg"}, + waterbodies = { + {pos = {x = -71.606972, y = -4.143668, z = 0.000000}, size = {x = 534.327454, y = 995.253296}, albedo = "water.png"}, } +} diff --git a/Assets/Models/Maps/w5/w5.xml b/Assets/Models/Maps/river/river.xml similarity index 100% rename from Assets/Models/Maps/w5/w5.xml rename to Assets/Models/Maps/river/river.xml diff --git a/Assets/Models/Maps/W3/cells.lua b/Assets/Models/Maps/seaTest1/cells.lua similarity index 100% rename from Assets/Models/Maps/W3/cells.lua rename to Assets/Models/Maps/seaTest1/cells.lua diff --git a/Assets/Models/Maps/W3/minimap.jpg b/Assets/Models/Maps/seaTest1/minimap.jpg similarity index 97% rename from Assets/Models/Maps/W3/minimap.jpg rename to Assets/Models/Maps/seaTest1/minimap.jpg index 4ed34ce..37b31bc 100644 Binary files a/Assets/Models/Maps/W3/minimap.jpg and b/Assets/Models/Maps/seaTest1/minimap.jpg differ diff --git a/Assets/Models/Maps/seaTest1/seaTest1.jpg b/Assets/Models/Maps/seaTest1/seaTest1.jpg new file mode 100644 index 0000000..7c25401 Binary files /dev/null and b/Assets/Models/Maps/seaTest1/seaTest1.jpg differ diff --git a/Assets/Models/Maps/W3/W3.lua b/Assets/Models/Maps/seaTest1/seaTest1.lua similarity index 97% rename from Assets/Models/Maps/W3/W3.lua rename to Assets/Models/Maps/seaTest1/seaTest1.lua index 3778dc6..a96d0ea 100644 --- a/Assets/Models/Maps/W3/W3.lua +++ b/Assets/Models/Maps/seaTest1/seaTest1.lua @@ -2,7 +2,7 @@ metadata = { lights = { {type = 3, color = {x = 0.900000, y = 0.900000, z = 0.900000}}, }, - size = {x = 1000.000000, y = 0.000000, z = 1000.000000}, + size = {x = 1000.000000, y = 12.000000, z = 1000.000000}, impassibleNodeValue = 65535, spawnPoints = { {x = 0.000000, y = 0.000000, z = 0.000000}, @@ -48,7 +48,7 @@ metadata = { }, skybox = "TestSkybox", - terrain = {model = "W3.xml", albedo = "W3.jpg"}, + terrain = {model = "seaTest1.xml", albedo = "seaTest1.jpg"}, waterbodies = { {pos = {x = 0.000000, y = 12.000000, z = 0.000000}, size = {x = 1000.000000, y = 1000.000000}, albedo = "water.png"}, } } diff --git a/Assets/Models/Maps/W3/W3.xml b/Assets/Models/Maps/seaTest1/seaTest1.xml similarity index 100% rename from Assets/Models/Maps/W3/W3.xml rename to Assets/Models/Maps/seaTest1/seaTest1.xml diff --git a/Assets/Models/Maps/w4/cells.lua b/Assets/Models/Maps/seaTest2/cells.lua similarity index 100% rename from Assets/Models/Maps/w4/cells.lua rename to Assets/Models/Maps/seaTest2/cells.lua diff --git a/Assets/Models/Maps/w4/minimap.jpg b/Assets/Models/Maps/seaTest2/minimap.jpg similarity index 96% rename from Assets/Models/Maps/w4/minimap.jpg rename to Assets/Models/Maps/seaTest2/minimap.jpg index 15e022d..6955b6e 100644 Binary files a/Assets/Models/Maps/w4/minimap.jpg and b/Assets/Models/Maps/seaTest2/minimap.jpg differ diff --git a/Assets/Models/Maps/seaTest2/seaTest2.jpg b/Assets/Models/Maps/seaTest2/seaTest2.jpg new file mode 100644 index 0000000..7c25401 Binary files /dev/null and b/Assets/Models/Maps/seaTest2/seaTest2.jpg differ diff --git a/Assets/Models/Maps/seaTest2/seaTest2.lua b/Assets/Models/Maps/seaTest2/seaTest2.lua new file mode 100644 index 0000000..ec76feb --- /dev/null +++ b/Assets/Models/Maps/seaTest2/seaTest2.lua @@ -0,0 +1,44 @@ +metadata = { + lights = { + {type = 3, color = {x = 0.900000, y = 0.900000, z = 0.900000}}, + }, + size = {x = 500.000000, y = 20.000000, z = 500.000000}, + impassibleNodeValue = 65535, + spawnPoints = { + {x = 0.000000, y = 0.000000, z = 0.000000}, + {x = 0.000000, y = 0.000000, z = 0.000000}, + }, + choosablePlayers = { + { + units = { + {id = UnitId.ACS_NAVAL_FACTORY, pos = {x = -150.000000, y = 0.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, + {id = UnitId.AINC_NAVAL_FACTORY, pos = {x = 0.000000, y = 0.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, + {id = UnitId.ER_NAVAL_FACTORY, pos = {x = 150.000000, y = 0.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, + {id = UnitId.ACS_TRANSPORT, pos = {x = -150.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + {id = UnitId.AINC_TRANSPORT, pos = {x = 0.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + {id = UnitId.ER_TRANSPORT, pos = {x = 150.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 25, pos = {x = 0.000000, y = 0.000000, z = 100.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 26, pos = {x = 60.000000, y = 0.000000, z = 100.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 9, pos = {x = 0.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 30, pos = {x = -30.000000, y = 0.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 31, pos = {x = 0.000000, y = -15.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + --{id = 32, pos = {x = 30.000000, y = -15.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, + } + + }, + + { + units = { + {id = UnitId.AINC_NAVAL_FACTORY, pos = {x = 250.000000, y = 0.000000, z = 250.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, + } + + }, + }, + civilianPlayer = { + + }, + skybox = "Skybox1", + terrain = {model = "seaTest2.xml", albedo = "seaTest2.jpg"}, + waterbodies = { + {pos = {x = 0.000000, y = 0.000000, z = 0.000000}, size = {x = 500.000000, y = 500.000000}, albedo = "water.png"}, } +} diff --git a/Assets/Models/Maps/w4/w4.xml b/Assets/Models/Maps/seaTest2/seaTest2.xml similarity index 100% rename from Assets/Models/Maps/w4/w4.xml rename to Assets/Models/Maps/seaTest2/seaTest2.xml diff --git a/Assets/Models/Maps/w4/w4.jpg b/Assets/Models/Maps/w4/w4.jpg deleted file mode 100755 index a1451cc..0000000 Binary files a/Assets/Models/Maps/w4/w4.jpg and /dev/null differ diff --git a/Assets/Models/Maps/w4/w4.lua b/Assets/Models/Maps/w4/w4.lua deleted file mode 100644 index 0a448a4..0000000 --- a/Assets/Models/Maps/w4/w4.lua +++ /dev/null @@ -1,40 +0,0 @@ -metadata = { - lights = { - {type = 3, color = {x = 0.900000, y = 0.900000, z = 0.900000}}, - }, - size = {x = 500.000000, y = 20.000000, z = 500.000000}, - impassibleNodeValue = 65535, - spawnPoints = { - {x = 0.000000, y = 0.000000, z = 0.000000}, - {x = 0.000000, y = 0.000000, z = 0.000000}, - }, - choosablePlayers = { - { - units = { - {id = 21, pos = {x = -50.000000, y = 0.000000, z = 130.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = 24, pos = {x = -50.000000, y = 0.000000, z = -130.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = 25, pos = {x = 0.000000, y = 0.000000, z = 100.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = 26, pos = {x = 60.000000, y = 0.000000, z = 100.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = 9, pos = {x = 0.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = 30, pos = {x = -30.000000, y = 0.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = 31, pos = {x = 0.000000, y = -15.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = 32, pos = {x = 30.000000, y = -15.000000, z = -150.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - } - - }, - - { - units = { - {id = 0, pos = {x = 250.000000, y = 0.000000, z = 250.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - } - - }, - }, - civilianPlayer = { - - }, - skybox = "Skybox1", - terrain = {model = "w4.xml", albedo = "w4.jpg"}, - waterbodies = { - {pos = {x = 0.000000, y = 0.000000, z = 0.000000}, size = {x = 500.000000, y = 500.000000}, albedo = "water.png"}, } -} \ No newline at end of file diff --git a/Assets/Models/Maps/w5/minimap.jpg b/Assets/Models/Maps/w5/minimap.jpg deleted file mode 100644 index b43d18e..0000000 Binary files a/Assets/Models/Maps/w5/minimap.jpg and /dev/null differ diff --git a/Assets/Models/Maps/w5/w5.jpg b/Assets/Models/Maps/w5/w5.jpg deleted file mode 100755 index a1451cc..0000000 Binary files a/Assets/Models/Maps/w5/w5.jpg and /dev/null differ diff --git a/Assets/Models/Maps/w5/w5.lua b/Assets/Models/Maps/w5/w5.lua deleted file mode 100644 index f1bbd0a..0000000 --- a/Assets/Models/Maps/w5/w5.lua +++ /dev/null @@ -1,83 +0,0 @@ -metadata = { - lights = { - {type = 3, color = {x = 0.900000, y = 0.900000, z = 0.900000}}, - }, - size = {x = 1000.000000, y = 315.232758, z = 1000.000000}, - impassibleNodeValue = 65535, - spawnPoints = { - {x = -396.000000, y = 0.000000, z = -374.000000}, - {x = 300.000000, y = 0.000000, z = 400.000000}, - {x = -326.000000, y = 0.000000, z = 374.000000}, - }, - choosablePlayers = { - { - units = { - {id = 10, pos = {x = -20.000000, y = 0.000000, z = -20.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - {id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 300.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - }, - resourceDeposits = {} - }, - { - units = { - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_NAVAL_FACTORY, pos = {x = 0.000000, y = 0.000000, z = 0.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - {id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 450.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_LAND_FACTORY, pos = {x = 305.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, buildStatus = 100}, - --{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 440.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 435.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 280.000000, y = 0.000000, z = 430.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 460.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 465.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 450.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 455.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 440.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 430.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 435.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_MECH, pos = {x = 325.000000, y = 0.000000, z = 420.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 425.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 410.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 415.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 410.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 405.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_TANK, pos = {x = 325.000000, y = 0.000000, z = 400.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 355.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 350.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 355.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 350.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_ARTILLERY, pos = {x = 325.000000, y = 0.000000, z = 355.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_ANTI_SUB_CRUISER, pos = {x = -20.000000, y = 0.000000, z = -20.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_TRANSPORT, pos = {x = -20.000000, y = 0.000000, z = -20.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_TRANSPORT, pos = {x = -20.000000, y = 0.000000, z = -20.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - --{id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = 325.000000, y = 0.000000, z = 445.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - }, - resourceDeposits = {} - }, - { - units = { - {id = UnitId.ACS_CYBORG_ENGINEER, pos = {x = -325.000000, y = 0.000000, z = 415.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}}, - }, - resourceDeposits = {} - }, - --[[ - ]]-- - }, - civilianPlayer = { - resourceDeposits = { - {id = 0, pos = {x = 450.000000, y = 0.000000, z = 450.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - {id = 0, pos = {x = 450.000000, y = 0.000000, z = 430.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - {id = 0, pos = {x = 450.000000, y = 0.000000, z = 410.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - {id = 0, pos = {x = 450.000000, y = 0.000000, z = 390.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - --{id = 0, pos = {x = -450.000000, y = 0.000000, z = 350.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - --{id = 0, pos = {x = -450.000000, y = 0.000000, z = 360.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - --{id = 0, pos = {x = -450.000000, y = 0.000000, z = 370.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - --{id = 0, pos = {x = -450.000000, y = 0.000000, z = 380.000000}, rot = {w = 1.000000, x = 0.000000, y = 0.000000, z = 0.000000}, initAmmount = 20000}, - }, - - }, - skybox = "Skybox1", - terrain = {model = "w5.xml", albedo = "w5.jpg"}, - waterbodies = { - {pos = {x = -71.606972, y = -4.143668, z = 0.000000}, size = {x = 534.327454, y = 995.253296}, albedo = "water.png"}, } -} diff --git a/Assets/Scripts/Core/main.lua b/Assets/Scripts/Core/main.lua index 3c1fdea..7192bf6 100644 --- a/Assets/Scripts/Core/main.lua +++ b/Assets/Scripts/Core/main.lua @@ -1,4 +1,6 @@ game = {cpuPlayers = {}} +_minimapPos = {x = 0, y = 0} +_minimapSize = {x = 0, y = 0} GameObjectFrameStatus = { PLACEABLE = 0, BLOCKED_BY_FOG_OF_WAR = 1, diff --git a/Assets/Scripts/Gui/activeGameState.lua b/Assets/Scripts/Gui/activeGameState.lua index 99ed904..e03ec2c 100644 --- a/Assets/Scripts/Gui/activeGameState.lua +++ b/Assets/Scripts/Gui/activeGameState.lua @@ -29,7 +29,7 @@ end eyeIcon = 'eye.png' refIcon = 'refineds.png' minimapSize = {x = 200, y = 200} -minimapPos = {x = 0, y = res.y - minimapSize.y, z = .9} +minimapPos = {x = 0, y = res.y - minimapSize.y, z = .85} resTextScale = {x = .5, y = .5} resIconBasePath = 'Icons/Resources/' @@ -43,12 +43,18 @@ noSupplyTex = 'noSupply.png' noHackTex = 'noHack.png' gui = { + { + guiType = GuiType.GUI_RECTANGLE, + pos = {x = minimapPos.x, y = minimapPos.y, z = .8}, + size = minimapSize, + color = {x = .5, y = .5, z = .5, w = .6} + }, { guiType = GuiType.BUTTON, buttonType = ButtonType.MINIMAP, name = 'minimap', - pos = minimapPos, - size = minimapSize, + pos = {x = _minimapPos.x, y = minimapPos.y + _minimapPos.y, z = minimapPos.z}, + size = {x = _minimapSize.x, y = _minimapSize.y}, color = {x = .5, y = .5, z = .5, w = 1} }, { @@ -116,8 +122,10 @@ gui = { }, { guiType = GuiType.GUI_RECTANGLE, - pos = {x = minimapPos.x, y = res.y - .75 * sz, z = 0}, + pos = {x = minimapSize.x, y = res.y - .75 * sz, z = 0}, size = {x = res.x - minimapPos.x, y = sz * .75}, color = {x = .6, y = .6, z = .6, w = .4} }, + --[[ + ]]-- } diff --git a/Assets/Textures/Landmass/grass.jpg b/Assets/Textures/Landmass/grass.jpg new file mode 100644 index 0000000..44465f9 Binary files /dev/null and b/Assets/Textures/Landmass/grass.jpg differ diff --git a/inGameAppState.cpp b/inGameAppState.cpp index 23b23de..d627284 100755 --- a/inGameAppState.cpp +++ b/inGameAppState.cpp @@ -62,7 +62,7 @@ namespace battleship{ Map *map = Map::getSingleton(); map->load(mapName); - map->loadPlayersGameObjects(); + Map::Minimap::getSingleton()->load(); Camera *cam = Root::getSingleton()->getCamera(); cam->setPosition(Map::getSingleton()->getSpawnPoint(playerId) + Vector3(1, 1, 1) * configData::CAMERA_DISTANCE); diff --git a/map.cpp b/map.cpp index 3bc0d52..36447c0 100755 --- a/map.cpp +++ b/map.cpp @@ -43,16 +43,34 @@ namespace battleship{ } Map::Minimap::Minimap(){ - sol::state_view SOL_STATE_VIEW = generateView(); - SOL_STATE_VIEW.script_file(GameManager::getSingleton()->getPath() + "Scripts/Gui/activeGameState.lua"); + Vector3 mapSize = Map::getSingleton()->getMapSize(); + float ratio = mapSize.x / mapSize.z; - string refIconFile = SOL_STATE_VIEW["refIcon"]; + sol::state_view SOL_LUA_VIEW = generateView(); + SOL_LUA_VIEW.script_file(GameManager::getSingleton()->getPath() + "Scripts/Gui/activeGameState.lua"); + sol::table sizeTbl = SOL_LUA_VIEW["minimapSize"]; + float initSizeX = sizeTbl["x"], initSizeY = sizeTbl["y"]; + + if(ratio < 1){ + float x = initSizeX * ratio; + SOL_LUA_VIEW["_minimapPos"]["x"] = .5 * (initSizeX - x) ; + SOL_LUA_VIEW["_minimapSize"]["x"] = x; + SOL_LUA_VIEW["_minimapSize"]["y"] = initSizeY; + } + else{ + float y = initSizeY / ratio; + SOL_LUA_VIEW["_minimapPos"]["y"] = .5 * (initSizeY - y); + SOL_LUA_VIEW["_minimapSize"]["x"] = initSizeX; + SOL_LUA_VIEW["_minimapSize"]["y"] = y; + } + + string refIconFile = SOL_LUA_VIEW["refIcon"]; string basePath = GameManager::getSingleton()->getPath() + "Textures/Icons/Minimap/"; for(ResourceDeposit *rd : Game::getSingleton()->getCivilianPlayer()->getResourceDeposits()) depositIcons.push_back(initIcon(rd->getPos(), basePath + refIconFile)); - string camIconFile = SOL_STATE_VIEW["eyeIcon"]; + string camIconFile = SOL_LUA_VIEW["eyeIcon"]; camIcon = initIcon(Root::getSingleton()->getCamera()->getPosition(), basePath + camIconFile); } @@ -82,9 +100,13 @@ namespace battleship{ mat->addTexUniform("diffuseMap", tex, false); sol::state_view SOL_LUA_VIEW = generateView(); - sol::table posTbl = SOL_LUA_VIEW["minimapPos"], sizeTbl = SOL_LUA_VIEW["minimapSize"]; - Vector2 minimapSize = Vector2(sizeTbl["x"], sizeTbl["y"]); - Vector3 minimapPos = Vector3(posTbl["x"], posTbl["y"], posTbl["z"]); + sol::table posTbl = SOL_LUA_VIEW["minimapPos"], + _posTbl = SOL_LUA_VIEW["_minimapPos"], + sizeTbl = SOL_LUA_VIEW["minimapSize"], + _sizeTbl = SOL_LUA_VIEW["_minimapSize"]; + + Vector2 minimapSize = Vector2((float)_sizeTbl["x"], (float)_sizeTbl["y"]); + Vector3 minimapPos = Vector3((float)_posTbl["x"], (float)posTbl["y"] + (float)_posTbl["y"], (float)posTbl["z"]); Vector3 mapSize = Map::getSingleton()->getMapSize(); Vector2 iconPos = Vector2( @@ -95,9 +117,8 @@ namespace battleship{ Quad *quad = new Quad(iconSize, false); quad->setMaterial(mat); - Node *node = new Node(minimapPos + Vector3(iconPos.x, iconPos.y, .1) - .5 * iconSize); + Node *node = new Node(minimapPos + Vector3(iconPos.x, iconPos.y, .05) - .5 * iconSize); node->attachMesh(quad); - node->setVisible(false); root->getGuiNode()->attachChild(node); return node; @@ -187,7 +208,7 @@ namespace battleship{ minimapSize.y * (camPos.z + .5 * mapSize.z) / mapSize.z ); - camIcon->setPosition(minimapButton->getPos() + Vector3(iconPos.x, iconPos.y, .1)); + camIcon->setPosition(minimapButton->getPos() + Vector3(iconPos.x, iconPos.y, .06)); } void Map::Minimap::update(){ @@ -476,12 +497,31 @@ namespace battleship{ for(int i = 0; i < choosablePlayers.size(); i++){ sol::table playerTbl = SOL_LUA_VIEW[mapTable]["choosablePlayers"][i + 1]; loadPlayerGameObjects(choosablePlayers[i], playerTbl); + sol::table unitsTbl = playerTbl["units"]; + int numUnits = unitsTbl.size(); + + if(numUnits == 0){ + int engiId; + + switch(choosablePlayers[i]->getFaction()){ + case 0: + engiId = 9; + break; + case 1: + engiId = 11; + break; + case 2: + engiId = 13; + break; + } + + Vector3 sp = getSpawnPoint(choosablePlayers[i]->getSpawnPointId()); + choosablePlayers[i]->addUnit(GameObjectFactory::createUnit(choosablePlayers[i], engiId, sp, Quaternion::QUAT_W)); + } } sol::table civPlayerTbl = SOL_LUA_VIEW[mapTable]["civilianPlayer"]; loadPlayerGameObjects(game->getCivilianPlayer(), civPlayerTbl); - - Minimap::getSingleton()->load(); } void Map::preprareScene(bool empty){ @@ -657,6 +697,8 @@ namespace battleship{ for(int i = 0; i < numWaterbodies; i++) loadTerrainObject(i); + + loadPlayersGameObjects(); } void Map::create(string mapName, Vector3 mapSize){ diff --git a/mapEditorAppState.cpp b/mapEditorAppState.cpp index 2f83ec9..8a2f50d 100644 --- a/mapEditorAppState.cpp +++ b/mapEditorAppState.cpp @@ -63,16 +63,25 @@ namespace battleship{ generatePlane(size); } else{ - map->load(name); - - int numPlayers = map->getNumSpawnPoints(); - int numVerts = 3 * map->getNodeParent()->getChild(0)->getMesh(0)->getMeshBase().numTris; - oldLandmassVertHeights = new float[numVerts]; + int numPlayers = Map::getSingleton()->getNumMapSpawnPoints(name); for(int i = 0; i < numPlayers; i++) - game->addPlayer(new Player(0, 0, 0, Vector3(1, 1, 1))); + game->addPlayer(new Player(0, 0, 0, Vector3(1, float(i > 0), float(i > 1)), false, i)); - map->loadPlayersGameObjects(); + map->load(name); + + MeshData meshData = map->getNodeParent()->getChild(0)->getMesh(0)->getMeshBase(); + int minId = 0, numVerts = 3 * meshData.numTris; + oldLandmassVertHeights = new float[numVerts]; + + for(int i = 0; i < numVerts; i++){ + oldLandmassVertHeights[i] = meshData.vertices[i].pos->y; + + if(oldLandmassVertHeights[i] < oldLandmassVertHeights[minId]) + minId = i; + } + + map->setBaseHeight(oldLandmassVertHeights[minId]); } } @@ -412,16 +421,16 @@ namespace battleship{ Vector3 mapSize = map->getMapSize(), cellSize = map->getCellSize(); int width = int(mapSize.x / cellSize.x); int height = int(mapSize.z / cellSize.z); - int numChannels = 3; + int cellId = 0, numChannels = 3; int size = width * height * numChannels; - int cellId = 0; float baseHeight = map->getBaseHeight(); u8 *imgData = new u8[size]; for(u8 *p = imgData; p != imgData + size; p+= numChannels, cellId++){ float min = .6, max = 1.; - float heightFactor = min + (max - min) * (cells[cellId].pos.y - baseHeight) / mapSize.y; + float bottomCellHeight = cells[cellId].pos.y - map->getCellSize().y * cells[cellId].underWaterCellIds.size(); + float heightFactor = min + (max - min) * (bottomCellHeight - baseHeight) / mapSize.y; Vector3 color = (cells[cellId].type == Map::Cell::Type::WATER ? Vector3::VEC_K : Vector3::VEC_J); *p = color.x * heightFactor * 255.f;