Since the the families/traits section of my mod's been finished, I finally decided to suck it up and try scripting. I thought it would be a nice easter egg in the game if Spartacus and Crixus were to appear on 73 BC, so I looked for some resources and started working.
I copied and pasted from HouseofHam's background script tutorial as much as possible, so as to not cause an error. When I start up the game, there was, of course, an error. I can't even get to the CTD phase; the game won't load past the copyright information. So yet again, I need to ask help from the powers that be in scripting:
From export_descr_advice:
Code:;------------------------------------------ AdviceThread My_Script_Thread GameArea Campaign Item my_script_Item_1 Uninhibitable Verbosity 0 Threshold 1 MaxRepeats 0 RepeatInterval 1 Attitude Normal Presentation Default Title my_script_Title_1 On_display scripts\show_me\my_script.txt Text my_script_Text_1I copied and pasted the stuff from Section II involving descr_strat.Code:;------------------------------------------ Trigger my_script_trigger_1 WhenToTest ButtonPressed Condition I_ThreadCount My_Script_Thread = 0 AdviceThread My_Script_Thread 1 ;------------------------------------------ Trigger my_script_trigger_2 WhenToTest CharacterSelected Condition I_ThreadCount My_Script_Thread = 0 AdviceThread My_Script_Thread 1 ;------------------------------------------ Trigger my_script_trigger_3 WhenToTest SettlementSelected AdviceThread My_Script_Thread 1 {my_script_Title_1}Background Script {my_script_Text_1}Script started.
From C:\Program Files\The Creative Assembly\Rome - Total War\data\scripts\show_me\my_script:
As I've said before, I can't understand scripting at all, so feel free to edit my code and post it how it should be.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 ; Handle saved game reloads monitor_event GameReloaded TrueCondition terminate_script end_monitor ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; This is where to put your own code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; For example, this will give you 1 gold at the beginning of every turn spawn_army monitor_event FactionTurnStart FactionType slave and I_TurnNumber = 434 if spawn_armyA=0 spawn_army faction slave character Spartacus, named character, command 5, influence 5, management 3, subterfuge 2, age 38, , x 104, y 67 unit roman_velite_gladiator, exp 0 armour 0 weapon_lvl 0 unit roman_velite_gladiator, exp 0 armour 0 weapon_lvl 0 unit roman_samnite_gladiator, exp 0 armour 0 weapon_lvl 0 unit roman_samnite_gladiator, exp 0 armour 0 weapon_lvl 0 unit roman_samnite_gladiator, exp 0 armour 0 weapon_lvl 0 unit roman_mirmillo_gladiator, exp 0 armour 0 weapon_lvl 0 unit roman_mirmillo_gladiator, exp 0 armour 0 weapon_lvl 0 unit roman_mirmillo_gladiator, exp 0 armour 0 weapon_lvl 0 set_counter spawn_armyA 1 end_if terminate_monitor 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. while I_TurnNumber < 99999 suspend_unscripted_advice true end_while end_script




Reply With Quote







