LSP Code QoL Generic screen

Users who are viewing this thread

Hi everyone, I wanted to share an OSP from my mod Fracture Moment: Rise of Ottoman.

-What is this ?

+ As you see in films, movies, there is a generic screen that writes place and date. Like ; January 16, 1534
Rome outskirts
So, I was thought it should have in my mod's scenario. Then i wrote this.
Actually, I was wrote this about 2-3 months ago, but forgot to share here :ohdear:. Anyways,

module_presentations;

Code:
# screen write
("screen_write",prsntf_read_only,0,[
    (ti_on_presentation_load,
    [
    (assign, "$g_presentation_obje_1", -1),
    (assign, "$g_presentation_obje_2", -1),
   
    (assign, "$g_presentation_obje_1_alpha", 0),
        (assign, "$g_presentation_obje_2_alpha", 0),
    
    
        (mission_cam_set_screen_color, 0xFF000000), #Blackout the screen first
    ]),
    (ti_on_presentation_run,
    [
    (store_trigger_param_1, ":cur_time"),
        (set_fixed_point_multiplier, 1000),
        (presentation_set_duration, 1000000),
       
        (try_begin),
       
          (lt, "$g_presentation_obje_1", 0),
          (str_store_string, s1, "str_date_string"),#first string
          (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", 0xFF0000),
          (overlay_set_alpha, "$g_presentation_obje_1", 0),
          (position_set_x, pos1, 1750),
          (position_set_y, pos1, 1750),
          (overlay_set_size, "$g_presentation_obje_1", pos1),
          (position_set_x, pos1, 500),
          (position_set_y, pos1, 375),
          (overlay_set_position, "$g_presentation_obje_1", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_1", 2000, 0xFF),
       
          (else_try),
         
           (gt, ":cur_time", 6000), # If 6 seconds past
          (lt, "$g_presentation_obje_2", 0), #then second string
          (str_store_string, s2, "str_place_string"),
          (create_text_overlay, "$g_presentation_obje_2", s2, tf_center_justify|tf_double_space|tf_vertical_align_center),
          (overlay_set_color, "$g_presentation_obje_2", 0xFF0000),
          (overlay_set_alpha, "$g_presentation_obje_2", 0),
          (position_set_x, pos1, 1500),
          (position_set_y, pos1, 1500),
          (overlay_set_size, "$g_presentation_obje_2", pos1),
          (position_set_x, pos1, 500),
          (position_set_y, pos1, 295),
          (overlay_set_position, "$g_presentation_obje_2", pos1),
          (overlay_animate_to_alpha, "$g_presentation_obje_2", 2000, 0xFF),
         
          (else_try),
         
           (gt, ":cur_time", 7500), #If 7.5 seconds past
           (eq, "$g_presentation_obje_1_alpha", 0),
          (assign, "$g_presentation_obje_1_alpha", 1),
          (overlay_animate_to_alpha, "$g_presentation_obje_1", 1500, 0x00), #lose the string1
         
          (else_try),
         
           (gt, ":cur_time", 8500), #If 8.5 seconds past
           (eq, "$g_presentation_obje_2_alpha", 0),
          (assign, "$g_presentation_obje_2_alpha", 1),
          (overlay_animate_to_alpha, "$g_presentation_obje_2", 1500, 0x00),#lose the string2
        
          (else_try),
         
           (gt, ":cur_time", 11000), #If 11 seconds past
          
            (mission_cam_animate_to_screen_color, 0x00000000, 3000), # bright the screen in 3 seconds
         
         
          (else_try),
         
        (gt, ":cur_time", 15000), # If 15 seconds past
          (presentation_set_duration, 0), #end the party
         
          (try_end),
          ]),
         ]),
# screen write ends

module_strings;

Code:
# screen write
("place_string", "Place..."),
  ("date_string", "Date..."),
# screen write ends

Any mission in module_mission_templates;

Code:
# screen write
          (ti_after_mission_start, 0, ti_once, [],
          [(start_presentation, "prsnt_screen_write"),]),
          # screen write ends

Here is the proof :smile:;


To use this code, You should give credits to me. And tell me that you are going to use it. I would like to see how this code implemented on mods :grin:
 
Last edited:
This might be a silly question but what is the mission template to the game start? I mean where do I put it to trigger the presentation right before loading campaign map when starting a new game? Also would it be possible to make a tweak to the code so that it would get the name of the location? For example in the siege of a castle it would get the name of the castle.
 
thewanderingknight said:
This might be a silly question but what is the mission template to the game start? I mean where do I put it to trigger the presentation right before loading campaign map when starting a new game? Also would it be possible to make a tweak to the code so that it would get the name of the location? For example in the siege of a castle it would get the name of the castle.

I will look on to this, yes it's possible to get the locations name. But need some changes in code.
 
HyperCharge said:
thewanderingknight said:
This might be a silly question but what is the mission template to the game start? I mean where do I put it to trigger the presentation right before loading campaign map when starting a new game? Also would it be possible to make a tweak to the code so that it would get the name of the location? For example in the siege of a castle it would get the name of the castle.

I will look on to this, yes it's possible to get the locations name. But need some changes in code.

Thanks this presentation is really nice to use in my mod to have a more movie style to it xd But where do I add the trigger for when the game start, I mean right before the campaign map loads? Thanks.
 
thewanderingknight said:
HyperCharge said:
thewanderingknight said:
This might be a silly question but what is the mission template to the game start? I mean where do I put it to trigger the presentation right before loading campaign map when starting a new game? Also would it be possible to make a tweak to the code so that it would get the name of the location? For example in the siege of a castle it would get the name of the castle.

I will look on to this, yes it's possible to get the locations name. But need some changes in code.

Thanks this presentation is really nice to use in my mod to have a more movie style to it xd But where do I add the trigger for when the game start, I mean right before the campaign map loads? Thanks.
You mean you want the presentation to start when you click Singleplayer, or something like that?
 
gokiller said:
I'm assuming he means from the point where you go to the campaign map. When coming from that beginning quest scene.

Yes that's what I mean, but in the case of my mod is right after character creation since I removed that quest. Instead of starting in the campaign map right way, it would play the presentation before.
 
To play it when the map loads (if you've edited the character creation/game start menus to go to the map instead of directly into a mission), I'd use a full trigger (not a simple trigger) in module_triggers, modeled after (or replacing) this trigger found at the top of the file:
Code:
  (0.1, 0, ti_once, [(map_free,0)], [(dialog_box,"str_tutorial_map1")]),
But, rather than bringing up the dialog box, call the presentation as HyperCharge does in a mission template trigger in the OP. (Might need to experiment if you need a check interval of 0 rather than 0.1.)
 
Caba`drin said:
To play it when the map loads (if you've edited the character creation/game start menus to go to the map instead of directly into a mission), I'd use a full trigger (not a simple trigger) in module_triggers, modeled after (or replacing) this trigger found at the top of the file:
Code:
  (0.1, 0, ti_once, [(map_free,0)], [(dialog_box,"str_tutorial_map1")]),
But, rather than bringing up the dialog box, call the presentation as HyperCharge does in a mission template trigger in the OP. (Might need to experiment if you need a check interval of 0 rather than 0.1.)

So I replaced that line with:

(0, 0, ti_once, [(map_free,0)], [(start_presentation, "prsnt_screen_write")]),

It plays the presentation correctly but then it gets stuck in the presentation in a black screen and doesn't go to the map if I keep 0.1 instead it will play the presentation already in the map instead of the tutorial but then it freezes the game.
 
Caba`drin said:
In the ti_on_presentation_load trigger, I'd try moving (set_fixed_point_multiplier, 1000), and
        (presentation_set_duration, 1000000), from the run trigger...perhaps?

Tried removing those but then it just give that blackout as if it was going to play the presentation but goes to the campaign map and don't play it.
 
HyperCharge said:
thewanderingknight said:
This might be a silly question but what is the mission template to the game start? I mean where do I put it to trigger the presentation right before loading campaign map when starting a new game? Also would it be possible to make a tweak to the code so that it would get the name of the location? For example in the siege of a castle it would get the name of the castle.
HyperCharge said:
I will look on to this, yes it's possible to get the locations name. But need some changes in code.

Are you still going to tweak the code to get the locations? Just to know if I shall wait for it xd
 
Ah, I forgot that.  :grin:

Code:
(store_encountered_party, "$current_town"), #I thought the current_town variable appointed automatically, so I didn't run a cycle for just take care of towns, castles and villages. But it may be necessary.
		(str_store_party_name, s1, "$current_town"),



Code:
("place_string", "Near {s1}..."),
  ("date_string", "Date..."),

That's all I think.
 
HyperCharge said:
Ah, I forgot that.  :grin:

Code:
(store_encountered_party, "$current_town"), #I thought the current_town variable appointed automatically, so I didn't run a cycle for just take care of towns, castles and villages. But it may be necessary.
		(str_store_party_name, s1, "$current_town"),



Code:
("place_string", "Near {s1}..."),
  ("date_string", "Date..."),

That's all I think.

Edit: I solved the visit castle issue it was the mini map getting in the way, when starting battles might be another one. I guess only issue now is when visiting town or castle is getting waiting cost instead of the date, in villages work fine I guess because it doesn't have it
 
Back
Top Bottom