Auto-include all maps or all assets in folder?

Maps in my project have to be manually included, as for some stupid reason you cannot create a variable that is a reference to a map, so i load map by name. However, since there is no reference to the map, it does not package unless i put it in List to maps to include in a packaged build. Is there a way to automate this or will i have to do it manually for every single map?

You have to do it manually, because the whole point of this, is so that the system doesn’t try and package everything, including all your stuff from the asset store etc.

One thing you could do, is make an empty map and include all the other maps as sublevels of it. Then you only need to specify your persistent map in the list.

You can: the variable type is World:
image


The parse removes the level name extension (levelname.levelname); without doing it, the character will fall through the level.

You can try the two underlined settings:


For the second one, you would just put the directory of the levels.

1 Like

Thanks a million
Edit: Additional asset directories to cook does not work :‏‏‎(

1 Like

Found it! Add Primary asset types to scan, add map, with asset base class world, set directories to your main world file, make sure apply recursively and set cook rule to Always cook.

1 Like

Like this? This is not working for me.

Your reasoning is solid, however, the conclusion is not.

Just because we should avoid a scenario where a bunch of asset store demo maps get included, it does not mean that we should have to manually enter the directory of every single map in our game.

For example, we could allow for directories to be listed where all maps within them (and subdirectories) are automatically included. This way, if we tell the game to include all maps in “gamecontent/mymaps”, all the maps we want are included, while unwanted maps remain out.
This has the added benefit that every time we make a new map, we don’t have to go into the settings to add it to a list.