B Tutorial Scenes Quick Scene Chooser

Users who are viewing this thread

Have gotten this to work with, WFaS module system 1.143.

In module_game_menu.py look around line 141 for.

Code:
      ("start_hard",[],"Hard",
       [
		    (options_set_damage_to_player, 2),  #    = 261 # (options_set_damage_to_player, <value>), #0 = 1/4, 1 = 1/2, 2 = 1/1
		    (options_set_damage_to_friends, 2), #    = 263 # (options_set_damage_to_friends, <value>), #0 = 1/2, 1 = 3/4, 2 = 1/1
		    (options_set_combat_ai, 0),         #    = 265 # (options_set_combat_ai, <value>), #0 = good, 1 = average, 2 = poor
		    (options_set_campaign_ai, 0),       #    = 267 # (options_set_campaign_ai, <value>), #0 = good, 1 = average, 2 = poor
		    (options_set_combat_speed, 4),      #    = 269 # (options_set_combat_speed, <value>), #0 = slowest, 1 = slower, 2 = normal, 3 = faster, 4 = fastest
			#(change_screen_return, 0),	
			(jump_to_menu, "mnu_start_game_1"),
        ]
       ),
After this set of code you can add line
Code:
("choose_scene",[],"Scene Chooser",
   [(jump_to_menu, "mnu_choose_scenes_0"),]
),

Should look like
Code:
      ("start_hard",[],"Hard",
       [
		    (options_set_damage_to_player, 2),  #    = 261 # (options_set_damage_to_player, <value>), #0 = 1/4, 1 = 1/2, 2 = 1/1
		    (options_set_damage_to_friends, 2), #    = 263 # (options_set_damage_to_friends, <value>), #0 = 1/2, 1 = 3/4, 2 = 1/1
		    (options_set_combat_ai, 0),         #    = 265 # (options_set_combat_ai, <value>), #0 = good, 1 = average, 2 = poor
		    (options_set_campaign_ai, 0),       #    = 267 # (options_set_campaign_ai, <value>), #0 = good, 1 = average, 2 = poor
		    (options_set_combat_speed, 4),      #    = 269 # (options_set_combat_speed, <value>), #0 = slowest, 1 = slower, 2 = normal, 3 = faster, 4 = fastest
			#(change_screen_return, 0),	
			(jump_to_menu, "mnu_start_game_1"),
        ]
       ),
	   
 ("choose_scene",[],"Scene Chooser",
   [(jump_to_menu, "mnu_choose_scenes_0"),]
),
      ("go_back_dot",[],"Go back.",
       [(change_screen_quit),
    ]
  ),
      ]
  ),
Then you can access scene chooser menu by selecting new game. Pretty close to same setup as user michmuch post on the page before.
 
When you place it within that menu, script_game_start gets called which might take a while. It's far better if you place it here
Code:
# This needs to be the fourth window!!!
  (
    "tutorial",mnf_disable_all_keys,"{!}Unused",
    "none",
    [(jump_to_menu, "mnu_choose_scenes_0"),],
    []
  ),
And change has_tutorial in module.ini from 0 to 1 so this option shows up.
 
Good time of day. Please correct the Repository link: http://www.mbrepository.com/modules/PDdownloads/viewcat.php?cid=3
Thank you.
 
Hello! I'm tring to make a Siege Multiplayer map, and I'm at this step, setting the quick scene chooser. But I'm finding problems. First, I think that, when you say to "put template_tools.py in your module folder", probably you intend in the Module System Folder, becouse if I put it in my new module folder (the one I'm creating) it raises many errors when building module. Then I putted it in the Module System Folder and il worked somehow. So if I'm right, please explain better where to put that file. instead, if I'm wrong, please tell me it doesn't work.

After that, I can't find a file named game_menus.py, but only module_game_menus.py, header_game_menus.py and process_game_menus.py. I have the last Warband version.
In the module_game_menus file, the lines that I must find with ctrl-F (even if I have to find them in that file) are commented. Is it all right? Or do I have to uncomment them? Or is not that file to change?

Thank you for support!

EDIT: well, with this tutorial works well everything. http://forums.taleworlds.com/index.php/topic,112508.0.html just correct some of yours instruction and it's allright.
 
I edited the code just as you guys said in the module_game_scenes.py, but it just doesn't work.

Here's the code I have.

Code:
(troop_clear_inventory, "$g_player_troop"),
        (troop_add_item, "$g_player_troop","itm_leather_jerkin",0),
        (troop_add_item, "$g_player_troop","itm_leather_boots",0),
        (troop_add_item, "$g_player_troop","itm_practice_sword",0),
        (troop_add_item, "$g_player_troop","itm_quarter_staff",0),
        (troop_equip_items, "$g_player_troop"),
        (set_visitor,0,"trp_player"),
        (set_visitor,32,"trp_tutorial_fighter_1"),
        (set_visitor,33,"trp_tutorial_fighter_2"),
        (set_visitor,34,"trp_tutorial_fighter_3"),
        (set_visitor,35,"trp_tutorial_fighter_4"),
        (set_visitor,40,"trp_tutorial_master_archer"),
        (set_visitor,41,"trp_tutorial_archer_1"),
        (set_visitor,42,"trp_tutorial_archer_1"),
        (set_visitor,60,"trp_tutorial_master_horseman"),
        (set_visitor,61,"trp_tutorial_rider_1"),
        (set_visitor,62,"trp_tutorial_rider_1"),
        (set_visitor,63,"trp_tutorial_rider_2"),
        (set_visitor,64,"trp_tutorial_rider_2"),
        (set_jump_mission,"mt_tutorial_training_ground"),
        (jump_to_scene,"scn_tutorial_training_ground"),
        (change_screen_mission),
        ]),
	  ("choose_scene",[],"Scene Chooser",
       [     
           (jump_to_menu, "mnu_choose_scenes_0"),
       ),
      ("go_back_dot",
      [],
      "Go back.",
       [
         (change_screen_quit),
       ]),
    ]
  ),

What did I do wrong?
 
I don't understand how it even compiles but it seems you messed up with the brackets.

IIUC, instead
Code:
	  ("choose_scene",[],"Scene Chooser",
       [     
           (jump_to_menu, "mnu_choose_scenes_0"),
       ),
should be
Code:
	  ("choose_scene",[],"Scene Chooser",
       [     
           (jump_to_menu, "mnu_choose_scenes_0"),
      ]),
 
Thank you for your help, but unfortunately it did not work even after the added bracket.

Perhaps I should just stick out of programming if I don't know how to do it? Or would someone be willing to take it through with me step-to-step?
 
I FOLOWED THE GUIDE BYT HAVE COMPILE ERORRS

Code:
Traceback (most recent call last):
  File "process_init.py", line 2, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_global_variables.py", line 12, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Traceback (most recent call last):
  File "process_map_icons.py", line 6, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Exporting faction data...
Exporting item data...
Traceback (most recent call last):
  File "process_items.py", line 66, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Exporting scene data...
Traceback (most recent call last):
  File "process_scenes.py", line 15, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Exporting troops data
Exporting particle data...
Traceback (most recent call last):
  File "process_scene_props.py", line 7, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_tableau_materials.py", line 8, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_presentations.py", line 8, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Exporting party_template data...
Traceback (most recent call last):
  File "process_parties.py", line 4, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Exporting quest data...
Exporting info_page data...
Traceback (most recent call last):
  File "process_scripts.py", line 7, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_mission_tmps.py", line 8, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_game_menus.py", line 5, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_simple_triggers.py", line 5, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_dialogs.py", line 9, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Traceback (most recent call last):
  File "process_global_variables_unused.py", line 3, in <module>
    from process_operations import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\p
rocess_operations.py", line 22, in <module>
    from module_game_menus import *
  File "C:\Games\Mount&Blade Warband1166\Modules\NativeMOD\Module_system 1.166\m
odule_game_menus.py", line 18211
    import header_scenes
    ^
IndentationError: unexpected indent
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .
 
it is saying specifically what the error is, you added "    " before "import header_scenes", and that is the unexpected indent the compiler is complaining about
 
Ikaguia said:
it is saying specifically what the error is, you added "    " before "import header_scenes", and that is the unexpected indent the compiler is complaining about


this is my new erro on compile

Code:
Initializing...
Compiling all global variables...
Error in game menu:
('choose_scene', [], 'Scene Chooser', [(2060, 'mnu_choose_scenes_0')])
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Exporting game menus data...
Traceback (most recent call last):
  File "process_game_menus.py", line 47, in <module>
    save_game_menus(variables,variable_uses,tag_uses,quick_strings)
  File "process_game_menus.py", line 26, in save_game_menus
    ofile.write("menu_%s %d %s %s"%(game_menu[0],game_menu[1],string.replace(gam
e_menu[2]," ","_"),game_menu[3]))
TypeError: %d format: a number is required, not list
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
Imported 56 global variables for saved-game compatability that are not used.
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .



where the hell must i put this
??

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)

 
That last bit you posted goes at the end of module_game_menus.py.
Don't know about your compiler error? Maybe I'm just being dumb but implementing this in my mod sys worked right away. If you have such basic problems maybe read up about the mod sys.
 
Back
Top Bottom