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:
(it could be any other) and then change it to:
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":
and change "the_happy_board" or "zendar_merchant" to the name of your scene. Like this:
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:
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:
#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:
and changed it to:
C) Using PASSAGEs:
#3 - Open "module_game_menus" and find Zendar menu block:
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:
#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.
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]]),
#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.