A small guide to add scenes to the game (UPDATED - 16/11)

Users who are viewing this thread

Elias_Maluco

Regular
UPDATE 16/11:

With a little help from the man himself, I was finally able to edit the target of "passage" objects. Now nothing can stop us from creating huge, complex towns and building with multiple scenes!

This is a very begginer step-by-step guide to add new, accessible, scenes to "M&B". It may help people like me, who are just beggining to mess with the module tools.

CREATING THE SCENE AND ADDING A REFERENCE TO IT:

#1 - Create your scene .sco file by copying another sco from SceObj folder. For this guide, I will create a copy of "scn_zendar_merchant.sco" and rename it to "scn_house.sco".

#2 - Open "modules_scenes.py" and create a copy of another scene line and then rename it to match your new scene´s name. I will copy the line:


Code:
 ("rivacheg_merchant",sf_indoors, "thirsty_lion", "bo_thirsty_lion", (-100,-100),(100,100),-100,"0", 
    ["exit"],[]),

(it could be any other) and then change it to:


Code:
  ("house",sf_indoors,"thirsty_lion", "bo_thirsty_lion", (-100,-100),(100,100),-100,"0", 
    ["exit"],[]),


The first word in this line is the name of the scene and have to match the name you gave to the .sco file without the prefix "scn_", which is added when you build the module. Since my sco file is called "scn_house.sco", I have to use "house" has the scene´s name. If I have to reference this scene from any other file, like "module_troops.py", for example, I have to use the complete name, "scn_house", not just "house".

MAKING THE SCENE ACCESSIBLE:

A) Using Doors:

(these "doors" are those door we can see in most places. There seens to be no way to change, move, or add doors. There´s are also many doors that arent "real" doors, just decoration)

#3: Find this line on "module_scenes":

Code:
 ("zendar_center",0,"sargoth_square", "bo_sargoth_square", (-40,-40),(21,13),-100,"0", 
    ["the_happy_boar","","zendar_merchant"],[]),


and change "the_happy_board" or "zendar_merchant" to the name of your scene. Like this:


Code:
("zendar_center",0,"sargoth_square", "bo_sargoth_square", (-40,-40),(21,13),-100,"0", 
    ["the_happy_boar","","house"],[]),


Important: this will not change what scenes are accessible trough "PASSAGE" objects in Zendar, will only change what scenes are accessible trough the doors of Zendar. If you replace "zendar_merchant", the door that used to lead to the merchant will now lead to your scene. The merchant, however, is still accessible trough a "PASSAGE" object assigned to the number 2 (if you replace the merchant, you dont need to add a passage object to it, since Zendar already have one at the next door after the merchant door).

4# Find the line of your scene and change "exit" to "zendar_center". Like this:


Code:
("house",sf_indoors,"thirsty_lion", "bo_thirsty_lion", (-100,-100),(100,100),-100,"0", 
    ["zendar_center"],[]),

B) From any menu-driven town:

#3 - Open "modules_game_menus.py" and find the city where you want to add your scene. Each town has its own menu block. I will add it to Rivacheg, so I find this block:


Code:
    "rivacheg",0, 
    "You enter the Vaegir town of Rivacheg.", 
    "none", 
    [[reset_price_rates],[set_price_rate_for_item,"itm_dried_meat",60],[set_price_rate_for_item,"itm_oil",130]], 
    [ 
      ("rivacheg_castle",[],"Go to the Count's castle.",[[set_jump_mission,"mt_town_default"], 
                                                       [jump_to_scene,"scn_rivacheg_castle"], 
                                                       [change_screen_mission]]), 
      ("rivacheg_tavern",[],"Visit the tavern.",[[set_jump_mission,"mt_town_default"], 
                                                       [jump_to_scene,"scn_willows_kitchen"], 

      ("rivacheg_smithy",[],"Visit the smithy.",[[set_jump_mission,"mt_town_default"], 
                                                       [jump_to_scene,"scn_rivacheg_smithy"], 
                                                       [change_screen_mission]]), 
      ("rivacheg_merchant",[],"Speak with the Merchant.",[[set_jump_mission,"mt_town_default"], 
                                                       [jump_to_scene,"scn_rivacheg_merchant"], 
                                                       [change_screen_mission]]), 
      ("rivacheg_leave",[],"Leave town.",[[leave_encounter],[change_screen_return]]), 
    ] 
  ),

#4 Now, make a copy of any other option and change its name, the text will want to appear on the game and the scene to load. I made a copy of this line:


Code:
("rivacheg_tavern",[],"Visit the tavern.",[[set_jump_mission,"mt_town_default"], 
                                                       [jump_to_scene,"scn_willows_kitchen"], 
                                                       [change_screen_mission]]),

and changed it to:


Code:
("house",[],"Go to your house.",[[set_jump_mission,"mt_town_default"], 
                                                       [jump_to_scene,"scn_house"], 
                                                       [change_screen_mission]]),
C) Using PASSAGEs:

#3 - Open "module_game_menus" and find Zendar menu block:

Code:
  (
    "zendar",mnf_auto_enter,
    "You enter the town of Zendar.",
    "none",
    [[reset_price_rates],[set_price_rate_for_item,"itm_tools",70],[set_price_rate_for_item,"itm_salt",140]],
    [
      ("zendar_enter",[],"Enter Marketplace",[[set_jump_mission,"mt_town_default"],[jump_to_scene,"scn_zendar_center"],[change_screen_mission]]),
      ("zendar_tavern",[],"Visit the tavern.",[[set_jump_mission,"mt_town_default"],
                                                   [jump_to_scene,"scn_the_happy_boar"],
                                                   [change_screen_mission]]),
      ("zendar_merchant",[],"Visit the merchant.",[[set_jump_mission,"mt_town_default"],
                                                   [jump_to_scene,"scn_zendar_merchant"],
                                                   [change_screen_mission]]),
                                                       [jump_to_scene,"scn_house"],
                                                       [change_screen_mission]]),  
      ("town_1_leave",[],"Leave.",[[leave_encounter],[change_screen_return]]),
    ]
  ),

We cant see this menu on the game, but it is used to set the target of any PASSAGE object used in Zendar. All passage object have a "variation" numbar assigned to it, and this number refers to the position of a menu item in the location menu block. So passage 0, in Zendar, leads back to Zendar, passage 1 leads to the inn and passage 2 leads to the merchant.

#4 - Add your scene to the menu. Like that:

Code:
  (
    "zendar",mnf_auto_enter,
    "You enter the town of Zendar.",
    "none",
    [[reset_price_rates],[set_price_rate_for_item,"itm_tools",70],[set_price_rate_for_item,"itm_salt",140]],
    [
      ("zendar_enter",[],"Enter Marketplace",[[set_jump_mission,"mt_town_default"],[jump_to_scene,"scn_zendar_center"],[change_screen_mission]]),
      ("zendar_tavern",[],"Visit the tavern.",[[set_jump_mission,"mt_town_default"],
                                                   [jump_to_scene,"scn_the_happy_boar"],
                                                   [change_screen_mission]]),
      ("zendar_merchant",[],"Visit the merchant.",[[set_jump_mission,"mt_town_default"],
                                                   [jump_to_scene,"scn_zendar_merchant"],
                                                   [change_screen_mission]]),
      ("zendar_house",[],"Enter Small House",[[set_jump_mission,"mt_town_default"],
                                                       [jump_to_scene,"scn_house"],
                                                       [change_screen_mission]]),  
      ("town_1_leave",[],"Leave.",[[leave_encounter],[change_screen_return]]),
    ]
  ),

#5 - Now run the game, go to Zendar and enter edit mode. Then insert a PASSAGE object and assign its variation number (using the numpad +/-) to the position you placed the item in the menu (its starts at 0, not 1).
Since I placed the item that refers to my house at the fourth position in the menu, I will assign the PASSAGE to number 3. This passage will now lead to my house.

Thanks a lot Armagan, for explaining to me how the passages really work.
 
Thanks this really helped me .
I tryed making my own house befor but i never made a 'scn_house.sco' file.good work.
 
That's pretty much how I made a new terrain based arena map (unreleased and currently very unfinished). Only difference is I didn't have to mess with "modules_game_menus.py".

It's cool having people come out with these decent guides (since I've been too lazy to myself). :smile:
 
Is it possible to create new Passage objects like the ones mentioned by Elias?

Also, I see that you can make new scenes in place of the tavern and the merchant in Zendar. Can you also change the "exit the town" location in Zender? Instead of exiting the town and sending the player to the world map, it would send the player to another part of Zendar perhaps... The player could always press the Tab key to leave Zendar.

Basically I'm interested in how to link new scenes to the towns. I've seen some threads, but nothing that makes it plain.


Thanks,
Supra
 
Is it possible to create new Passage objects like the ones mentioned by Elias?

Also, I see that you can make new scenes in place of the tavern and the merchant in Zendar. Can you also change the "exit the town" location in Zender? Instead of exiting the town and sending the player to the world map, it would send the player to another part of Zendar perhaps... The player could always press the Tab key to leave Zendar.

Ive been trying and experimenting a bit with scenes, passage objects and such, and our possiblities on this field seens a bit limited so far.

We can change the target scene of any door in any scene in the game by changing its list of accessible places in "module_scenes", but since we cant add new doors or even move the existing ones, this is not very usefull. Those exits from Zendar seens to work like the doors, in the way we also cant add new ones or change their location. But I could not find a way to change its function like you said.

I messed a lot with those passage objects and they dont work has described in "module_scenes". I even sent a PM to Armagan about it and the man was kind enough to awnser me:

You are right. I have made a mistake with the documentation for the passages. In truth, the passage's variation-no selects the menu-item in the current town's game menu. I'll correct the documentation in the next version.

Well, there inst a menu for Zendar in the game, but it have one in "module_game_menus", just like any other town. This menu has 3 items (and the exit): the first sends you back to Zendar (useless), the second to the inn, the third to the merchant. And of course, Zendar has 3 working passage objects: passage variation 0 leads back to Zendar, variation 1 to the inn, 2 to the merchant.

So, on theory, we could change this menu to change the passage target scenes. I havent tried it yet, but I guess it should work. And if it does, it will be possible not only to expand Zendar, but to create other walkable, complex town, with functional passages, by creating and editing those town menus.
 
Heck, I just tryied it and it really works!

I was able to access a scene (that same house) from Zendar using passage object variation 3 and adding an item to the scene in Zendar menu block at "module_game_menus". Im updating the guide to include this.

Thanks a lot, Armagan, for awsering my message. You are the champion of all game programmers.
 
Nope and neither does the in-game edit mode, which is a serious shame. I think your meant to edit the scenes using v.751 where it works and try to understand the code in game_menus on your own. It's a shame that neither armagan nor Winter want to update the python documentation, (hint hint).
 
In 808? On my computer the toolbar is glitchy, it kinda appears and then disappears since M&B is kinda maximised, to the moment I've only realised how to minimise M&B and not put it into windowed mode  :cry:
 
And if you want to switch between full-screen and windowed while the game's running, you can use Alt-Enter. In fact, that key combination works in a lot of programs, not just M&B.
 
Dunno, i alwasys use alt+enter but with me in M&B it just minimises and not puts into windowed mode. But now everything works alright.

BTW you can use the combo: windows button+d to minimise to desktop most programs, not M&B or most other games though.
 
Well I'd like to learn how to create new entries but when I go to module_game_menus.py I CAN"T FIND
    "rivacheg",0,
    "You enter the Vaegir town of Rivacheg.",
    "none",
    [[reset_price_rates],[set_price_rate_for_item,"itm_dried_meat",60],[set_price_rate_for_item,"itm_oil",130]],
    [
      ("rivacheg_castle",[],"Go to the Count's castle.",[[set_jump_mission,"mt_town_default"],
                                                      [jump_to_scene,"scn_rivacheg_castle"],
                                                      [change_screen_mission]]),
      ("rivacheg_tavern",[],"Visit the tavern.",[[set_jump_mission,"mt_town_default"],
                                                      [jump_to_scene,"scn_willows_kitchen"],

      ("rivacheg_smithy",[],"Visit the smithy.",[[set_jump_mission,"mt_town_default"],
                                                      [jump_to_scene,"scn_rivacheg_smithy"],
                                                      [change_screen_mission]]),
      ("rivacheg_merchant",[],"Speak with the Merchant.",[[set_jump_mission,"mt_town_default"],
                                                      [jump_to_scene,"scn_rivacheg_merchant"],
                                                      [change_screen_mission]]),
      ("rivacheg_leave",[],"Leave town.",[[leave_encounter],[change_screen_return]]),
    ]
  ), 
I see thye only one for Zendar and thats it
However you wrote about modules_game_menus.py NOT module_game_menus.py
Is my modulesystem missing one file??
 
Larhendiel said:
However you wrote about modules_game_menus.py NOT module_game_menus.py
Is my modulesystem missing one file??
No, that tutorial was for a much older version of Mount and Blade. The current version of Mount & Blade treats all towns as the same, and there's a rather more complex menu in module_game_menus.py under "town" which fits all towns and castles.
 
So...... what can I do, how can I add new scenes, passages and NPC's into my cities?? I created massive complex and there is so much emptiness on the streets....
And I wonna build brothel!!
 
Larhendiel said:
So...... what can I do, how can I add new scenes, passages and NPC's into my cities?? I created massive complex and there is so much emptiness on the streets....
And I wonna build brothel!!
I'd suggest you begin by resurrecting Zendar, or making another new place from scratch along the same sort of lines. Get rid of the pf_disabled flag on it in module_parties and you should be able to make a start. That'll give you a city you can modify on your own terms relatively straightforwardly.

Tearing down the established town structure and replacing it is a large undertaking, and one that requires a fair knowledge of coding.
 
Back
Top Bottom