For some time now I have been trying to add a search and rescue mission to BI 1.6. I'd like to present you here the first prototype and get interested ones join testing and improving it. I apologize for the long message!
My basic idea is to add an event (or several of those) into the game where a key person is captured (=taken as prisoner) by another faction and player has to rescue him. That would add some spice to the already exciting game. While trying to balance between going for one's overall strategic goals one would also need to use attention and resources to rescue the person.
I think I have finally been able to build the first working prototype. Some of the problems have been discussed here, here and here. Big thanks go to HouseOfHam, Squid, Chris10, CPT Worsham, Kylan271 and tone who gave good advice and ideas in those threads, and hopefully will continue here as well! I decided to start this new thread, just to give it a more descriptive name and to get rid of the very preliminary considerations and some dead ends.
I'd like to remind you that I'm very inexperienced in programming and scripting. Consequently I may not have found the best possible ways to script things. But you I hope you will make it better. I hope and believe that this is anyhow a functional approach.
Please notice also that this is by far not a ready sub-mod. Although I try to be explicit about the changes required to the files, anyone who wants to try this out should have some basic modding skills to make it work.
I will explain now what the script does and how it is designed.
I will also indicate where I would really appreciate some help from more experienced modders. There may be other places that require improvements as well, so just go ahead and let us know how to make it better!
PREPARATIONS
First you need to decide if you want the person that can be captured to be one single person with name, or something more abstract, e.g. "the king". This script assumes that the person lives throughout the game, i.e. cannot really die. If you use a real person with name, you will need to come up with an explanation (to yourself) why he/she lives so much longer than the other characters. But hey, isn't that what imagination is for?
If you use something less personal, you may call the person anything else you like and it may be easier to relate to e.g. several kings that follow each other, or other less personal characters. You should also decide which factions have the nasty habit of trying to capture the person. I call them captors and in this prototype script they are the Huns and Roxolani.
The script is built on vanilla BI 1.6 and the player (i.e. you) plays Sarmatians. I have used HouseOfHams excellent background script tutorial as starting point for the script. In addition to the script, the following are needed:
- The character that can be captured, whose name in this script is Rumo. He is available from the start of the game through the BI descr_strat.txt, but he needs slight tweaking before the script works.
- Trdat is a spy who stands e.g. at the northeast corner of the map. His task is to do nothing else but every now and then have an ancillary that indicates a certain type of capture.
- Ancillary capturable_dude. He is Rumo's retinue member always when Rumo is free.
- Ancillary capturable_dude2. He is Trdat's retinue member whenever Rumo is inside an enemy city as prisoner.
- Trait HasCapturableAncillary is Rumo's trait whenever he is free.
- An indicator building (or "prison") to mark Rumo's capture in certain cities. I have created separate buildings for each captor faction, to be explicit about the original captor.
Rumo's state as a free man is indicated both with the ancillary capturable_dude and trait HasCapturableAncillary. Please start by adding these two to Rumo in descr_strat.txt!
If Rumo is captured, he is wiped out of the game (=killed). The reason for this double identification is that I could not come up with any another way of including all the features of the script.
Rumo can be captured in two ways.
1) If Rumo is "killed" in battle against an army lead by one of captors' generals, the winning general captures Rumo. This is indicated by removing Rumo from the field and transferring the capturable_dude ancillary to the captor general. The word killed is in quotation marks to indicate that he actually survived the battle alive although was first thought to be dead. Rumo is actually alive and travels with the winning general as his prisoner.
2) Rumo is also captured if he loses a certain percentage of his bodyguard in a battle against captor's army. This applies both to armies lead by generals and by captains. You may choose yourself what is the percentage of bodyguard lost that indicates "dire enough" situation where he may actually be kidnapped, and the probability of such an event in cases where the percentage is reached. If Rumo loses e.g. 80 % of his bodyguard, there could be e.g. a 50 % chance that he is captured. In the example script I have used only 10 % loss of bodyguard with 99 % chance of being captured, but that is simply to make it easier to test.
Capture through the second situation ends in Rumo being transferred to a prison in a predefined city. In this example I have used Roxolani capital for Roxolani (Campus Roxolani) and for the Huns just another nearby city (Vicus Vandali) that actually belongs to rebels in the beginning of the game. The choice is just to keep testing simple, as these cities are close to Sarmatians and rescuing him goes faster. In a real game I would use the capitals of the captor factions. After the capture Rumo is again taken away from the game and his status of being in the prison is indicated with creating a prison building in that city. For the AI to be interested in keeping the building, it should have some positive influence, e.g. increasing income or reducing unrest.
Notice that BI uses in scripts external settlement names and names that consist of more than one word may be problematic. That's why I have changed the following two city names in barbarian_invasion_regions_and_settlement_names.txt:
Vicus Vandali -> Vicusvandali
Campus Roxolani -> Campusroxolani
Whenever Rumo is captured, a message is displayed in the beginning of player's turn. The first message is different from the subsequent ones. If receiving these messages feels annoying, one can reduce the probability of the second message appearing. Every now and then the captor will also send taunting messages to the player. I have included only one taunting message that is shared by Huns and Roxolani, but there could be several different of those for each capturing faction.
The background script spawns a rescue army lead my Amage in the beginning of the game (available from second turn). This is just for testing purposes, so that it is easy to go against Huns or Roxolani. In a real game the player would need to set up a rescue team. I have actually also made the Hun armies quite a lot smaller in descr_strat.txt, since otherwise they are quite difficult to fight in the beginning. You should do the same for testing - just remove several units from their generals.
Rumo's rescue method depends on where he is. The general who has kidnapped Rumo (as his retinue member) is not keen to let him go. In order to free Rumo in such a situation, one of player's generals has to find the captor general and kill him. Player's general will acquire the ancillary capturable_dude. During such a dire fight, Rumo will escape from those who guard him and reappears in the campaign map at a location specified by you in the script. He is not ready, however, to enter battle yet. He only has the necessary trait HasCapturableAncillary, but not the ancillary. The general who freed Rumo must go to him and give the ancillary back to him by joining the two armies and dragging the ancillary to Rumo. Then Rumo is ready to go again. This may sound unnecessary, but I will return to this below.
If Rumo is kept as prisoner in a city, things are easier. The player must just occupy the city and destroy the prison building. Whenever that happens, Rumo reappears just south of the city, ready to go again with both the trait and ancillary.
With both rescue methods, the player has to wait until his next turn before the rescue becomes really active and a message about the rescue appears.
While Rumo is a prisoner in a city, the spy Trdat has ancillary capturable_dude2 to prevent Rumo being captured "multiple times" at the same time. When he is freed, Trdat loses this ancillary. Trdat should not move or do anything.
If Rumo dies from natural causes or e.g. through a storm at sea or assassination, he is respawned at a location chosen by you.
I have already identifed several weaknesses in this overall approach. Perhaps the most important of them is the situation where Rumo dies when fighting against a captain-lead army. In those battles Rumo is not captured, although he is captured if he dies when fighting a general. Instead, he is just respawn as if he would have died from natural causes. This doesn't really feel realistic. On the other hand one might get over this by thinking that an enemy captain was not aware of the "value" of the general he fought and won. But I still ask if any of you would have an idea how to make the capture happen in those cases as well?
The second problem is the need to predefine the cities for each faction into which Rumo is transported as prisoner. This causes some problems if those cities are not kept by their original factions or whenever the capture takes place the second time. If for example Huns' capital is occupied by Roxolani, the building that indicates capture by Huns is actually built now in a city controlled by Roxolani. Sounds a bit funny, but there we need to be flexible with our imagination, unless someone gets a better idea. Also after rescuing Rumo for the first time, one should leave the city and let its original owners (or someone else) retake it. Otherwise the next prison building (if Rumo is captured a second time) appears in player's own city, which doesn't make sense and makes the rescue too easy. Of course one may choose to keep the city and decide that one "plays fair" and destroyes the prison building only after successfully occupying the captors new capital. That would also make sense if one consider the prison building just as an indicator of capture and not as a real prison.
The third weakness is the need to unite Rumo and the general who has rescued him whenever he was rescued from a moving general. It would be best if he could be respawn at the location where the battle in which he was rescued took place. But I'm afraid there is no way of tracking where the rescue takes place and force respawn there, or is there? Also, it would be good to have him fully operational the moment he is respawn. That would require that he gets the trait and ancillary immediately, but then there would be two of those ancillaries in the game (one with Rumo and the other with rescuing general), and that would cause problems. If anyone can come up with a method of removing the ancillary from the rescuing general, that would be good.
Here are the changes I've made to the files:
export_descr_ancillaries.txt contains the two ancillaries and a trigger for the first one. The first ancillary is used for identifying capture when Rumo is killed by another general. He is with Rumo when Rumo is ok and with the general who keeps Rumo as prisoner as part of his retinue. The second ancillary is an indicator of Rumo being held prisoner in a city. He belongs only to Trdat.
Other changes needed for ancillaries:Code:;------------------------------------------ Ancillary capturable_dude Image hooded_figure_ancillary.tga Description capturable_dude_desc EffectsDescription capturable_dude_effects_desc Effect Influence 1 Effect TroopMorale 1 ;------------------------------------------ Ancillary capturable_dude2 Image hooded_figure_ancillary.tga Description capturable_dude2_desc EffectsDescription capturable_dude2_effects_desc Effect Influence 1 ;------------------------------------------ Trigger trigger_capturable_dude WhenToTest PostBattle Condition WonBattle and not CultureType barbarian and not CultureType eastern and not CultureType roman and not CultureType carthaginian and not FactionType goths and not FactionType ostrogoths and not FactionType slavs and not FactionType vandals and IsGeneral and not WorldwideAncillaryExists capturable_dude and not WorldwideAncillaryExists capturable_dude2 AcquireAncillary capturable_dude chance 100 ; reduce percentage above to make it more realistic ; capturing behaviour limited here to just huns and roxolani and naturally sarmatians to make rescue possible ; No trigger for capturable_dude2, as he is used only in background script.
export_descr_character_traits.txt defines the new trait needed. You will need to add the trait to Rumo also in descr_strat.txtCode:export_descr_ancillary_enums.txt capturable_dude capturable_dude_desc capturable_dude_effects_desc capturable_dude2 capturable_dude2_desc capturable_dude2_effects_desc export_ancillaries.txt ¬--------------- {capturable_dude} Capturable Dude {capturable_dude_desc} He can be captured. {capturable_dude_effects_desc} Increases influence and troop morale, both for Rumo and his captor. ¬--------------- {capturable_dude2} Capturable Dude 2 {capturable_dude2_desc} Just to record status of Rumo being captured. {capturable_dude2_effects_desc} Doesn't do much with spy.
Other changes needed for the new trait:Code:;------------------------------------------ Trait HasCapturableAncillary Characters family NoGoingBackLevel 1 Level CapturableDudeTrait Description CapturableDudeTrait_desc EffectsDescription CapturableDudeTrait_effects_desc Threshold 1 Effect TroopMorale 1
export_descr_buildings.txt contains the two new buildings that are used as "prisons".Code:export_VnVs.txt {CapturableDudeTrait} Capturable Dude Trait {CapturableDudeTrait_desc} He can be captured. {CapturableDudeTrait_effects_desc} Increases troop morale.
export_buildings.txt contains explanations for the prisons.Code:building captbyhuns { levels captbyhuns_basic { captbyhuns_basic requires factions { sarmatians, } { capability { happiness_bonus bonus 3 law_bonus bonus 3 trade_base_income_bonus bonus 5 } construction 3 cost 1600 settlement_min village upgrades { } } } plugins { } } building captbyroxolani { levels captbyroxolani_basic { captbyroxolani_basic requires factions { sarmatians, } { capability { happiness_bonus bonus 1 law_bonus bonus 1 } construction 3 cost 1600 settlement_min village upgrades { } } } plugins { } }
export_descr_advice.txt contains the advice threads called by the background script to inform the player.Code:{captbyhuns_basic} Capture indicator for Huns {captbyhuns_basic_desc} This you should not see. {captbyhuns_basic_desc_short} This you should not see. {captbyhuns_basic_sarmatians} Capture indicator for Huns {captbyhuns_basic_sarmatians_desc} This building indicates that Rumo has been captured by Huns. {captbyhuns_basic_sarmatians_desc_short} Huns have captured Rumo. {captbyroxolani_basic} Capture indicator for Roxolani {captbyroxolani_basic_desc} This you should not see. {captbyroxolani_basic_desc_short} This you should not see. {captbyroxolani_basic_sarmatians} Capture indicator for Roxolani {captbyroxolani_basic_sarmatians_desc} This building indicates that Rumo has been captured by Roxolani. {captbyroxolani_basic_sarmatians_desc_short} Roxolani have captured Rumo
export_advice.txt contains the actual message that the player sees:Code:;----------------------------------------------- AdviceThread PromptThreadCapturedJustByHuns GameArea Campaign Item PromptItem1 Uninhibitable Verbosity 0 Threshold 1 MaxRepeats 0 RepeatInterval 1 Attitude Normal Presentation Default Title CapturedJustByHunsTitle1 Text CapturedJustByHunsText1 ;----------------------------------------------- AdviceThread PromptThreadCapturedJustByRoxolani GameArea Campaign Item PromptItem1 Uninhibitable Verbosity 0 Threshold 1 MaxRepeats 0 RepeatInterval 1 Attitude Normal Presentation Default Title CapturedJustByRoxolaniTitle1 Text CapturedJustByRoxolaniText1 ;----------------------------------------------- AdviceThread PromptThreadCapturedStillByHuns GameArea Campaign Item PromptItem1 Uninhibitable Verbosity 0 Threshold 1 MaxRepeats 0 RepeatInterval 1 Attitude Normal Presentation Default Title CapturedStillByHunsTitle1 Text CapturedStillByHunsText1 ;----------------------------------------------- AdviceThread PromptThreadCapturedStillByRoxolani GameArea Campaign Item PromptItem1 Uninhibitable Verbosity 0 Threshold 1 MaxRepeats 0 RepeatInterval 1 Attitude Normal Presentation Default Title CapturedStillByRoxolaniTitle1 Text CapturedStillByRoxolaniText1 ;----------------------------------------------- AdviceThread PromptThreadRescuedJust GameArea Campaign Item PromptItem1 Uninhibitable Verbosity 0 Threshold 1 MaxRepeats 0 RepeatInterval 1 Attitude Normal Presentation Default Title RescuedJustTitle1 Text RescuedJustText1 ;----------------------------------------------- AdviceThread PromptThreadRestored GameArea Campaign Item PromptItem1 Uninhibitable Verbosity 0 Threshold 1 MaxRepeats 0 RepeatInterval 1 Attitude Normal Presentation Default Title RestoredTitle1 Text RestoredText1 ;----------------------------------------------- AdviceThread PromptThreadTaunt01 GameArea Campaign Item PromptItem1 Uninhibitable Verbosity 0 Threshold 1 MaxRepeats 0 RepeatInterval 1 Attitude Normal Presentation Default Title Taunt01Title1 Text Taunt01Text1
And finally the background script (basic solutions from HouseOfHam's tutorial):Code:¬------------------- {CapturedJustByHunsTitle1}Captured by the Huns! {CapturedJustByHunsText1}Rumo has just been captured by the Huns. ¬------------------- {CapturedJustByRoxolaniTitle1}Captured by the Roxolani! {CapturedJustByRoxolaniText1}}Rumo has just been captured by the Roxolani. ¬------------------- {CapturedStillByHunsTitle1}Captured still by the Huns! {CapturedStillByHunsText1}Rumo is still kept as prisoner by the Huns. ¬------------------- {CapturedStillByRoxolaniTitle1}Captured still by the Roxolani! {CapturedStillByRoxolaniText1}}Rumo is still kept as prisoner by the Roxolani. ¬------------------- {RescuedJustTitle1}Rumo just freed! {RescuedJustText1}Your troops have just freed Rumo from his captors! ¬------------------- {RestoredTitle1}Rumo found! {RestoredText1}Rumo was rescued and he waits near your capital. ¬------------------- {Taunt01Title1}Message from the Huns {Taunt01Text1}We are pleased to have Rumo as our guest. Perhaps your whole people would surrender to us?
I know that the background script could probably look much simpler with some "ifs", but I did not dare to start making changes, as right now it seems to function. Any suggestions are welcome. I also have some other ideas for making the capture more challenging, but I'll return to those only after hearing your initial comments!Code:script ; Anything following a semicolon is a comment. ; Remove the adviser portrait from screen. select_ui_element advisor_dismiss_button simulate_mouse_click lclick_up ; Wait for it to go away. while I_AdvisorVisible end_while suspend_unscripted_advice true ; Open the adviser message bubble automatically whenever advance_advice_thread is called. ; I recommend using this method instead of the select_ui_element + simulate_mouse_click approach. ; Do NOT mix both methods, though, or the advisor will show and then immediately close before ; you get a chance to read the text. declare_show_me ; Very useful for debugging - uncomment to use ;console_command toggle_perfect_spy ;;; ;;; --- Forced shutdown --- ;;; ;;; Press 'Esc' on the campaign map, then click on the '?' button in the ;;; menu scroll to terminate the script. ;;; ;;; When would this be useful? -- When you are already in a game and ;;; exit back to the main menu to restart the campaign, or reload a saved ;;; game, RTW does not automatically terminate the script, so you have ;;; to do it yourself. If you leave the old script running, you'll have all ;;; sorts of weird problems with the script in the new game. ;;; monitor_event ScrollAdviceRequested ScrollAdviceRequested end_game_scroll terminate_script end_monitor ; Handle saved game reloads monitor_event GameReloaded TrueCondition terminate_script end_monitor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; This is where to put your own code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; captive counter indicates the freedom status of the capturable person; possible values: 0 = free, 1 = just rescued, 2 = just captured by general, 3 = captured by general, 4 = captured into a city ; captor counter indicates who has currently captured the capturable person; possible values: 0 = no captor, 1 = huns, 2 = roxolani declare_counter captive set_counter captive 0 declare_counter captor set_counter captor 0 ; Spawn spy Trdat, the guy who should stay at north-east corner and just hold the ancillary capturable_dude2 during those times when Rumo is captured in another faction's city. ; Spanw him in the beginning just to reserve the name Trdat for him (and to prevent other named characters using the same name). ; Use preferably a name that no other faction uses. Roxolani also uses Trdat so it is not optimal. Roxolani Trdats may also get killed by script. spawn_character sarmatians Trdat, spy, command 0, influence 0, management 0, subterfuge 0, age 20, , x 254, y 154 ; Detect possible capture through excessive loss of bodyguard troops without general being killed in battle, kill general after that: ; Against Huns monitor_event PostBattle FactionType sarmatians ; this works ok both in strat map and battle map battles, tested. and FactionIsLocal and GeneralFoughtFaction huns and PercentageBodyguardKilled > 10 ; low percentage simply to make it easier to test - increase e.g. to 90 make more realistic and I_CompareCounter captive = 0 and I_CompareCounter captor = 0 and Trait HasCapturableAncillary = 1 and RandomPercent > 1 ; increase to make more realistic, value 1 just for testing advance_advice_thread PromptThreadCapturedJustByHuns 1 set_counter captive 4 set_counter captor 1 console_command kill_character "Rumo" console_command create_building Vicusvandali captbyhuns_basic console_command give_ancillary Trdat capturable_dude2 ; If Trdat would not keep this ancillary, Huns and Roxolani would always "capture Rumo" when they just win a battle when Rumo is captured in a city. end_monitor ; Against Roxolani monitor_event PostBattle FactionType sarmatians and FactionIsLocal and GeneralFoughtFaction roxolani and PercentageBodyguardKilled > 10 ; low percentage simply to make it easier to test - increase e.g. to 90 make more realistic and I_CompareCounter captive = 0 and I_CompareCounter captor = 0 and Trait HasCapturableAncillary = 1 and RandomPercent > 1 ; increase to make more realistic, value 1 just for testing advance_advice_thread PromptThreadCapturedJustByRoxolani 1 set_counter captive 4 set_counter captor 2 console_command kill_character "Rumo" console_command create_building Campusroxolani captbyroxolani_basic console_command give_ancillary Trdat capturable_dude2 ; If Trdat would not keep this ancillary, Huns and Roxolani would always "capture Rumo" when they just win a battle when Rumo is captured in a city. end_monitor ; Detect status of being captured in one of the cities (see previous monitors) after restoring a saved game. ; Detect status of being captured in one of enemy cities after reload of saved game. monitor_event SettlementTurnStart SettlementName Vicusvandali and SettlementBuildingExists = captbyhuns_basic and I_CompareCounter captive = 0 and I_CompareCounter captor = 0 set_counter captive 4 set_counter captor 1 advance_advice_thread PromptThreadCapturedStillByHuns 1 end_monitor monitor_event SettlementTurnStart SettlementName Campusroxolani and SettlementBuildingExists = captbyroxolani_basic and I_CompareCounter captive = 0 and I_CompareCounter captor = 0 set_counter captive 4 set_counter captor 2 advance_advice_thread PromptThreadCapturedStillByRoxolani 1 end_monitor ; Detect capture through general being killed in battle against Huns - ancillary aquired through eda.txt. Not sure if works in strat map battles, not tested. monitor_event CharacterTurnStart FactionType huns and FactionwideAncillaryExists capturable_dude and I_CompareCounter captive < 2 ; limit this to fire only once, when the capture is detected set_counter captive 2 set_counter captor 1 end_monitor ; Detect capture through general being killed in battle against Roxolani - ancillary aquired through eda.txt monitor_event CharacterTurnStart FactionType roxolani and FactionwideAncillaryExists capturable_dude and I_CompareCounter captive < 2 ; limit this to fire only once, when the capture is detected set_counter captive 2 set_counter captor 2 end_monitor ; Check in the beginning of player's (when playing sarmatians) faction turn whether Important dude was just captured by Huns and mark the capture as "old" at the end of turn: monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 2 and I_CompareCounter captor = 1 advance_advice_thread PromptThreadCapturedJustByHuns 1 end_monitor monitor_event FactionTurnEnd FactionType sarmatians and I_CompareCounter captive = 2 and I_CompareCounter captor = 1 set_counter captive 3 end_monitor ; Check in the beginning of player's (when playing sarmatians) faction turn whether Important dude is still captured by Huns (four monitors for Huns): ; 1st monitor just informs the player that the capture by a general is still active monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 3 and I_CompareCounter captor = 1 advance_advice_thread PromptThreadCapturedStillByHuns 1 end_monitor ; 2nd monitor informs the player that the capture where the important person is kept as prisoner in a city is still active monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 4 and I_CompareCounter captor = 1 advance_advice_thread PromptThreadCapturedStillByHuns 1 ; This message could be different from the previous to indicate place of capture. end_monitor ; 3rd monitor contains a taunt message for capture by general. It overrides the previous standard message. Don't know how to make both display. monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 3 and I_CompareCounter captor = 1 and RandomPercent < 20 ; number could be anything. Here 20 % chance for taunting to appear during a turn. advance_advice_thread PromptThreadTaunt01 1 end_monitor ; 4th monitor contains a taunt message for capture in a city. It overrides the previous standard message. Don't know how to make both display. monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 4 and I_CompareCounter captor = 1 and RandomPercent < 20 ; number could be anything. Here 20 % chance for taunting to appear during a turn. advance_advice_thread PromptThreadTaunt01 1 ; this taunt message could be different from the previous one. end_monitor ; Check in the beginning of player's (when playing sarmatians) faction turn whether Important dude was just captured by Roxolani and mark the capture as "old" at the end of turn: monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 2 and I_CompareCounter captor = 2 advance_advice_thread PromptThreadCapturedJustByRoxolani 1 end_monitor monitor_event FactionTurnEnd FactionType sarmatians and I_CompareCounter captive = 2 and I_CompareCounter captor = 2 set_counter captive 3 end_monitor ; Check in the beginning of player's (when playing sarmatians) faction turn whether Important dude is still captured by Roxolani: ; see explanation above for Huns. The taunt messages below could be different for each capturing faction. Here just the same as with Huns for simplicity. monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 3 and I_CompareCounter captor = 2 advance_advice_thread PromptThreadCapturedStillByRoxolani 1 end_monitor monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 4 and I_CompareCounter captor = 2 advance_advice_thread PromptThreadCapturedStillByRoxolani 1 ; This message could be different from the previous to indicate place of capture. end_monitor monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 3 and I_CompareCounter captor = 2 and RandomPercent < 20 ; number could be anything. Here 20 % chance for taunting to appear during a turn. advance_advice_thread PromptThreadTaunt01 1 end_monitor monitor_event FactionTurnStart FactionType sarmatians and I_CompareCounter captive = 4 and I_CompareCounter captor = 2 and RandomPercent < 20 ; number could be anything. Here 20 % chance for taunting to appear during a turn. advance_advice_thread PromptThreadTaunt01 1 ; this taunt message could be different from the previous one. end_monitor ; Detect rescue through killing a general that kept Rumo hostage - ancillary aquired through eda.txt monitor_event CharacterTurnStart FactionType sarmatians and FactionwideAncillaryExists capturable_dude and I_CompareCounter captive > 1 ; function in any case where Rumo has been captured set_counter captive 1 set_counter captor 0 spawn_army faction sarmatians character Rumo, named character, command 5, influence 0, management 0, subterfuge 0, age 20, , x 124, y 107 unit sarmatian warlords, soldiers 10 exp 5 armour 0 weapon_lvl 0 end ; console_command give_ancillary Rumo capturable_dude ; not to be given here, otherwise two capturable_dudes exist (the rescuing general has one) console_command give_trait Rumo HasCapturableAncillary 1 advance_advice_thread PromptThreadRescuedJust 1 end_monitor monitor_event FactionTurnEnd FactionType sarmatians and I_CompareCounter captive = 1 and I_CompareCounter captor = 0 set_counter captive 0 end_monitor ; Detect rescue through destroying Rumo's prison building. Rescue marked old in previous monitor. monitor_event SettlementTurnStart FactionType sarmatians and SettlementName Vicusvandali and not SettlementBuildingExists = captbyhuns_basic and I_CompareCounter captive = 4 and I_CompareCounter captor = 1 set_counter captive 1 set_counter captor 0 advance_advice_thread PromptThreadRescuedJust 1 spawn_army faction sarmatians character Rumo, named character, command 5, influence 0, management 0, subterfuge 0, age 20, , x 148, y 127 unit sarmatian warlords, soldiers 10 exp 5 armour 0 weapon_lvl 0 end console_command give_ancillary Rumo capturable_dude console_command give_trait Rumo HasCapturableAncillary 1 advance_advice_thread PromptThreadRescuedJust 1 console_command kill_character "Trdat" ; Kill the Trdat that has capturable_dude2 and respawn a new one without it, as Rumo now has capturable_dude. spawn_character sarmatians Trdat, spy, command 0, influence 0, management 0, subterfuge 0, age 20, , x 254, y 154 end_monitor monitor_event SettlementTurnStart FactionType sarmatians and SettlementName Campusroxolani and not SettlementBuildingExists = captbyroxolani_basic and I_CompareCounter captive = 4 and I_CompareCounter captor = 2 set_counter captive 1 set_counter captor 0 advance_advice_thread PromptThreadRescuedJust 1 spawn_army faction sarmatians character Rumo, named character, command 5, influence 0, management 0, subterfuge 0, age 20, , x 190, y 113 unit sarmatian warlords, soldiers 10 exp 5 armour 0 weapon_lvl 0 end console_command give_ancillary Rumo capturable_dude console_command give_trait Rumo HasCapturableAncillary 1 advance_advice_thread PromptThreadRescuedJust 1 console_command kill_character "Trdat" ; Kill the Trdat that has capturable_dude2 and respawn a new one without it, as Rumo now has capturable_dude. spawn_character sarmatians Trdat, spy, command 0, influence 0, management 0, subterfuge 0, age 20, , x 254, y 154 end_monitor ; Respawn Rumo if he dies without battle (e.g. due to old age or storm at sea) or in battle against captain-led army (where currently no capture takes place). monitor_event FactionTurnStart FactionType sarmatians and FactionIsLocal and I_CompareCounter captive = 0 and I_CompareCounter captor = 0 and not WorldwideAncillaryExists capturable_dude ; Not sure if this works here. spawn_army faction sarmatians character Rumo, named character, command 5, influence 0, management 0, subterfuge 0, age 20, , x 155, y 110 unit sarmatian warlords, soldiers 10 exp 5 armour 0 weapon_lvl 0 end console_command give_ancillary Rumo capturable_dude console_command give_trait Rumo HasCapturableAncillary 1 advance_advice_thread PromptThreadRestored 1 end_monitor ; Respawn Trdat if he dies by an assassin or for any other reason. ;monitor_event FactionTurnEnd FactionType sarmatians ; and FactionIsLocal ; and I_CompareCounter captive = 4 ; and not WorldwideAncillaryExists capturable_dude ; Not sure if this works here. ; spawn_character sarmatians Trdat, spy, command 0, influence 0, management 0, subterfuge 0, age 20, , x 254, y 154 ; console_command give_ancillary Trdat capturable_dude ;end_monitor ; Spawn rescue army with Amage. Just to test rescue, remove from final campaign version. declare_counter amageexists set_counter amageexists 0 monitor_event FactionTurnEnd FactionType sarmatians and FactionIsLocal and I_CompareCounter amageexists = 0 spawn_army faction sarmatians character Amage, named character, command 5, influence 0, management 0, subterfuge 0, age 20, , x 180, y 135 unit sarmatian warlords, soldiers 20 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 unit sarmatian armoured archers, soldiers 80 exp 5 armour 0 weapon_lvl 0 end set_counter amageexists 1 end_monitor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; End of your code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Spin forever - Do not let the script terminate or any monitors you have set up will immediately get thrown away. ; In M2TW scripts, this loop is replaced by the wait_monitors command. Unfortunately, this command is not available in RTW. while I_TurnNumber < 99999 suspend_unscripted_advice true end_while end_script![]()




Reply With Quote







