OSP Kit SP Port in Scenes

Users who are viewing this thread

13exa

Knight at Arms
Port In Scenes

Almost One years ago, Ruthven make a Tutorial for Sea Battles. He made the port, but not with the scenes. Now, I had Idea to "convert" Game Menus to a Scenes  :grin:.

I had made Port Scenes:
mb2n.jpg
mb3d.jpg

It was Include the Shipwright, Slave Trader and Friendly Bandit in this scene if you not just download the Port, but with Code of Python too like in below of this text. But I doesn't include the sea battles too in here, I just "convert" Ruthven Game Menus Port  :mrgreen:

What do you need:
1. Few skill of coding
2. Python
3. Module System of Warband
4. My Port Scenes -- You can download it at http://www.mediafire.com/?45b3ow08jan188d

File You need to Edit
-SceneObj
-module_dialogs.py
-module_game_menus.py
-module_scenes.py
-module_troops.py
-module_strings.py

1. After you download my port scenes, Copy the scn_port.sco to your SceneObj Folder in Mod Directory.
Then, Go to your Module System, Find file of python named module_scenes.py, go to the bottom of that file.

Write this before the last bracket (" ] ") in the bottom of file.
Code:
#Exa OSP
#Port In Scenes
("port",sf_generate,"none", "none", (0,0),(100,100),-100,"0x00000002300015e300063d8800002757000055df00001b08",
    [],[],"sea_outer_terrain_1"),

2. Great! Now you had a port scenes!  :grin:. Now, save the module_scenes.py. Open module_troops.py, Go to the bottom of Troops List not to the bottom of the file!

Make sure you found the last bracket above "Troop upgrade declarations". If you found, before the last bracket, copy this:
Code:
#Exa's OSP
#Port in Scenes - Troop
["port_keeper", "Shipwright", "Shipwrights", tf_male|tf_hero|tf_is_merchant, scn_port|entry(14), reserved, fac_neutral, [itm_leather_boots,itm_leather_vest,itm_leather_apron,itm_gambeson,itm_blue_gambeson,itm_red_gambeson,itm_leather_jerkin], def_attrib|level(2), wp(20), knows_common,swadian_face_younger_1,swadian_face_middle_2],
 ["port_recruiter", "Sea Raider Captains", "SR Captains", tf_hero, scn_port|entry(13), reserved, fac_neutral, [itm_arrows,itm_sword_viking_1,itm_sword_viking_2,itm_fighting_axe,itm_battle_axe,itm_spear,itm_nordic_shield,itm_nordic_shield,itm_nordic_shield,itm_wooden_shield,itm_long_bow,itm_javelin,itm_throwing_axes,itm_nordic_helmet,itm_nordic_helmet,itm_nasal_helmet,itm_mail_shirt,itm_byrnie,itm_mail_hauberk,itm_leather_boots,itm_nomad_boots], def_attrib|level(24), wp(110), knows_ironflesh_2|knows_power_strike_2|knows_power_draw_3|knows_power_throw_2|knows_riding_1|knows_athletics_2, bandit_face1, bandit_face2 ],
["port_slave_trader", "Slave Trader", "Slave Traders", tf_hero|tf_randomize_face, scn_port|entry(15), reserved, fac_commoners, [itm_leather_jacket,itm_hide_boots], def_attrib|level(5), wp(20), knows_common,swadian_face_younger_1,swadian_face_middle_2],

3. Yeah, You had the Shipwright, Friendly Bandit and a Slave Trader, save your module_troops.py. Now they need their Dialogs, Open your module_dialogs.py.

On the top of dialog list, Copy this after the first bracket:
Code:
#Exa's OSP
#Port in Scene

#Shipwright Begin
  [trp_port_keeper, "start",
   [],
   "What do you want, {sir/lady}?", "port_keeper",
   []],
  [trp_port_keeper|plyr, "port_keeper",
   [],
   "Hi, Im {playername}. Who are you?", "port_keeper-2",
   []],
    [trp_port_keeper, "port_keeper-2",[(try_begin),
(eq,"$current_town","p_town_1"),
(str_store_string,s12,"@Eric"),
(else_try),
(eq,"$current_town","p_town_2"),
(str_store_string,s12,"@Bjorn"),
(else_try),
(eq,"$current_town","p_town_6"),
(str_store_string,s12,"@Lucas"),
(else_try),
(eq,"$current_town","p_town_12"),
(str_store_string,s12,"@Gunnar"),
(else_try),
(eq,"$current_town","p_town_13"),
(str_store_string,s12,"@Olaf"),
(else_try),
(eq,"$current_town","p_town_19"),
(str_store_string,s12,"@Fadhlan"),
(else_try),
(eq,"$current_town","p_town_15"),
(str_store_string,s12,"@David"),
(try_end),
],
     "Im {s12}, I work in here as Shipwright.", "port_keeper-3",
   []],
  [trp_port_keeper|plyr, "port_keeper-3",[],"I want to buy a ship", "port_keeper_buy_ship",[]],
  [trp_port_keeper|plyr, "port_keeper-3",[],"Hmmm.. Bye", "close_window",[]],

  [trp_port_keeper, "port_keeper_buy_ship",[],"Sure, I want 5000 Denars for My ship.", "port_keeper_buy_ship_2",[]],
  [trp_port_keeper|plyr, "port_keeper_buy_ship_2",[(store_troop_gold,":money","trp_player"),(ge,":money",5000),],"Here is your 5000 Denars", "port_keeper_buy_ship_3",[]],
  [trp_port_keeper|plyr, "port_keeper_buy_ship_2",[(store_troop_gold,":money","trp_player"),(ge,":money",5000),],"It was very Expensive! No Deal", "close_window",[]],
  [trp_port_keeper|plyr, "port_keeper_buy_ship_2",[(store_troop_gold,":money","trp_player"),(lt,":money",5000),],"I don't have much money like that", "port_keeper_teu_boga_duit",[]],

  [trp_port_keeper, "port_keeper_teu_boga_duit",[],"Well, Sorry. I need money for feed my self and family.", "close_window",[]],
  
  [trp_port_keeper, "port_keeper_buy_ship_3",[],"Nice to have bussiness with you.", "close_window",[
        (troop_remove_gold,"trp_player",5000),
        (assign, "$g_player_icon_state", pis_ship),
        (party_set_flags, "p_main_party", pf_is_ship, 1),
        (party_get_position, pos1, "p_main_party"),
        (map_get_water_position_around_position, pos2, pos1, 6),
        (party_set_position, "p_main_party", pos2),
        (assign, "$g_main_ship_party", -1),
        (assign, "$g_leave_encounter",1)
        ]],
#Shipwright Ends

#Slave Trader
    [trp_port_slave_trader|plyr, "start",
   [],
   "Who are you?", "port_st",
   []],
    [trp_port_slave_trader, "port_st",
   [(str_store_party_name, s9, "$current_town"),],
   "Im Slave Trader, {s9} Port wouldn't live without my slave. Im not selling Slave, but I rent them. If you have any prisoner from war, I want to buy them.", "port_st_2",
   []],
    [trp_port_slave_trader|plyr,"port_st_2",
   [[store_num_regular_prisoners,reg(0)],[ge,reg(0),1]],
   "I've brought you some prisoners for your slave stock", "port_st_3",[]],
    [trp_port_slave_trader|plyr,"port_st_2",[],
   "Good Bye", "close_window",[]],
  
  [trp_port_slave_trader,"port_st_3", [],
  "Let me see what you have..", "port_st_4",
   [[change_screen_trade_prisoners]]],
  [trp_port_slave_trader, "port_st_4", [], "A pleasure doing business with you.", "close_window",[]],

#Sea Raiders
  [trp_port_recruiter, "start",
   [(str_store_party_name, s9, "$current_town"),],
   "Im Captain of {s9} Sea Protector. I'm and my men live in here to protect {s9} sea from other Raiders. So what do yo want?", "port_r_2",
   []],
  
  [trp_port_recruiter|plyr, "port_r_2",
   [],
   "I want to recruit some of your men", "port_rec",
   []],
  
  [trp_port_recruiter|plyr, "port_r_2",
   [],
   "Bye", "close_window",
   []],  

  [trp_port_recruiter, "port_rec",
   [],
   "50 Denars for 1 of my men. How much do you want?", "port_rec_2",
   []],
  
 [trp_port_recruiter|plyr,"port_rec_2", [], "1", "pr_talk_back",[(store_troop_gold,":money","trp_player"),
      (try_begin),
        (ge,":money",50),
        (troop_remove_gold,"trp_player",50),(party_add_members, "p_main_party", "trp_sea_raider", 1),(else_try),
        (display_message,"@You don't have enough money"),
      (try_end),]],
  
 [trp_port_recruiter|plyr,"port_rec_2", [], "10", "pr_talk_back",[(store_troop_gold,":money","trp_player"),
      (try_begin),
        (ge,":money",500),
        (troop_remove_gold,"trp_player",500),(party_add_members, "p_main_party", "trp_sea_raider", 10),(else_try),
        (display_message,"@You don't have enough money"),
      (try_end),]],
 [trp_port_recruiter|plyr,"port_rec_2", [], "50", "pr_talk_back",[(store_troop_gold,":money","trp_player"),
      (try_begin),
        (ge,":money",2500),
        (troop_remove_gold,"trp_player",2500),(party_add_members, "p_main_party", "trp_sea_raider", 50),(else_try),
        (display_message,"@You don't have enough money"),
      (try_end),]],

 [trp_port_recruiter|plyr,"port_rec_2", [], "Forget It", "pr_talk_back",[]],
 [trp_port_recruiter, "pr_talk_back",
   [],
   "Anything Else?", "port_r_2",
   []],
#Exa's OSP Ends

4. Yeah, You had passed all of easy steps, now save your module_strings.py and prepare for the last steps. Open your module_game_menus.py.

Press Ctrl+F and write on the Dialog Box "town_tavern", and you will found "town_tavern" entry, above it copy this:
Code:
#Exa's OSP
("town_port",[(this_or_next|eq,"$current_town","p_town_1"),
                         (this_or_next|eq,"$current_town","p_town_2"),
                         (this_or_next|eq,"$current_town","p_town_6"),
                         (this_or_next|eq,"$current_town","p_town_12"),
                         (this_or_next|eq,"$current_town","p_town_19"),
                         (this_or_next|eq,"$current_town","p_town_13"),
                         (eq,"$current_town","p_town_15"),
#                          (eq, "$cheat_mode", 1),
#                         (party_slot_eq,"$current_town",slot_town_near_shore, 1),
              ],
       "Visit town port",
       [
           (set_jump_mission,"mt_town_default"),
           (jump_to_scene,"scn_port"),
           (change_screen_mission,0),
           (call_script, "script_init_town_walkers"),
        ]),
#Exa's OSP

5. This steps is Optional, To add Sea Battles, you must go to this thread --> http://forums.taleworlds.com/index.php/topic,136095.0.html
I'm too lazy to write that on here  :mrgreen:

6. Save your module_game_menus.py and Voila! Your coding time has finish at here, Now is your time to Compile it and Test!
(To Test you must Test it at the Town that was near shore, Not like in Veluca or Halmar)

Credits:
Ikaguia & Caba' drinfor Help  :grin:
Ruthven for Sea Battles Mk. II

If you found any error, Report it to me!
 
just an tip, the way you made the names, if you talk to him two times, he will have a different name each time, try setting the names at the menu.

anyway, nice work  :grin:
 
Ikaguia said:
just an tip, the way you made the names, if you talk to him two times, he will have a different name each time, try setting the names at the menu.

anyway, nice work  :grin:
Yes, About the names, I'm still confuse to set name, One Scene One Name  :???:.
 
13exa said:
Ikaguia said:
just an tip, the way you made the names, if you talk to him two times, he will have a different name each time, try setting the names at the menu.

anyway, nice work  :grin:
Yes, About the names, I'm still confuse to set name, One Scene One Name  :???:.

Two ways, really. One is to have a different troop for every town with a port and then just call the appropriate troop (similar to village elders/guild leaders, etc).

Second, is to set up a script to randomize a one name per town and then store the string # in a party slot for the town, on game start. In the dialog, retrieve the string number from the slot and use troop_set_name on the one port master troop.
 
Caba`drin said:
13exa said:
Ikaguia said:
just an tip, the way you made the names, if you talk to him two times, he will have a different name each time, try setting the names at the menu.

anyway, nice work  :grin:
Yes, About the names, I'm still confuse to set name, One Scene One Name  :???:.

Two ways, really. One is to have a different troop for every town with a port and then just call the appropriate troop (similar to village elders/guild leaders, etc).

Second, is to set up a script to randomize a one name per town and then store the string # in a party slot for the town, on game start. In the dialog, retrieve the string number from the slot and use troop_set_name on the one port master troop.
I select the First, more easy  :mrgreen:

I'll update soon, Thanks Caba' drin! :wink:
 
Back
Top Bottom