- Home /
Save and load levels in-game to be integrate with Steam Workshop
Hello,
I want to allow players to create their own levels using Unity. Those levels should be loadable within the game. I am used to adding scenes to the build index, which is not possible with those levels being added dynamically.
I am struggling to understand how to create scene / levels for my game and properly save them to a file so that the level can be loaded and then played afterward.
I appreciate any feedback, thanks.
Edit I need to allow the players to use the inspector and link objects with one another. I'm aiming for something like the Human Fall Flat level creation, where you ...
Design the level in Unity
Hit save on a custom button within Unity
Load the level inside the game, having a small teaser for the game
Script question: How to properly save the scene in order to load it later? How to load it?
Answer by rh_galaxy · 3 days ago
I don't know if it will be any help because my game maybe differs too much from yours. I have levels described in a text-file and then load them to the Game-scene when selected in the Menu-scene (so I have two scenes, and about 90 levels). Have both user-created levels and built in levels. My game is a 2D game viewed in 3D.
A sample of a level:
*MAPTYPE MISSION
*MAPSIZE 30 50
*MAPFILE mission10.txt
*TILESIZE 32
*TILESET ts_alien.tga
*MAXPLAYERS 2
*PLAYERSTARTPOS 771 1424
*PLAYERSTARTPOS 819 1431
*LANDINGZONE 768 1500 3 HOMEBASE NOEXTRALIFE ANTENNA
*LANDINGZONE 608 668 3 CARGOBASE NOEXTRALIFE ANTENNA 2 20 20
*LANDINGZONE 640 1372 3 CARGOBASE NOEXTRALIFE NOANTENNA 0
*ENEMY 2
*ANGLE 90
*FIREINTERVAL 1800
*SPEED 0
*NUMWAYPOINTS 1
*WAYPOINTSX 394
*WAYPOINTSY 824
*ENEMY 4
*ANGLE 0
*FIREINTERVAL 1800
*SPEED 75
*NUMWAYPOINTS 4
*WAYPOINTSX 1240 1240 1388 1388
*WAYPOINTSY 190 386 386 190
*ZOBJECT 1 373 323 0
*ZOBJECT 1 90 475 90
But the full source code is available here: https://github.com/rh-galaxy/galaxyvr
If you provide more info on the type of game that you are creating maybe I can help out more. However I don't use Steam Workshop, I have built a stand alone level-editor that shows the level created and you can place objects in the map and move them around.
Thanks for the feedback! I am not quite sure if this satisfies my requirements, so I will extend my initial question a bit :)
Your answer
Follow this Question
Related Questions
How to implement a loading screen for a procedurally-generated level? 1 Answer
My next scene is not loading , 2 Answers
Fade In each level 1 Answer
How to make an exit level trigger? 3 Answers
Scene overlapping on real device 1 Answer