From a085d15d418a625479603ddf658cc11747ea83cc Mon Sep 17 00:00:00 2001 From: Lynn Date: Thu, 25 Oct 2018 20:08:30 +0200 Subject: [PATCH] Added documentation on how to add a new scenario --- docs/Index.md | 3 ++- docs/NewScenario.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 docs/NewScenario.md diff --git a/docs/Index.md b/docs/Index.md index d47ec0a7..02053b6e 100644 --- a/docs/Index.md +++ b/docs/Index.md @@ -1,5 +1,6 @@ ## RedMew Documentation Index - [Installing and Using the RedMew Scenario](Installation.md) + - [Creating a New Scenario Using the RedMew Framework](NewScenario.md) -### Scenarios +### Scenario Specific Documentation - [Diggy Installation and Configuration](scenarios/Diggy.md) diff --git a/docs/NewScenario.md b/docs/NewScenario.md new file mode 100644 index 00000000..87774181 --- /dev/null +++ b/docs/NewScenario.md @@ -0,0 +1,28 @@ +## Creating a New Scenario Using the RedMew Framework +To add a new scenario and make it available to everyone that wants to use RedMew, make a Pull Request on github to +request adding your scenario to the repository. + +### Starting From Scratch +Depending on the size of the scenario, it could be desired to have its own dedicated directory. By default a scenario +is added in `map_gen/combined/your_scenario.lua`. + +#### Step 1 +If you're not experienced with git, it's advised to read up on how git works first or ask someone else to help out. To +get your change into the repository, you need to [fork the repository](https://help.github.com/articles/fork-a-repo/) +and eventually make your Pull Request from there. [Clone](https://help.github.com/articles/cloning-a-repository/) the +fork to your local environment and get your favorite IDE or Editor ready. + +#### Step 2 +Small scenarios can go into a single lua file, bigger scenarios might need their own dedicated directory. To follow the +RedMew structure for scenarios, create your scenario file: `map_gen/combined/your_scenario_file.lua`. + +#### Step 3 (Optional) +If you plan on making a bigger scenario, create a directory: `map_gen/combined/your_scenario_file/` where you can place +your scenario specific lua files. + +#### Step 4 +Regardless, the `map_gen/combined/your_scenario_file.lua` file will be the entry point for your scenario and will be +loaded via `map_layout.lua`. Underneath `--combined--`, add your require: `require map_gen.combined.your_scenario_file`. + +When making the Pull Request, make sure to comment the require in `map_layout.lua` as by default it should be off. To +enable debugging and get some extra feedback during development, enable `_DEBUG` in `config.lua`.