Playing as a Lord script(Request Bugfix)

Users who are viewing this thread

ThaneWulfgharn

Master Knight
Hi,I made a "Play as a Lord" Script,but it has some bugs:
  ("start_game_0",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "Welcome, adventurer, to Mount and Blade: Warband. Before beginning the game you must create your character. Remember that in the traditional medieval society depicted in the game, war and politics are usually dominated by male members of the nobility. That does not however mean that you should not choose to play a female character, or one who is not of noble birth. Male nobles may have a somewhat easier start, but women and commoners can attain all of the same goals -- and in fact may have a much more interesting if more challenging early game.",
    "none",
    [],
    [
    ("continue",[],"Create a Character.",
      [(jump_to_menu, "mnu_start_game_1"),
        ]
      ),
    ("continue",[],"Choose a Character",
      [(jump_to_menu, "mnu_choose_character"),
        ]
      ),
      ("go_back",[],"Go back",
      [
        (change_screen_quit),
      ]),
    ]
  ),

  ("choose_character",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "Choose one of the characters of the legend.",
    "none",
    [],
    [
  ("choose_character",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "Choose one of the characters of the legend.",
    "none",
    [],
    [
    ("continue",[],"Sir Lancelot.",
      [(set_player_troop, "trp_knight_1_8"),
        (jump_to_menu, "mnu_start_phase_2"),
        ]
      ),
      ("go_back",[],"Go back",
      [
        (change_screen_quit),
      ]),
    ]
  ),

Works on cases:
-I enter a castle,town,battle and such

Both correct and bug:
-When entering Sir Lancelot's castle(Tevarin Castle) I spawn on the place Sir Lancelot must spawn,and he spawns where the player must spawn.
-Correct because there's where I must spawn,
-Bug because the other Lancelot musn't be ingame at all.
The bugs are:
-King Arthur won't recognize me as a vassal
-There is another Sir Lancelot with his castle and his party
-I have no fiefs,wife,child,no army,and on my party it shows a naked guy,with bad face(error face) and with his name  .
-On the Characters List there's this nameless naked guy which appears for me.
-After finishing character creation(in Create a Character,before going to mnu_start_phase_2,it goes to mnu_choose_charater and in any case,I'm forced to choose a character).
 
I've seen set_player_troop only used in quick battles (Native) and missions (Rubik's CC).

I guess you need to do at least two things for that to work for the whole SP campaign:
- replace trp_player with $g_player_troop everywhere (and initialize $g_player_troop correctly)
- in every loop that goes through the lords, you need to add an exception like this:
(neq, ":lord", "$g_player_troop")

Could be more than that, but it already looks painful to do.
You are better off scripting the starting equipment and any fiefs etc. explicitely and retain trp_player.
 
ThaneWulfgharn said:
MadVader said:
- in every loop that goes through the lords, you need to add an exception like this:
(neq, ":lord", "$g_player_troop")
What loops?
This kind of loops:
(try_for_range, ":lord", original_kingdom_heroes_begin, active_npcs_end),

That kind of problem is why you get two versions of yourself in the castle scene. Not to speak of many other hidden problems, the lord loops are everywhere in the code. Don't bother with set_player_troop, it's not worth it, except in missions.
 
Back
Top Bottom