Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support scenario files in [scenario]map_file #4803

Closed
gfgtdf opened this issue Mar 14, 2020 · 3 comments · Fixed by #4804
Closed

support scenario files in [scenario]map_file #4803

gfgtdf opened this issue Mar 14, 2020 · 3 comments · Fixed by #4804
Labels
Enhancement Issues that are requests for new features or changes to existing ones.

Comments

@gfgtdf
Copy link
Contributor

gfgtdf commented Mar 14, 2020

currently the scenarios generated by the scenario editor mare ment to be inclused ina scenario via {./map/ediro_scenario.cfg}, i think it migth make sense to support them via [scenario]map_file, so if a .cfg file is given in map_file, the code the currently reads map_file would just call scenario.appens(read_cfg(scenaro["map_file"])).

There are some things im unsure about yrt though:

  1. shoudl we use map_file or a new key for things created by the scenario editor?
  2. Assuming we used the same key, should we try to detect whther its a scenario or not by the extension or by content?
@gfgtdf gfgtdf added the Enhancement Issues that are requests for new features or changes to existing ones. label Mar 14, 2020
@CelticMinstrel
Copy link
Member

I'd use extension rather than content to detect the format - if it's a .cfg, assume it's a scenario. If it's not a .cfg, assume it's a map.

Your existing implementation (searching for the string map_data) seems really inefficient, too.

@gfgtdf
Copy link
Contributor Author

gfgtdf commented Mar 14, 2020

Your existing implementation (searching for the string map_data) seems really inefficient, too.

Its efficient enough, its clearly not a botleneck here as both parsing the map and reading it from disk are much slower each.

Furthermore, this is also how the editor detects the type when a map is loaded. I think it totally makes sense that the the map_file implementation detects it in the same way as the editor.

@CelticMinstrel
Copy link
Member

Well, okay. I don't think it's a good method, but it does make sense to have consistency.

gfgtdf added a commit that referenced this issue Mar 15, 2020
* support scenario files in map_file

Now a scenario generated by the scenario editor can be loaded
just like a simple map file.

fixes #4803
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Issues that are requests for new features or changes to existing ones.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants