Open Custom Level On File Acess

Godot Version

godot 4

Question

Hello! so this year for school we can borrow an argument or project. Im making a rhythm game but thats not the point… I wanted to create a file dialog for adding files (mods) so anyone can create a level. But also i would like to create a level editor. The problem is that i never done an editor like kinda thing. So far i made a menu, shop and level selector with one working level. Yes, today im a lil more precise with the topic bc as i said its for an exam. (if im not taking this then i will borrow south korea or godot engine explaination)
melting_face

(if its possible can the level be a text doucment?)

You can generate a level based on text files, in fact the standard .tscn files are text, you can open them in a regular text editor and read them.

For modding it will be easiest to use paths that start with user:// instead of res://, these paths point to user data which is not packed with the game so it can be read from and written too by players.

Sorry for being late I had exams. But thanks for the response. I know about the .tscn files being text files but idk I thought about like documents .txt or like .XML like FNF does. But I will try with .tscn :slight_smile: .

Oh right. How do I like make a in game button for importing the levels?? ( I know to do it only with images :slight_smile: )

A FileDialog node allows users to select files, it has signals such as file_selected you can use to then open the file.

I only mention .tscn as an example of a text file that is read to generate levels. You probably shouldn’t use that format. Other games do use XML as well, also a good example.

What are you doing to create levels right now? Is it run-time compatible? Otherwise you may have to convert to a simpler non-godot format.

So right now im making the basic levels in the game (mostly finishing the first) and im creating all into .tscn. But ive been thinking someone could be wanting other levels so i created the mods section. I didnt think much as like i didnt create it. Now that you told me about the file selection is great as like im making a free to mod game. But i never used it for tscn or any other files, ive done it only for images. So i dont really know…