Error with creating a new menu

Users who are viewing this thread

Trying to make a new menu for some caves in my mod.
This is the error:
Code:
Error in game menu:
('cave_east', [(541, '$current_town', 0, 4), (31, '$current_town', 'p_caves2')],
 'Go through the cave.', (1623, 'p_main_party', 'p_caves1'), 2040)

This is the code:
Code:
  (
    "cave_east",
    [
      (party_slot_eq,"$current_town",slot_party_type, spt_village),
      (eq, "$current_town", "p_caves2")
    ],
    "Go through the cave.",
      (party_relocate_near_party,"p_main_party","p_caves1"),
      (change_screen_return),
  ),

Please help.

Edit: I think i got it, i will have a look and report back.

Nevermind, this is the new code:
Code:
  (
    "cave_east",0,
    "The caves are dribling with water, and you think you can hear sounds inside.",
    [
      (party_slot_eq,"$current_town",slot_party_type, spt_village),
      (eq, "$current_town", "p_caves2")
    ],
    [
      ("Go through the cave.",
       [ (party_relocate_near_party,"p_main_party","p_caves1"),
         (change_screen_return),
        ]),
    ]
  ),
But it's still not working.
Please this is the last thing i need before my next release of the mod.

I also tried adding another option:
Code:
  (
    "cave_east",0,
    "The caves are dribling with water, and you think you can hear sounds inside.",
    [
      (party_slot_eq,"$current_town",slot_party_type, spt_village),
      (eq, "$current_town", "p_caves2")
    ],
    [
      ("Go through the cave.",
       [ (party_relocate_near_party,"p_main_party","p_caves1"),
         (change_screen_return),
        ]),
    ]
    [
      ("Go back.",
       [ (change_screen_return),
        ]),
    ]
  ),

Which gave me this error:
Code:
Traceback (most recent call last):
  File "process_global_variables.py", line 11, in <module>
    from process_operations import *
  File "H:\Program Files\Mount&Blade\ModuleSystem\process_operations.py", line 2
2, in <module>
    from module_game_menus import *
  File "H:\Program Files\Mount&Blade\ModuleSystem\module_game_menus.py", line 55
75, in <module>
    [ (change_screen_return),
TypeError: list indices must be integers
 
Ouch, badly placed brackets, it seems. Your have:

Code:
(
    "cave_east",0,
    "The caves are dribling with water, and you think you can hear sounds inside.",
    [
      (party_slot_eq,"$current_town",slot_party_type, spt_village),
      (eq, "$current_town", "p_caves2")
    ],
    [
      ("Go through the cave.",
       [ (party_relocate_near_party,"p_main_party","p_caves1"),
         (change_screen_return),
        ]),
    ]
    [
      ("Go back.",
       [ (change_screen_return),
        ]),
    ]
  ),

I think it should be simply:
Code:
(
    "cave_east",0,
    "The caves are dribling with water, and you think you can hear sounds inside.",
   "none",
    [
      (party_slot_eq,"$current_town",slot_party_type, spt_village),
      (eq, "$current_town", "p_caves2")
    ],
    [
      ("Go through the cave.",
       [ (party_relocate_near_party,"p_main_party","p_caves1"),
         (change_screen_return),
        ]),
    
    
      ("Go back.",
       [ (change_screen_return),
        ]),
    ]
  ),

Give that a go.

 
Back
Top Bottom