dstemmer
Knight at Arms
QUICK SCENE CHOOSER by dstemmer
Now at version 2! REQUIRES Python 2.6. Make sure to set your PATH variable correctly to point to your Python 2.6 directory.
This is a modding tool that allows you to jump to any scene defined in your module_scenes file from the quick battles menu, in order to make scene editing more convenient. Just select the “scene chooser” option to browse through an alphabetically organized list of scene files. Press the tab key to return to the menu.
Changes in version 2:
Changes in version 1:
Installation:
Repository link: http://www.mbrepository.com/file.php?id=1247
Note: the code you see may be indented differently than mine
Bugs:
There's a minor issue with flag strings not being output properly in all cases, but you won't see it. I'll fix it in the next release.
Comments:
I was inspired to make this mod after seeing a similar tool in the M&B repository designed by MAXHARDMAN, but I've never actually used his tool or looked at the code. I think his was for an older version. The code is freely reusable by anybody, no credit needed. Many thanks to the M&B modding community for helping me this far!
Now at version 2! REQUIRES Python 2.6. Make sure to set your PATH variable correctly to point to your Python 2.6 directory.
This is a modding tool that allows you to jump to any scene defined in your module_scenes file from the quick battles menu, in order to make scene editing more convenient. Just select the “scene chooser” option to browse through an alphabetically organized list of scene files. Press the tab key to return to the menu.
Changes in version 2:
- adds a list of scene flags to each scene option on the menu
Changes in version 1:
- bugfixed code
- includes game_menu_template.py, which allows the creation game menus with text and menu options dynamically generated from long lists. Uses standard python 2.6 string formatting notation. I'll write a tutorial when I get the chance, but for now you can examine the code - it's pretty easy to figure out how to do it.
Installation:
Repository link: http://www.mbrepository.com/file.php?id=1247
- Download "Quick scene chooser files.rar" from the repository. Unzip “template_tools.py” into your module directory:
- Add the following lines to the end of module_game_menus.py, after the last bracket:
Code:
import header_scenes
from template_tools import *
from module_scenes import scenes
sorted_scenes = sorted(scenes)
for i in xrange(len(sorted_scenes)):
current_scene = list(sorted_scenes[i])
current_scene[1] = get_flags_from_bitmap(header_scenes, "sf_", current_scene[1])
sorted_scenes[i] = tuple(current_scene)
choose_scene_template = Game_Menu_Template(
id="choose_scenes_",
text="Choose a scene: (Page {current_page} of {num_pages})",
optn_id="choose_scene_",
optn_text="{list_item[0]}{list_item[1]}",
optn_consq = [
(jump_to_scene, "scn_{list_item[0]}"),
(change_screen_mission)
]
)
game_menus += choose_scene_template.generate_menus(sorted_scenes)
- Use ctrl-f to search game_menus.py and find the following two lines, and copy/paste the code in red between them:
("custom_battle_scenario_6",[],"Siege Attack",
[
(assign, "$g_custom_battle_scenario", 4),
(jump_to_menu, "mnu_custom_battle_2"),
]
),
("choose_scene",[],"Scene Chooser",
[(jump_to_menu, "mnu_choose_scenes_0"),]
),
("go_back",[],"Go back",
[(change_screen_quit)]
),
[
(assign, "$g_custom_battle_scenario", 4),
(jump_to_menu, "mnu_custom_battle_2"),
]
),
("choose_scene",[],"Scene Chooser",
[(jump_to_menu, "mnu_choose_scenes_0"),]
),
("go_back",[],"Go back",
[(change_screen_quit)]
),
Note: the code you see may be indented differently than mine
- Then just build module and you're done!
Bugs:
There's a minor issue with flag strings not being output properly in all cases, but you won't see it. I'll fix it in the next release.
Comments:
I was inspired to make this mod after seeing a similar tool in the M&B repository designed by MAXHARDMAN, but I've never actually used his tool or looked at the code. I think his was for an older version. The code is freely reusable by anybody, no credit needed. Many thanks to the M&B modding community for helping me this far!