[OSP][Kod] Tanıtım Ekranı

Currently Viewing (Users: 0, Guests: 1)

Raqqa

Knight
WBNWVCWF&SM&B
Best answers
0
Bu kod, modunuzun "yeni oyuna başla" denildiği anda ekrana gelen, istediğiniz şeyleri anlatabileceğiniz bir sinematik sahnedir. Basit bir şekilde açıklayarak size kodları sunacağım. Senaryonuzun bir kaç gün öncesini veya modun hakkında neyin ne olduğunu insanlara buradan anlatabilirsiniz.

module_strings;

Code:
  ("intro_1", "Buraya yazınızı yazınız."),
  ("intro_2", "Buraya yazınızı yazınız."),
  ("intro_3", "Buraya yazınızı yazınız."),
  ("intro_4", "Buraya yazınızı yazınız."),
  ("intro_5", "Buraya yazınızı yazınız."),

module_presentations;

Code:
("intro",prsntf_manual_end_only,mesh_load_window,[
      (ti_on_presentation_load,
       [(assign, "$g_presentation_credits_obj_1", -1),
        (assign, "$g_presentation_credits_obj_2", -1),
        (assign, "$g_presentation_credits_obj_3", -1),
        (assign, "$g_presentation_credits_obj_4", -1),
        (assign, "$g_presentation_credits_obj_5", -1),
        (assign, "$g_presentation_credits_obj_6", -1),
        (assign, "$g_presentation_credits_obj_7", -1),
        (assign, "$g_presentation_credits_obj_8", -1),
        (assign, "$g_presentation_credits_obj_9", -1),
        (assign, "$g_presentation_credits_obj_10", -1),
        (assign, "$g_presentation_credits_obj_11", -1),
        (assign, "$g_presentation_credits_obj_12", -1),
        (assign, "$g_presentation_credits_obj_1_alpha", 0),
        (assign, "$g_presentation_credits_obj_2_alpha", 0),
        (assign, "$g_presentation_credits_obj_3_alpha", 0),
        (assign, "$g_presentation_credits_obj_4_alpha", 0),
        (assign, "$g_presentation_credits_obj_5_alpha", 0),
        (assign, "$g_presentation_credits_obj_6_alpha", 0),
        (assign, "$g_presentation_credits_obj_7_alpha", 0),
        (assign, "$g_presentation_credits_obj_8_alpha", 0),
        (assign, "$g_presentation_credits_obj_9_alpha", 0),
        ]),
      (ti_on_presentation_run,
       [   
        (store_trigger_param_1, ":cur_time"),
        (set_fixed_point_multiplier, 1000),
        (presentation_set_duration, 1000000),
        (try_begin),
          (this_or_next|key_clicked, key_space),
          (this_or_next|key_clicked, key_enter),
          (this_or_next|key_clicked, key_escape),
          (this_or_next|key_clicked, key_back_space),
          (this_or_next|key_clicked, key_left_mouse_button),
          (this_or_next|key_clicked, key_right_mouse_button),
          (this_or_next|key_clicked, key_xbox_ltrigger),
		  (key_clicked, key_xbox_rtrigger),
          (presentation_set_duration, 0),
		  (jump_to_menu, "mnu_start_game_1"),
		  (stop_all_sounds, 2), 
        (try_end),
		(try_begin),
          (lt, "$g_presentation_credits_obj_1", 0),
          (str_store_string, s1, "str_intro_1"),
          (create_text_overlay, "$g_presentation_credits_obj_1", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_credits_obj_1", 0),
          (overlay_set_alpha, "$g_presentation_credits_obj_1", 0),
          (position_set_x, pos1, 1500),
          (position_set_y, pos1, 1500),
          (overlay_set_size, "$g_presentation_credits_obj_1", pos1),
          (position_set_x, pos1, 500),
          (position_set_y, pos1, 375),
          (overlay_set_position, "$g_presentation_credits_obj_1", pos1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_1", 1000, 0xFF),
        (else_try),
          (gt, ":cur_time", 2000),
          (eq, "$g_presentation_credits_obj_1_alpha", 0),
          (assign, "$g_presentation_credits_obj_1_alpha", 1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_1", 1000, 0x00),
        (else_try),
          (gt, ":cur_time", 4000),
          (lt, "$g_presentation_credits_obj_2", 0),
          (str_store_string, s1, "str_intro_2"),
          (create_text_overlay, "$g_presentation_credits_obj_2", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_credits_obj_2", 0),
          (overlay_set_alpha, "$g_presentation_credits_obj_2", 0),
          (position_set_x, pos1, 1750),
          (position_set_y, pos1, 1750),
          (overlay_set_size, "$g_presentation_credits_obj_2", pos1),
          (position_set_x, pos1, 500),
          (position_set_y, pos1, 375),
          (overlay_set_position, "$g_presentation_credits_obj_2", pos1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_2", 1000, 0xFF),
        (else_try),
          (gt, ":cur_time", 6000),
          (eq, "$g_presentation_credits_obj_2_alpha", 0),
          (assign, "$g_presentation_credits_obj_2_alpha", 1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_2", 1000, 0x00),
        (else_try),
          (gt, ":cur_time", 8000),
          (lt, "$g_presentation_credits_obj_3", 0),
          (str_store_string, s1, "str_intro_3"),
          (create_text_overlay, "$g_presentation_credits_obj_3", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_credits_obj_3", 0),
          (overlay_set_alpha, "$g_presentation_credits_obj_3", 0),
          (position_set_x, pos1, 1750),
          (position_set_y, pos1, 1750),
          (overlay_set_size, "$g_presentation_credits_obj_3", pos1),
          (position_set_x, pos1, 500),
          (position_set_y, pos1, 375),
          (overlay_set_position, "$g_presentation_credits_obj_3", pos1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_3", 1000, 0xFF),
        (else_try),
          (gt, ":cur_time", 10000),
          (eq, "$g_presentation_credits_obj_3_alpha", 0),
          (assign, "$g_presentation_credits_obj_3_alpha", 1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_3", 1000, 0),
        (else_try),
          (gt, ":cur_time", 12000),
          (lt, "$g_presentation_credits_obj_4", 0),
          (str_store_string, s1, "str_intro_4"),
          (create_text_overlay, "$g_presentation_credits_obj_4", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_credits_obj_4", 0),
          (overlay_set_alpha, "$g_presentation_credits_obj_4", 0),
          (position_set_x, pos1, 1750),
          (position_set_y, pos1, 1750),
          (overlay_set_size, "$g_presentation_credits_obj_4", pos1),
          (position_set_x, pos1, 500),
          (position_set_y, pos1, 375),
          (overlay_set_position, "$g_presentation_credits_obj_4", pos1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_4", 1000, 0xFF),
        (else_try),
          (gt, ":cur_time", 14000),
          (eq, "$g_presentation_credits_obj_4_alpha", 0),
          (assign, "$g_presentation_credits_obj_4_alpha", 1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_4", 1000, 0),
        (else_try),
          (gt, ":cur_time", 16000),
          (lt, "$g_presentation_credits_obj_5", 0),
          (str_store_string, s1, "str_intro_5"),
          (create_text_overlay, "$g_presentation_credits_obj_5", s1, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_credits_obj_5", 0),
          (overlay_set_alpha, "$g_presentation_credits_obj_5", 0),
          (position_set_x, pos1, 1750),
          (position_set_y, pos1, 1750),
          (overlay_set_size, "$g_presentation_credits_obj_5", pos1),
          (position_set_x, pos1, 500),
          (position_set_y, pos1, 375),
          (overlay_set_position, "$g_presentation_credits_obj_5", pos1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_5", 1000, 0xFF),
        (else_try),
          (gt, ":cur_time", 18000),
          (eq, "$g_presentation_credits_obj_5_alpha", 0),
          (assign, "$g_presentation_credits_obj_5_alpha", 1),
          (overlay_animate_to_alpha, "$g_presentation_credits_obj_5", 1000, 0),
        (else_try),
          (gt, ":cur_time", 18000),
          (presentation_set_duration, 0),
		  (stop_all_sounds, 2), 
		  (jump_to_menu, "mnu_start_game_1"),
        (try_end),
        ]),
      ]),


(gt, ":cur_time", 2000), = bu kısımlar yazının ekranda ne kadar kalacağını belirler. Eğer yavaş veya hızlı olursa kendiniz ayarlayabilirsiniz deneme yaparak. Ben kendimce 2000 yaptım. Bu yazının her ekranın yazılı olduğu kodda olduğunu göreceksiniz. ilkine kaç yazdıysanız diğerlerine o kadar ekleyerek gidin. yani mesela ilki 2000 ise, ikinci ekranda 2000+2000= 4000, üçte 6000 diye devam eder...


module_game_menus;

Code:
  ("start_game_0",menu_text_color(0xFF000000)|mnf_disable_all_keys,
    "Begins...",
    "none",
    [(start_presentation, "prsnt_intro"),
	 ],
     [  
      ("intro",[],"Intro...",
       [
         (change_screen_quit),
       ]),
    ]
  ),

Oyunun başında gözükeceği için "start_game_0" koduna yazdım. Presentations kısmında yazılar biter bitmez start_game_1 menüsüne atacak.


Eğer bu kodu modunuzda veya başka bir eklentide kullanacaksanız benim ismimi ve eğer mümkünse bu açık kaynağın linkini teşekkürlere koymanız gerekmektedir.

Kodu en basit halinde yolladım size, presentations kısmından resim,müzik gibi şeyler eleyebilirsiniz daha. Aynı Hyper'in dediği gibi;
HyperCharge said:
Presentation'lar ile her şeyi yapabilirsiniz. Yeter ki hayal gücünüz geniş olsun.  :razz:
Sorularınızı veya hata olursa yorum yapın. Gördüğüm gibi yardımcı olmaya çalışırım.

Herkese iyi günler,
raqqa