historical battle notification.

Users who are viewing this thread

Solution
I will keep trying, since when I enter the event menu screen, it does not let me exit, I press the 2 options a thousand times and nothing ...
This indicates that script is called every frame. This is getting confusing. :smile: I think it works like this. When the time comes, you're redirected to the menu. When you click one of the buttons, You go back to the main world. The game calls that script again to display date. You're redirected to the menu again. It works like an infinite loop of actions. Fixed version should work.
Code:
#################################################
(store_mod, ":cur_hour", ":num_hours", 24),
      (try_begin),
        (this_or_next|neq, "$g_current_hour", ":cur_hour"),
        (this_or_next|neq...
If you couldn't get anyting from produno, you may try the TLD modders. It may contain similar stuff since it the lore contains a lot of histroical battles.
If all those fail, you can try something like this.
There is a script that is called to create date text.
#script_game_get_date_text:
# This script is called from the game engine when the date needs to be displayed.
# INPUT: arg1 = number of days passed since the beginning of the game
# OUTPUT: result string = date
("game_get_date_text",
If you add this code to the end of it.
Code:
      (store_mod, ":cur_hour", ":num_hours", 24),
      (try_begin),
        (this_or_next|neq, "$g_current_hour", ":cur_hour"),
        (this_or_next|neq, "$g_current_day", ":cur_day"),
        (this_or_next|neq, "$g_current_month", ":cur_month"),
        (neq, "$g_current_year", ":cur_year"),
        (assign, "$g_current_hour", ":cur_hour"),
        (assign, "$g_current_day", ":cur_day"),
        (assign, "$g_current_month", ":cur_month"),
        (assign, "$g_current_year", ":cur_year"),
        (call_script, "script_historical_battle_notification"),
      (try_end),
It calls a custom script for every hour once. You may do whatever you want at that script. If it causes troubles, you can call it from a simple trigger with a 1 hour interval. Use those global variables (g_current_hour etc) inside the custom script. The rest is up to you.

Edit: Fixed the errors with the failable statements.
 
Last edited:
Upvote 0
If you couldn't get anyting from produno, you may try the TLD modders. It may contain similar stuff since it the lore contains a lot of histroical battles.
TLD has no such historical battles. The mod has a starting point and then it's basically a 'What would be if' scenario.

Your other idea is good, I recall having seen it somewhere. Probably the best way to go with.
 
Upvote 0
If you couldn't get anyting from produno, you may try the TLD modders. It may contain similar stuff since it the lore contains a lot of histroical battles.
If all those fail, you can try something like this.
There is a script that is called to create date text.

If you add this code to the end of it.
Code:
      (store_mod, ":cur_hour", ":num_hours", 24),
      (try_begin),
        (neq, "$g_current_hour", ":cur_hour"),
        (neq, "$g_current_day", ":cur_day"),
        (neq, "$g_current_month", ":cur_month"),
        (neq, "$g_current_year", ":cur_year"),
        (assign, "$g_current_hour", ":cur_hour"),
        (assign, "$g_current_day", ":cur_day"),
        (assign, "$g_current_month", ":cur_month"),
        (assign, "$g_current_year", ":cur_year"),
        (call_script, "script_historical_battle_notification"),
      (try_end),
It calls a custom script for every hour once. You may do whatever you want at that script. If it causes troubles, you can call it from a simple trigger with a 1 hour interval. Use those global variables (g_current_hour etc) inside the custom script. The rest is up to you.
Thanks, torrow i will try.
 
Upvote 0
TLD has no such historical battles. The mod has a starting point and then it's basically a 'What would be if' scenario.

Your other idea is good, I recall having seen it somewhere. Probably the best way to go with.
I played it long time ago, so i don't remember exactly. I thought if they've added stuff like siege of Minas Tirith, they should used something similar to what he is asking for.
It's a simple code. I would be suprised if noone ever did during the last decade. :smile:
 
Upvote 0
well, first I put the lines you put here, at the end of the game_get_date_text script. I created the script and I put these lines at the end of the module.
Code:
#script_cf_historical_battle_notification
("cf_historical_battle_notification",
    [
    (try_begin),
        (eq, "$g_current_hour", 7),
        (eq, "$g_current_day", 27),
        (eq, "$g_current_month", 8),
        (eq, "$g_current_year", 1814),
        (jump_to_menu,"mnu_historical_battle"),
    (try_end),
    ]),

Then I made a test menu

Code:
################ Batalla Historica #######
("historical_battle", mnf_disable_all_keys,
"historical battle",
 "none",[(set_background_mesh, "mesh_pic_victory")],
[
("entrar_bh",[],"Yes, I want to participate",
[(change_screen_return, 0),
]),

("salir_bh",[], "No, go to ****",
[(change_screen_return, 0)
]),
]),

but nothing happened, there are no compilation errors, but the game continues on its way, then I commented on the call of the script from where you put it and called it from simple_triggers but nothing happened either :razz:
Remember that I am not an expert at coding.
 
Upvote 0
Script names are important. Make sure both has same names. "script_cf_historical_battle_notification" and "script_historical_battle_notification". That "cf_" is added to the scripts which can fail. Your script has all failable code in the try block. You don't need to name it like that.
 
Upvote 0
Los nombres de los guiones son importantes. Asegúrese de que ambos tengan los mismos nombres. "script_cf_historical_battle_notification" y "script_historical_battle_notification". Ese "cf_" se agrega a los scripts que pueden fallar. Su secuencia de comandos tiene todo el código que falla en el bloque try. No es necesario nombrarlo así.
I put the 2 names the same, in the origin and in the destination, I changed it because when compiling it told me that it could fail ... I don't know what else I can do ...
 
Upvote 0
I put the 2 names the same, in the origin and in the destination, I changed it because when compiling it told me that it could fail ... I don't know what else I can do ...
If the names are correct, i don't see any problem with the code. Maybe you can change the script call with a message to figure out the problem as i said before on your previous question like this.
(display_message, "@Time for a historical event!"),
If it displays, script has some problems. Also, as i said before, your script has all of the failable statements inside a try block. There should be no warnings about the "cf_" stuff. I can't figure out the source of that warning message from the script you posted.
 
Upvote 0
If the names are correct, i don't see any problem with the code. Maybe you can change the script call with a message to figure out the problem as i said before on your previous question like this.

If it displays, script has some problems. Also, as i said before, your script has all of the failable statements inside a try block. There should be no warnings about the "cf_" stuff. I can't figure out the source of that warning message from the script you posted.
ok, I'll try as soon as I can
 
Upvote 0
I put the message here, replacing the call of the script, but it is only shown at the beginning of the game, then it is no longer shown.
Code:
  (store_mod, ":cur_hour", ":num_hours", 24),
      (try_begin),
        (neq, "$g_current_hour", ":cur_hour"),
        (neq, "$g_current_day", ":cur_day"),
        (neq, "$g_current_month", ":cur_month"),
        (neq, "$g_current_year", ":cur_year"),
        (assign, "$g_current_hour", ":cur_hour"),
        (assign, "$g_current_day", ":cur_day"),
        (assign, "$g_current_month", ":cur_month"),
        (assign, "$g_current_year", ":cur_year"),
        (display_message, "@Time for a historical event!", 0x00C1DA),
#        (call_script, "script_historical_battle_notification"),
      (try_end),
 
Upvote 0
well, I commented on these lines and left the message in the script ...
Code:
#################################################
 (store_mod, ":cur_hour", ":num_hours", 24),
      (try_begin),
#        (neq, "$g_current_hour", ":cur_hour"),
#        (neq, "$g_current_day", ":cur_day"),
#        (neq, "$g_current_month", ":cur_month"),
#        (neq, "$g_current_year", ":cur_year"),
        (assign, "$g_current_hour", ":cur_hour"),
        (assign, "$g_current_day", ":cur_day"),
        (assign, "$g_current_month", ":cur_month"),
        (assign, "$g_current_year", ":cur_year"),
#        (display_message, "@Time for a historical event!", 0x00C1DA),
        (call_script, "script_cf_historical_battle_notification"),
      (try_end),
###################################################
Code:
#script_cf_historical_battle_notification
("cf_historical_battle_notification",
    [
#    (try_begin),
    (display_message, "@Time for a historical event!", 0x00C1DA),
        (eq, "$g_current_hour", 7),
        (eq, "$g_current_day", 27),
        (eq, "$g_current_month", 8),
        (eq, "$g_current_year", 1814),
        (jump_to_menu,"mnu_historical_battle"),
#    (try_end),
    ]),
Every hour he notified me of the event and on the morning of August 27, 1814, he showed me the battle menu ...
P.S. My question was always, why did you put neq ..., maybe I did not understand your point of view, but assigning the variables and then in the script putting the conditions, it turned out well, now I will see how I do, whether to put a battle or just a text of that historical event, since for example entering a siege in a predetermined scene and giving the conditions to be an attacker or a defender, I really can't think of how I could do it.

2wk8za3vy8q2zqp6g.jpg
 
Upvote 0
My question was always, why did you put neq
I added those neq statements to make
It calls a custom script for every hour once.
to make sure it does that job once per every hour. I didn't know how often 'game_get_date_text' script is called. My guesses were once every hour or once every frame. When i think about it, I should have used them like this
Code:
(this_or_next|neq, "$g_current_hour", ":cur_hour"),
(this_or_next|neq, "$g_current_day", ":cur_day"),
(this_or_next|neq, "$g_current_month", ":cur_month"),
(neq, "$g_current_year", ":cur_year"),
By default, every failable statement is connected to the next one with an 'and'. I should have used 'ors' in this case. Sorry about that. I should have seen that simple mistake :xf-oops:
Every hour he notified me of the event and on the morning of August 27, 1814, he showed me the battle menu ...
Then you can delete those neqs completely. It indicates 'game_get_date_text' script is called once every hour.
 
Upvote 0
I will keep trying, since when I enter the event menu screen, it does not let me exit, I press the 2 options a thousand times and nothing ...
This indicates that script is called every frame. This is getting confusing. :smile: I think it works like this. When the time comes, you're redirected to the menu. When you click one of the buttons, You go back to the main world. The game calls that script again to display date. You're redirected to the menu again. It works like an infinite loop of actions. Fixed version should work.
Code:
#################################################
(store_mod, ":cur_hour", ":num_hours", 24),
      (try_begin),
        (this_or_next|neq, "$g_current_hour", ":cur_hour"),
        (this_or_next|neq, "$g_current_day", ":cur_day"),
        (this_or_next|neq, "$g_current_month", ":cur_month"),
        (neq, "$g_current_year", ":cur_year"),
        (assign, "$g_current_hour", ":cur_hour"),
        (assign, "$g_current_day", ":cur_day"),
        (assign, "$g_current_month", ":cur_month"),
        (assign, "$g_current_year", ":cur_year"),
        (display_message, "@Time for a historical event!", 0x00C1DA),
        (call_script, "script_cf_historical_battle_notification"),
      (try_end),
###################################################
Code:
#script_cf_historical_battle_notification
("cf_historical_battle_notification",
    [
    (try_begin),
        (eq, "$g_current_hour", 7),
        (eq, "$g_current_day", 27),
        (eq, "$g_current_month", 8),
        (eq, "$g_current_year", 1814),
        (display_message, "@Burning of Washington!", 0x00C1DA),
        (jump_to_menu,"mnu_historical_battle"),
    (try_end),
    ]),
 
Upvote 0
Solution
This indicates that script is called every frame. This is getting confusing. :smile: I think it works like this. When the time comes, you're redirected to the menu. When you click one of the buttons, You go back to the main world. The game calls that script again to display date. You're redirected to the menu again. It works like an infinite loop of actions. Fixed version should work.
Code:
#################################################
(store_mod, ":cur_hour", ":num_hours", 24),
      (try_begin),
        (this_or_next|neq, "$g_current_hour", ":cur_hour"),
        (this_or_next|neq, "$g_current_day", ":cur_day"),
        (this_or_next|neq, "$g_current_month", ":cur_month"),
        (neq, "$g_current_year", ":cur_year"),
        (assign, "$g_current_hour", ":cur_hour"),
        (assign, "$g_current_day", ":cur_day"),
        (assign, "$g_current_month", ":cur_month"),
        (assign, "$g_current_year", ":cur_year"),
        (display_message, "@Time for a historical event!", 0x00C1DA),
        (call_script, "script_cf_historical_battle_notification"),
      (try_end),
###################################################
Code:
#script_cf_historical_battle_notification
("cf_historical_battle_notification",
    [
    (try_begin),
        (eq, "$g_current_hour", 7),
        (eq, "$g_current_day", 27),
        (eq, "$g_current_month", 8),
        (eq, "$g_current_year", 1814),
        (display_message, "@Burning of Washington!", 0x00C1DA),
        (jump_to_menu,"mnu_historical_battle"),
    (try_end),
    ]),
There it worked hehe, thank you very much for your help.
Now to test the meshes, the size, the text of the battle, because I decided to only put a reminder text, since adapting the code for a battle, I think it would be more difficult ...

Edit1 hahaha, I had not read the message that you put "Burning of Washington" and it surprised me and I began to investigate, looking for the word in several modules hahaha
 
Last edited:
Upvote 0
hello @RecursiveHarmony , how are you?
Well I tell you that I was adapting some codes to enter the historical battles, I lengthened the script cf_historical_battle_notification, to put another event date and directed to another menu ...
in game_menu, I adapted some from the first mission (start_phase_1, 2, 3, etc), but I took out several things and added many others.
I took the prepare_town_to_fight script, copied it and adapted it as well, then I created 2 missions in MT to play as a defender or attacker in the different scenes. I adapted the scenes with the entry points to give them the corresponding locations, etc ...
The problem that appears to me is the following:
When the battle event appears, you can exit or enter the battle, as a defender or attacker, in that there is no problem ..... the battle goes on but once it ends, I cannot exit and it shows me the screen again before entering (There are 2 screens before the battle) ... and when the battle ends, I can't redirect it to the end screen, which would be the consequences of that event, and then exit ...
What I need is to have the option to end the battle, once won or lost, a window opens to show the final text (historical_battle3) and then press exit and continue my adventure.
Here I show you what I did:

Module_Script
Code:
#script_cf_historical_battle_notification
("cf_historical_battle_notification",
    [
    (try_begin),
        (eq, "$g_current_hour", 7),
        (eq, "$g_current_day", 27),
        (eq, "$g_current_month", 8),
        (eq, "$g_current_year", 1814),
        (display_message, "@Rancagua disaster!", 0x00C1DA),
        (jump_to_menu,"mnu_batalla_rancagua"),
    (else_try),
        (eq, "$g_current_hour", 7),
        (eq, "$g_current_day", 29),
        (eq, "$g_current_month", 8),
        (eq, "$g_current_year", 1814),
        (display_message, "@Cancha Rayada surprise!", 0x00C1DA),
        (jump_to_menu,"mnu_batalla_cancharayada"),
    (try_end),
    ]),
####################
(
"historical_battle_escene",
[
(assign, "$g_mt_mode", ctm_ranged),#
(modify_visitors_at_site, "$town_scene3"),
(reset_visitors),

(set_visitors, 25, "trp_swadian_militia", 3),
(set_visitors, 26, "trp_swadian_sergeant", 2),
(set_visitors, 27, "trp_swadian_militia", 3),
(set_visitors, 8, "trp_swadian_sergeant", 2),
(set_visitors, 9, "trp_swadian_sergeant", 2),
(set_visitors, 13, "trp_swadian_crossbowman", 3),
(set_visitors, 14, "trp_swadian_sergeant", 2),
(set_visitors, 15, "trp_swadian_sergeant", 2),
(set_visitors, 16, "trp_swadian_sergeant", 2),
(set_visitors, 17, "trp_swadian_sergeant", 2),
(set_visitors, 18, "trp_swadian_militia", 2),
(set_visitors, 19, "trp_swadian_sergeant", 2),
(set_visitors, 20, "trp_swadian_militia", 2),
(set_visitors, 21, "trp_swadian_sergeant", 2),
(set_visitors, 22, "trp_swadian_sergeant", 2),
(set_visitors, 23, "trp_swadian_crossbowman", 2),
(set_visitors, 29, "trp_of_chileno", 1),
(set_visitors, 3, "trp_swadian_merchant", 1),

(set_visitors, 10, "trp_real_delima", 10),
(set_visitors, 11, "trp_vaegir_footman", 10),
(set_visitors, 12, "trp_vaegir_skirmisher", 10),

(set_visitors, 24, "trp_vaegir_skirmisher", 8),
(set_visitors, 2, "trp_real_delima", 9),
(set_visitors, 4, "trp_vaegir_footman", 10),
(set_visitors, 5, "trp_vaegir_footman", 5),
(set_visitors, 6, "trp_vaegir_footman", 5),
(set_visitors, 7, "trp_estandarte_vp", 2),
(set_visitors, 30, "trp_of_realista", 1),
(set_visitors, 28, "trp_vaegir_merchant", 1),

(try_begin),
(this_or_next|eq,"$evento",1),
(eq,"$evento",3),
(set_jump_mission,"mt_historical_battle"),
(jump_to_scene, "$town_scene3"),
(change_screen_mission),
(else_try),
(set_jump_mission,"mt_historical_battle2"),
(jump_to_scene, "$town_scene3"),
(change_screen_mission),
(try_end),
(finish_mission),
(jump_to_menu,"mnu_historical_battle3"),
]),

Module_Game_menu
Code:
################ Rancagua #################################
("batalla_rancagua", mnf_disable_all_keys,
"historical battle: Rancagua disaster!",
"none",[(set_background_mesh, "mesh_pic_rancagua")],
[
("entrar_bh1",[],"Yes I want to participate as a Patriot soldier",
[(assign, "$evento", 1),
(assign, "$g_desarrollo_bt", "str_batalla_rancagua"),# texto antes de la batalla
(assign, "$g_battle_consequences", "str_fin_rancagua"),# Texto fin batalla (consecuencias)
(jump_to_menu, "mnu_historical_battle2"),
]),
("entrar_bh2",[],"Yes I want to participate as a soldier of the Spanish crown",
[ (assign, "$evento", 2),
(assign, "$g_desarrollo_bt", "str_batalla_rancagua"),# texto antes de la batalla
(assign, "$g_battle_consequences", "str_fin_rancagua"),# Texto fin batalla (consecuencias)
(jump_to_menu, "mnu_historical_battle2"),
]),
("salir_bh",[], "Leave",
[(change_screen_map),
]),
]),
########### Cancha Rayada #############
("batalla_cancharayada", mnf_disable_all_keys,
"historical battle: Cancha Rayada surprise!",
"none",[(set_background_mesh, "mesh_pic_cancharayada")],
[
("entrar_bh1",[],"Yes I want to participate as a Patriot soldier",
[ (assign, "$evento", 3),
  (assign, "$g_desarrollo_bt", "str_batalla_cancharayada"),# texto antes de la batalla
  (assign, "$g_battle_consequences", "str_fin_cancharayada"),# Texto fin batalla (consecuencias)
  (jump_to_menu, "mnu_historical_battle2"),
]),
("entrar_bh2",[],"Yes I want to participate as a soldier of the Spanish crown",
[ (assign, "$evento", 4),
  (assign, "$g_desarrollo_bt", "str_batalla_cancharayada"),# texto antes de la batalla
  (assign, "$g_battle_consequences", "str_fin_cancharayada"),# Texto fin batalla (consecuencias)
  (jump_to_menu, "mnu_historical_battle2"),
]),
("salir_bh",[], "Leave",
[(change_screen_map),
]),
]),
############
("historical_battle2",mnf_disable_all_keys,
    "{!}{s16}",
    "none",
    [(str_store_string, s16, "$g_desarrollo_bt")],# texto antes de la batalla
    [
    ("continue",[], "Continue...",
       [
         (try_begin),
         (eq,"$evento",1),
         (assign,"$town_scene3", "scn_toma_de_talca"),
         (call_script, "script_historical_battle_escene"),
         (else_try),
         (eq,"$evento",2),
         (assign,"$town_scene3", "scn_toma_de_talca2"),
         (call_script, "script_historical_battle_escene"),
         (else_try),
         (eq,"$evento",3),
         (assign,"$town_scene3", "scn_cancharayada"),
         (call_script, "script_historical_battle_escene"),
         (else_try),
         (eq,"$evento",4),
         (assign,"$town_scene3", "scn_cancharayada2"),
         (call_script, "script_historical_battle_escene"),
         (try_end),
#         (jump_to_menu,"mnu_historical_battle3")
       ]),
    ]),

("historical_battle3",mnf_disable_all_keys,
      "{s11}",
      "none",
      [
      (str_store_string, s11, "$g_battle_consequences"),# Texto fin batalla (consecuencias)
      ],
      [("continue", [],  "Continue...",
        [(change_screen_map),
        ]),
      ]
    ),

Module_Mision_template
Code:
(
  "historical_battle",mtf_battle_mode,-1,
  "Town Fight",
  [
    (0,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
    (1,mtef_scene_source|mtef_team_0,af_override_horse,0,1,[]),
    (2,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
    (3,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (4,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
    (5,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
    (6,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
    (7,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
    (8,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (9,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (10,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
    (11,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
    (12,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
    (13,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (14,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (15,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (16,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (17,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (18,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (19,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (20,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (21,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (22,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (23,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #
    (24,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]), #
    (25,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #
    (26,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #
    (27,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]), #
    (28,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]), #
    (29,mtef_visitor_source|mtef_team_0,af_override_horse,0,1,[]),
    (30,mtef_visitor_source|mtef_team_1,af_override_horse,0,1,[]),
  ],
  [

     (ti_on_agent_spawn, 0, 0, [],
       [
        (store_trigger_param_1, ":agent_no"),
        (call_script, "script_agent_reassign_team", ":agent_no"),
        ]),
########################################################################
(ti_before_mission_start, 0, 0, [],
  [
         (team_set_relation, 0, 2, 1),
         (team_set_relation, 1, 3, 1),
         (call_script, "script_place_player_banner_near_inventory_bms"),

         (party_clear, "p_routed_enemies"),

         (assign, "$g_latest_order_1", 1),
         (assign, "$g_latest_order_2", 1),
         (assign, "$g_latest_order_3", 1),
         (assign, "$g_latest_order_4", 1),
         ]),
###########################################################
(0, 0, ti_once, [], [(start_presentation, "prsnt_killcount")]),

      (0, 0, ti_once, [
        (try_for_range, ":cur_group", 0, grc_infantry),
        (team_give_order, "$defender_team", ":cur_group", mordr_stand_ground),
        (team_give_order, "$defender_team_2", ":cur_group", mordr_stand_ground),
        (try_end),
        (try_for_range, ":cur_group", 0, grc_archers),
        (team_give_order, "$defender_team", ":cur_group", mordr_stand_ground),
        (team_give_order, "$defender_team_2", ":cur_group", mordr_stand_ground),
        (try_end),
        ], []),

#      common_battle_tab_press,
      common_battle_init_banner,
      common_battle_order_panel,
      common_battle_order_panel_tick,
      AI_kick,
##########################################################
     (ti_on_agent_killed_or_wounded, 0, 0, [],
       [
        (store_trigger_param_1, ":dead_agent_no"),
        (store_trigger_param_2, ":killer_agent_no"),
        (store_trigger_param_3, ":is_wounded"),

        (try_begin),
          (ge, ":dead_agent_no", 0),
          (neg|agent_is_ally, ":dead_agent_no"),
          (agent_is_human, ":dead_agent_no"),
          (agent_get_troop_id, ":dead_agent_troop_id", ":dead_agent_no"),
          (party_add_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1), #addition_to_p_total_enemy_casualties
          (eq, ":is_wounded", 1),
          (party_wound_members, "p_total_enemy_casualties", ":dead_agent_troop_id", 1),
        (try_end),

        (call_script, "script_apply_death_effect_on_courage_scores", ":dead_agent_no", ":killer_agent_no"),
       ]),
#######################################################
(ti_question_answered, 0, 0, [],
       [(store_trigger_param_1,":answer"),
        (eq,":answer",0),
        (assign, "$pin_player_fallen", 0),
        (try_begin),
        (store_mission_timer_a, ":elapsed_time"),
        (gt, ":elapsed_time", 20),
        (str_store_string, s5, "str_retreat"),
       (call_script, "script_simulate_retreat", 10, 20, 1),
        (try_end),
        (call_script, "script_count_mission_casualties_from_agents"),
        (finish_mission,0),]),

#####################################################
      common_music_situation_update,
      common_battle_check_friendly_kills,
      common_battle_check_victory_condition,
      common_battle_victory_display,
      common_battle_inventory,
########################################################
      (1, 4, ti_once,
              [
                  (main_hero_fallen),
                  (assign, ":pteam_alive", 0),
                  (try_for_agents, ":agent"), #Check players team is dead
                  (neq, ":pteam_alive", 1), #Break loop
                  (agent_is_ally, ":agent"),
                  (agent_is_alive, ":agent"),
                      (assign, ":pteam_alive", 1),
                  (try_end),
                  (eq, ":pteam_alive", 0),
              ],
              [
                  (assign, "$pin_player_fallen", 1),
                  (change_screen_return),
#                  (display_message, "@Press TAB to end the battle."),
              ]),
      ]
    ),
 
Upvote 0
Back
Top Bottom