OSP Code SP Better looking dialog scenes

Currently viewing this thread:

H-Bag

Banned
I wanted to share the dialog scenes code I wrote for my mode as osp. I do not continue my mode because I cannot find stories.

Here it will look like this.

module_presentations.py
Code:
  ("toplanti",prsntf_read_only,0,[
    (ti_on_presentation_load,
    [
    (assign, "$g_presentation_obje_1", -1),
    (assign, "$g_presentation_obje_2", -1),
    (assign, "$g_presentation_obje_3", -1),
    (assign, "$g_presentation_obje_4", -1),
    (assign, "$g_presentation_obje_5", -1),
    (assign, "$g_presentation_obje_6", -1),
    (assign, "$g_presentation_obje_7", -1),
    (assign, "$g_presentation_obje_8", -1),
    (assign, "$g_presentation_obje_9", -1),
    (assign, "$g_presentation_obje_10", -1),

    (assign, "$g_presentation_obje_1_alpha", 0),
    (assign, "$g_presentation_obje_2_alpha", 0),
    (assign, "$g_presentation_obje_3_alpha", 0),
    (assign, "$g_presentation_obje_4_alpha", 0),
    (assign, "$g_presentation_obje_5_alpha", 0),
    (assign, "$g_presentation_obje_6_alpha", 0),
    (assign, "$g_presentation_obje_7_alpha", 0),
    (assign, "$g_presentation_obje_8_alpha", 0),
    (assign, "$g_presentation_obje_9_alpha", 0),
    (assign, "$g_presentation_obje_10_alpha", 0),

    ]),
    (ti_on_presentation_run,
    [
    (store_trigger_param_1, ":cur_time"),
    (set_fixed_point_multiplier, 1000),
    (presentation_set_duration, 1000000),
   
     (try_begin),
    
          (gt, ":cur_time", 5000),
          (lt, "$g_presentation_obje_1", 0),
          (str_store_string, s1, "str_liveo_toplanti_konusma1"),
          (create_text_overlay, "$g_presentation_obje_1", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_1", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_1", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_1", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_1", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_1", 2000, 0xFF),
    
       (else_try),
  
         (gt, ":cur_time", 11000),
         (eq, "$g_presentation_obje_1_alpha", 0),
         (assign, "$g_presentation_obje_1_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_1", 1500, 0x00),
    
       (else_try),
  
          (gt, ":cur_time", 13000),
          (lt, "$g_presentation_obje_2", 0),
          (str_store_string, s1, "str_oyuncu_toplanti_konusma1"),
          (create_text_overlay, "$g_presentation_obje_2", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_2", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_2", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_2", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_2", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_2", 2000, 0xFF),
     
       (else_try),
  
         (gt, ":cur_time", 20000),
         (eq, "$g_presentation_obje_2_alpha", 0),
         (assign, "$g_presentation_obje_2_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_2", 1500, 0x00),
 
      (else_try),
 
          (gt, ":cur_time", 22000),
          (lt, "$g_presentation_obje_3", 0),
          (str_store_string, s1, "str_valens_toplanti_konusma1"),
          (create_text_overlay, "$g_presentation_obje_3", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_3", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_3", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_3", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_3", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_3", 2000, 0xFF),
     
       (else_try),
  
         (gt, ":cur_time", 34000),
         (eq, "$g_presentation_obje_3_alpha", 0),
         (assign, "$g_presentation_obje_3_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_3", 1500, 0x00),
 
       (else_try),
 
          (gt, ":cur_time", 36000),
          (lt, "$g_presentation_obje_4", 0),
          (str_store_string, s1, "str_vitalis_toplanti_konusma1"),
          (create_text_overlay, "$g_presentation_obje_4", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_4", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_4", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_4", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_4", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_4", 2000, 0xFF),
     
      (else_try),
  
         (gt, ":cur_time", 48000),
         (eq, "$g_presentation_obje_4_alpha", 0),
         (assign, "$g_presentation_obje_4_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_4", 1500, 0x00),
 
       (else_try),

          (gt, ":cur_time", 50000),
          (lt, "$g_presentation_obje_5", 0),
          (str_store_string, s1, "str_oyuncu_toplanti_konusma2"),
          (create_text_overlay, "$g_presentation_obje_5", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_5", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_5", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_5", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_5", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_5", 2000, 0xFF),
     
      (else_try),
 
         (gt, ":cur_time", 55000),
         (eq, "$g_presentation_obje_5_alpha", 0),
         (assign, "$g_presentation_obje_5_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_5", 1500, 0x00),
 
       (else_try),
 
          (gt, ":cur_time", 57000),
          (lt, "$g_presentation_obje_6", 0),
          (str_store_string, s1, "str_zanobi_toplanti_konusma1"),
          (create_text_overlay, "$g_presentation_obje_6", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_6", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_6", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_6", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_6", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_6", 2000, 0xFF),
     
      (else_try),
 
         (gt, ":cur_time", 65000),
         (eq, "$g_presentation_obje_6_alpha", 0),
         (assign, "$g_presentation_obje_6_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_6", 1500, 0x00),
 
       (else_try),
 
          (gt, ":cur_time", 67000),
          (lt, "$g_presentation_obje_7", 0),
          (str_store_string, s1, "str_marky_toplanti_konusma1"),
          (create_text_overlay, "$g_presentation_obje_7", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_7", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_7", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_7", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_7", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_7", 2000, 0xFF),
     
      (else_try),
 
         (gt, ":cur_time", 72000),
         (eq, "$g_presentation_obje_7_alpha", 0),
         (assign, "$g_presentation_obje_7_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_7", 1500, 0x00),
 
       (else_try),
 
          (gt, ":cur_time", 74000),
          (lt, "$g_presentation_obje_8", 0),
          (str_store_string, s1, "str_oyuncu_toplanti_konusma3"),
          (create_text_overlay, "$g_presentation_obje_8", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_8", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_8", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_8", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_8", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_8", 2000, 0xFF),
     
      (else_try),
 
         (gt, ":cur_time", 84000),
         (eq, "$g_presentation_obje_8_alpha", 0),
         (assign, "$g_presentation_obje_8_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_8", 1500, 0x00),
 
       (else_try),
 
          (gt, ":cur_time", 86000),
          (lt, "$g_presentation_obje_9", 0),
          (str_store_string, s1, "str_liveo_toplanti_konusma2"),
          (create_text_overlay, "$g_presentation_obje_9", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_9", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_9", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_9", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_9", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_9", 2000, 0xFF),
     
      (else_try),
 
         (gt, ":cur_time", 94000),
         (eq, "$g_presentation_obje_9_alpha", 0),
         (assign, "$g_presentation_obje_9_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_9", 1500, 0x00),
 
       (else_try),
 
          (gt, ":cur_time", 96000),
          (lt, "$g_presentation_obje_10", 0),
          (str_store_string, s1, "str_oyuncu_toplanti_konusma4"),
          (create_text_overlay, "$g_presentation_obje_10", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_10", 0xF3F0F0),
          (overlay_set_alpha, "$g_presentation_obje_10", 0),
          (position_set_x, pos1, 1100),
          (position_set_y, pos1, 1100),
          (overlay_set_size, "$g_presentation_obje_10", pos1),
          (position_set_x, pos1, 475),
          (position_set_y, pos1, 175),
          (overlay_set_position, "$g_presentation_obje_10", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_10", 2000, 0xFF),
     
      (else_try),
 
         (gt, ":cur_time", 106000),
         (eq, "$g_presentation_obje_10_alpha", 0),
         (assign, "$g_presentation_obje_10_alpha", 1),
         (overlay_animate_to_alpha, "$g_presentation_obje_10", 1500, 0x00),
 
       (else_try),

         (gt, ":cur_time", 109000),
         (presentation_set_duration, 0),
         (jump_to_menu, "mnu_sehir_merkezi_ata_bin"),
         (finish_mission),
         (change_screen_mission),
        (try_end),
       ]),
     ]),

Write this camera code in the mission of the scene you set beforehand.
module_mission_templates
Code:
(0, 5, ti_once, [], [(entry_point_get_position, pos1, 8),(mission_cam_set_mode,1),(mission_cam_set_position, pos1),]),
   (0, 13, ti_once, [], [(entry_point_get_position, pos1, 9),(mission_cam_set_mode,1),(mission_cam_set_position, pos1),]),[/spoiler]

Determine the time yourself according to the length of the dialogues in the presentation. Put the camera input in front of the npc to show with edit mode.


For the animations in the scene, first choose which animation you will use and then write the script.

module_scripts
Code:
   ("toplanti_animasyon",
    [
       (try_for_agents, ":cur_agent1"),
        (agent_get_troop_id, ":cur_agent_troop1", ":cur_agent1"),
        (eq, ":cur_agent_troop1", "trp_valens"),
        (agent_set_animation, ":cur_agent1", "anim_sitting_sharpening_1"),
        (agent_equip_item, ":cur_agent1", "itm_sharpening_1_ani", 1),
        (agent_set_wielded_item, ":cur_agent1", "itm_sharpening_1_ani"),
       (try_end),            
       (try_for_agents, ":cur_agent2"),
        (agent_get_troop_id, ":cur_agent_troop2", ":cur_agent2"),
        (eq, ":cur_agent_troop2", "trp_player"),
        (agent_set_animation, ":cur_agent2", "anim_oturmak"),
       (try_end),    
      (try_for_agents, ":cur_agent3"),
        (agent_get_troop_id, ":cur_agent_troop3", ":cur_agent3"),
        (eq, ":cur_agent_troop3", "trp_liveo"),
        (agent_set_animation, ":cur_agent3", "anim_sitting_drinking_low"),
        (agent_equip_item, ":cur_agent3", "itm_dedal_kufel", 1),
        (agent_set_wielded_item, ":cur_agent3", "itm_dedal_kufel"),
       (try_end),    
      (try_for_agents, ":cur_agent4"),
        (agent_get_troop_id, ":cur_agent_troop4", ":cur_agent4"),
        (eq, ":cur_agent_troop4", "trp_vitalis"),
        (agent_set_animation, ":cur_agent4", "anim_sitting_drinking_low"),
        (agent_equip_item, ":cur_agent4", "itm_dedal_kufel", 1),
        (agent_set_wielded_item, ":cur_agent4", "itm_dedal_kufel"),
       (try_end),
       (try_for_agents, ":cur_agent5"),
        (agent_get_troop_id, ":cur_agent_troop5", ":cur_agent5"),
        (eq, ":cur_agent_troop5", "trp_zanobi"),
        (agent_set_animation, ":cur_agent5", "anim_oturmak"),
       (try_end),
      (try_for_agents, ":cur_agent6"),
        (agent_get_troop_id, ":cur_agent_troop6", ":cur_agent6"),
        (eq, ":cur_agent_troop6", "trp_marky"),
        (agent_set_animation, ":cur_agent6", "anim_oturmak"),
       (try_end),
  ]),

here determine which npc will use which animation and then call from stage mission.

(0, 0, 0, [(call_script, "script_toplanti_animasyon")],[]),

Do not forget to give credit if you use it.
 
Last edited:
Top Bottom