Game Dev Studio

Game Dev Studio

View Stats:
jhorves Dec 9, 2018 @ 11:10am
Using a Created Map
I created a map with the map editor, and saved it. However, when I go into maps to start a new game it's not there. I'm assuming this is something intentional, so I tried to make a tiny mod that would just add this map to the list, but I can't figure out how to. Does anyone know how to add a map to the selection you get for freeplay?
< >
Showing 1-2 of 2 comments
sрy  [developer] Dec 10, 2018 @ 1:12am 
first you need to register the map, you can do this by doing:
maps:registerNew({ id = "unique_map_id", path = "map_file_name" })

then, you need to get the Freeplay gametype data and append your map data to it:

-- get the gametype data local freeplay = game.getGameTypeData("freeplay") -- append the new map selection config to it table.insert(freeplay.mapConfigs, { file = "unique_map_id", -- this is actually the map ID, not the file name name = _T("MY_UNIQUE_MAP_NAME", "My Map Name"), -- the first value is the translation key, the second value is the text that will be displayed, in reality this is necessary only if your mod will feature translations for other languages; if not, you can have a regular string rivals = { -- a list of rival company IDs, refer to the files in game/rival_game_companies for more info "rival_company_1", "rival_company_2", "rival_company_3" }, rivalBuildings = { -- a map which maps a rival to a building on the map, key is the rival ID, value is the building ID rival_company_1 = "some_office_id" rival_company_2 = "other_office_id", rival_company_3 = "another_office_id" }, startingEmployees = { {role = "software_engineer", level = {3, 5}, repeatFor = 2}, {role = "software_engineer", level = 6}, {role = "designer", level = 4}, {role = "manager", level = 4}, {role = "sound_engineer", level = 5}, {role = "artist", level = 4}, }, startMoney = 1000000 -- start out with this much money })

the above should work, but you'll need to change the values in the rivalBuildings table (since the building IDs I entered there are invalid and are just examples), the building IDs are displayed in the map editor, so make sure you enter the right ones, otherwise it will crash
Last edited by sрy; Dec 10, 2018 @ 1:15am
Nazem Hadad Oct 7, 2019 @ 8:27pm 
how would one access this file? Been trying for a bit.
< >
Showing 1-2 of 2 comments
Per page: 1530 50