It is not possible, unfortunately. All spawned named characters will be generals.
It is not possible, unfortunately. All spawned named characters will be generals.
Hmm.. i tryed using this example only with 4turns/year script in BI and the game crashes before i can enter stratigic map. Any one managed to get 4turns per year in BI by using script?
An related Link for Scripting
http://forums.totalwar.org/vb/showthread.php?t=46738
where do i save my scirpt? can you be more pecific on the saving bit and how to work out the x and y? for amerteurs like me?
Last edited by Ojf; January 31, 2008 at 01:08 PM.
Slave armies
Is there an issue with spawning slave armies, ie for the slave faction ?
I have a script that works perfectly for normal factions, but always CTDs for slave.
I have used various combinations of general/named character, mercenary units, newly created slave units etc, but no luck.
Suggestions welcomed...
monitor_event FactionTurnStart FactionType slave
and I_TurnNumber = 33
spawn_army
faction slave
character Orrhos, named character, command 1, influence 0, management 0, subterfuge 0, age 30, , x 223, y 7
unit slave rebel, exp 4 armour 0 weapon_lvl 0
end
terminate_monitor
end_monitor
The spawn_army command itself doesn't have a problem with faction slave. I used it in the RTR VII:TIC script and it works just fine.
Possible reasons for CTD:
- mismatch in the unit name and that in EDU
- doing things during the slave turn?
- name is not in the list of rebel names (descr_names.txt and text\names.txt)
RTR website/SVN admin
- Settlement coordinate locator -for RTW/M2TW
- EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
- RTW scripting tutorials
- n-turns per year script generator
I made a script, but I do not know where to save it, someone else asked this question too. I looked at all the links you posted and read over all the articles in the thread and I still do not get it. Anyway, here it is:
script
monitor_event FactionTurnStart FactionType parthia
and I_TurnNumber = 2
if spawn_armyA=0
spawn_army
faction parthia
character Thuxra, named character, command 5, influence 5, management 3, subterfuge 2, age 38, , x 256, y 80
ancillaries galloper
unit hillmen, exp 5 armour 0 weapon_lvl 2
unit hillmen, exp 5 armour 0 weapon_lvl 2
unit east camel cataphract, exp 5 armour 0 weapon_lvl 2
unit east camel cataphract, exp 5 armour 0 weapon_lvl 0
unit east onager, exp 4 armour 0 weapon_lvl 0
unit eastern archers, exp 4 armour 0 weapon_lvl 0
unit eastern archers, exp 4 armour 0 weapon_lvl 0
unit eastern archers, exp 4 armour 0 weapon_lvl 0
unit east slinger, exp 3 armour 0 weapon_lvl 0
unit east slinger, exp 3 armour 0 weapon_lvl 0
unit east slinger, exp 3 armour 0 weapon_lvl 0
unit east archer, exp 3 armour 0 weapon_lvl 0
unit east heavy cataphract, exp 3 armour 0 weapon_lvl 0
unit east heavy cataphract, exp 3 armour 0 weapon_lvl 0
unit east infantry, exp 3 armour 0 weapon_lvl 0
unit east infantry, exp 3 armour 0 weapon_lvl 0
unit east infantry, exp 3 armour 0 weapon_lvl 0
unit east infantry, exp 3 armour 0 weapon_lvl 0
unit east infantry, exp 3 armour 0 weapon_lvl 0
unit east infantry, exp 3 armour 0 weapon_lvl 0
set_counter spawn_armyA 1
end_if
Have you read other tutorials in this forum??
Your code needs a few small fixes:
1. You need to declare counters before you use them
2. Use I_CompareCounter when comparing counter value to a constant
3. This is not descr_strat.txt, so you cannot use the spawn_army command to add ancillaries. Have to use a separate console_command for that.
4. AFAIK, the spawn army command does not really set command, management, influence, or subterfuge attribute, so it doesn't really matter what numbers you put there. To set those, you'd need to give the character some traits to increase them to the desired levels.
ps: Please, use the code tag to preserve formatting. Trying to read unformatted code is about as pleasant as tryingtoreadaphrasewrittenlikethis.
RTR website/SVN admin
- Settlement coordinate locator -for RTW/M2TW
- EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
- RTW scripting tutorials
- n-turns per year script generator
I have a question Ham,how would the monitor_event condition look for a army to spawn when a certain faction captures a settlement.I downloaded Ultimate Docudemons for some help on how to get it working but no luck
Detect and spawn immediately:
or, check at the beginning of the every turn:Code:monitor_event GeneralCaptureSettlement SettlementName = certain_settlement and FactionType = certain_faction spawn_army ... end end_monitor
Code:monitor_event SettlementTurnStart I_SettlementOwner = certain_faction spawn_army ... end end_monitor
RTR website/SVN admin
- Settlement coordinate locator -for RTW/M2TW
- EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
- RTW scripting tutorials
- n-turns per year script generator
ham i have a issue i cant get my armies to spawn
HTML Code:declare_counter spawn_armyB 1 set_counter spawn_armyB 1 declare_counter spawn_armyC 0 set_counter spawn_armyC 1 monitor_event FactionTurnEnd FactionType romans_julii and I_TurnNumber = 2 spawn_army faction romans_julii character Luca, named character, command 6, influence 6, management 7, subterfuge 0, age 29, , x 96, y 84 unit roman generals guard cavalry early exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman velite exp 2 armour 0 weapon_lvl 0 unit roman slinger exp 2 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman velite exp 2 armour 0 weapon_lvl 0 unit roman slinger exp 2 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman velite exp 2 armour 0 weapon_lvl 0 unit roman slinger exp 2 armour 0 weapon_lvl 0 end terminate_monitor end_monitor monitor_event FactionTurnEnd FactionType romans_julii and I_CompareCounter spawn_armyB = 0 and I_TurnNumber = 3 if spawn_armyB=0 spawn_army faction romans_julii character Nero, named character, command 6, influence 6, management 7, subterfuge 0, age 29, , x 89, y 90 unit roman generals guard cavalry early exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman velite exp 2 armour 0 weapon_lvl 0 unit roman slinger exp 2 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman velite exp 2 armour 0 weapon_lvl 0 unit roman slinger exp 2 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman hastati exp 1 armour 0 weapon_lvl 0 unit roman velite exp 2 armour 0 weapon_lvl 0 unit roman slinger exp 2 armour 0 weapon_lvl 0 set_counter spawn_armyB 1 end_if terminate_monitor end_monitor monitor_event FactionTurnStart FactionType romans_julii and I_LocalFaction romans_julii and I_TurnNumber = 22 if spawn_armyC=0 spawn_army faction gauls character Belenus, named character, command 2, influence 6, management 3, subterfuge 2, age 38, , x 112, y 192 unit barb chieftain cavalry early gaul exp 3 armour 0 weapon_lvl 0 unit warband sword gaul exp 3 armour 0 weapon_lvl 0 unit warband sword gaul exp 3 armour 0 weapon_lvl 0 unit warband sword gaul exp 3 armour 0 weapon_lvl 0 unit warband sword gaul exp 3 armour 0 weapon_lvl 0 unit warband spearmen gaul exp 3 armour 0 weapon_lvl 0 unit warband spearmen gaul exp 3 armour 0 weapon_lvl 0 unit warband spearmen gaul exp 3 armour 0 weapon_lvl 0 unit barb infantry gaul exp 0 armour 0 weapon_lvl 0 unit barb infantry gaul exp 0 armour 0 weapon_lvl 0 unit barb infantry gaul exp 0 armour 0 weapon_lvl 0 unit barb infantry gaul exp 0 armour 0 weapon_lvl 0 unit barb infantry gaul exp 0 armour 0 weapon_lvl 0 unit barb infantry gaul exp 0 armour 0 weapon_lvl 0 unit barb infantry gaul exp 0 armour 0 weapon_lvl 0 unit barb infantry gaul exp 0 armour 0 weapon_lvl 0 unit warband spearmen gaul exp 3 armour 0 weapon_lvl 0 unit warband spearmen gaul exp 3 armour 0 weapon_lvl 0 unit warband spearmen gaul exp 3 armour 0 weapon_lvl 0 unit barb berserker german exp 0 armour 0 weapon_lvl 0 set_counter spawn_armyC 1 end_if terminate_monitor end_monitor
1. Don't need counters. You can only get the FactionTurnStart and FactionTurnEnd events once per turn per faction.Code:monitor_event FactionTurnEnd FactionType romans_julii and I_TurnNumber = 2 spawn_army faction romans_julii character Luca, named character, command 6, influence 6, management 7, subterfuge 0, age 29, , x 96, y 84 unit roman generals guard cavalry early, exp 1 armour 0 weapon_lvl 0 end console_command create_unit "Luca" "roman hastati" 12 1 0 0 console_command create_unit "Luca" "roman velite" 3 2 0 0 console_command create_unit "Luca" "roman slinger" 3 2 0 0 terminate_monitor end_monitor monitor_event FactionTurnEnd FactionType romans_julii and I_TurnNumber = 3 spawn_army faction romans_julii character Nero, named character, command 6, influence 6, management 7, subterfuge 0, age 29, , x 89, y 90 unit roman generals guard cavalry early, exp 1 armour 0 weapon_lvl 0 end console_command create_unit "Nero" "roman hastati" 12 1 0 0 console_command create_unit "Nero" "roman velite" 3 2 0 0 console_command create_unit "Nero" "roman slinger" 3 2 0 0 terminate_monitor end_monitor monitor_event FactionTurnStart FactionType romans_julii and I_LocalFaction romans_julii and I_TurnNumber = 22 spawn_army faction gauls character Belenus, named character, command 2, influence 6, management 3, subterfuge 2, age 38, , x 112, y 192 unit barb chieftain cavalry early gaul, exp 3 armour 0 weapon_lvl 0 end console_command create_unit "Belenus" "warband sword gaul" 3 3 0 0 console_command create_unit "Belenus" "warband spearmen gaul" 6 3 0 0 console_command create_unit "Belenus" "barb infantry gaul" 8 0 0 0 console_command create_unit "Belenus" "barb berserker german" 1 0 0 0 terminate_monitor end_monitor
2. Command, influence, management, and subterfuge values are ignored. Use console_command give_trait to produce the desired effects.
3. Need to put commas after unit names when using spawn_army (different from descr_strat.txt)
4. When spawning an army with a lot of identical units, it's faster to first spawn the general, then use console_command create_unit to give him multiple units, instead of listing them out individually.
RTR website/SVN admin
- Settlement coordinate locator -for RTW/M2TW
- EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
- RTW scripting tutorials
- n-turns per year script generator
Besides, if that faction has already enough named characters, according to some internal parameter that the program uses, then the army will simply not spawn. So, if the characters are not historically necessary, spawn them as generals as it is safer.
I can't get this army to spawn:
script
monitor_event FactionTurnStart FactionType britons
and not I_LocalFaction britons
and I_TurnNumber = 20
spawn_army
faction britons
character Arapeithes, named character, command 5, influence 5, management 3, subterfuge 2, age 38, , x 322, y 125
unit barb chieftain cavalry scythian, exp 3 armour 0 weapon_lvl 2
unit sarmatian archer, exp 1 armour 0 weapon_lvl 2
unit sarmatian archer, exp 1 armour 0 weapon_lvl 2
unit sarmatian archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian noble cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian noble cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian noble cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian noble cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian heavy cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian heavy cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian heavy cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian heavy cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
end_if
terminate_monitor
end_monitor
end_script
Do I need a trigger? If so, what would it look like?
you should also have 'end', not end_if at the end of your spawn
having the end_if there without a starting if should be giving you an error message, if its not done that you might also find you're not actually yet getting it to start the script at all, how are you triggering the script?spawn_army
faction britons
character Arapeithes, named character, command 5, influence 5, management 3, subterfuge 2, age 38, , x 322, y 125
unit barb chieftain cavalry scythian, exp 3 armour 0 weapon_lvl 2......
........
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
end
Visit Total War Center Wiki for:
Total War Mods - Modding Portal - Total War Series
M2TW Modding - Battle Map Buildings - Techtrees - worldpkgdesc
Rome Remastered Modding - New Campaign Map
IWTE functions for RR - Unit models in RR
You're letting the script terminate - very common pitfall. Add this before the end_script line:
Code:while I_TurnNumber < 9999 suspend_unscripted_advice true end_while
RTR website/SVN admin
- Settlement coordinate locator -for RTW/M2TW
- EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
- RTW scripting tutorials
- n-turns per year script generator
OK, I updated the script. Now it looks like this:
script
monitor_event FactionTurnStart FactionType britons
and not I_LocalFaction britons
and I_TurnNumber = 2
spawn_army
faction britons
character Arapeithes, named character, command 5, influence 5, management 3, subterfuge 2, age 38, , x 322, y 125
unit barb chieftain cavalry scythian, exp 3 armour 0 weapon_lvl 2
unit sarmatian archer, exp 1 armour 0 weapon_lvl 2
unit sarmatian archer, exp 1 armour 0 weapon_lvl 2
unit sarmatian archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian noble cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian noble cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian noble cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian noble cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian heavy cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian heavy cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian heavy cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian heavy cavalry, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
unit sarmatian horse archer, exp 1 armour 0 weapon_lvl 0
end
terminate_monitor
end_monitor
while I_TurnNumber < 9999
suspend_unscripted_advice true
end_while
end_script
Here are the triggers:
AdviceThread Saka_Thread 1
GameArea Campaign
Item Saka_Thread 1
Suppressible y
Uninhibitable
Verbosity 3
Threshold 1
MaxRepeats 0
RepeatInterval 3
Attitude Normal
Presentation Default
Parameter CharacterName
Title Saka
Script scripts\show_me\Saka_Armies.txt
Text 4tpy_Text_01_Text1
Trigger 3704_Saka_Trigger1
WhenToTest SettlementSelected
AdviceThread Saka_Thread 1
- I wouldn't make the AdviceThread suppressible. If they suppress it, it will stop working (until you remove the preferences\advice file).
- Instead of Script scripts\show_me\Saka_Armies.txt, I'd recommend using OnDisplay scripts\show_me\Saka_Armies.txt, then the script will start as soon as the player clicks on the advisor portrait, without having to click on the 'Show me how' button.
RTR website/SVN admin
- Settlement coordinate locator -for RTW/M2TW
- EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
- RTW scripting tutorials
- n-turns per year script generator
BTW, it still isn't working. And putting OnDisplay there instead of Script causes an error message.
Oops, I meant On_display
How are you starting the script?
RTR website/SVN admin
- Settlement coordinate locator -for RTW/M2TW
- EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
- RTW scripting tutorials
- n-turns per year script generator