I am working on a game and want players to be able to place there own ships and islands into the game. I want players to be able to access folders which contain files which the ships use for configuration. How would I make and access these files?
1 Answers
i think you have to explain your question more to get more exact answer but i answer your question best i can.
technically its possible to let players modify directory of game their profile but i dont sujest that. if that was a music or a sound or something like that, you could just make a system for your game to play songs one after other like games like gta or other games menus. you can find that after a little search. but you are speaking of game content that needs to be controlled. is your game 3d or 2d? if its 3d should they be able to work with 3d modeling program? and you have to know after unity makes an output of your game, after players setup that, there will be no basic formats and unity packages them to assets format. its better to make a editor system for your game that players can modify what they want or choose what they want in game, as many games do this way.
this is example from unity official website. you can make your players add their files to your game:
// Opens a file selection dialog for a PNG file and overwrites any
// selected texture with the contents.
class EditorUtilityOpenFilePanel {
@MenuItem("Examples/Overwrite Texture")
static function Apply () {
var texture : Texture2D = Selection.activeObject;
if (texture == null) {
EditorUtility.DisplayDialog(
"Select Texture",
"You Must Select a Texture first!",
"Ok");
return;
}
var path = EditorUtility.OpenFilePanel(
"Overwrite with png",
"",
"png");
if (path.Length != 0) {
var www = WWW("file:///" + path);
www.LoadImageIntoTexture(texture);
}
}
}

- 549
- 11
- 30
-
Its a 2D game and what I mean is basicly a flat file of player added data which I load when the game loads – SteamPunk_Devil Feb 14 '15 at 16:48
-
Yeah it is and only windows currently – SteamPunk_Devil Feb 14 '15 at 16:51
-
1i think now just make an output of empty project and check how directory will be made. as i see my self project output there is some data unpackaged. game customize is big subject it depends on your own way to implement. is this multyplayer or single? – virtouso Feb 14 '15 at 16:55
-
1just wait a sec. i think best way for you is to have a open file dialog in your game. i think it is your best choice. i will edit my answer and tell you the code – virtouso Feb 14 '15 at 17:02