-
[Help!] Scripting the appearance of Hannibal's army
This is a follow on from the thread in the general forum. In a nutshell I need some scripting and I'm clueless as to how you do it without wrecking the game. The limits of my modding skills are minor tinkering with the EDU and strat.txt.
Here's the situation. In 216BC I'm going to gift Capua to Qarthadast (roleplaying, it's after losing Cannae). I want Hannibal's stack to appear in Campania when this happens. I'm hoping that having some actual Qarthadastim territory to defend will prevent him trying to wander off to Spain.
What would also be nice to have is some "regeneration" of that stack in the form of Italians (Samnites, Bruttians, Lucanians). Possibly an army of Italians fighting for Qarthadast at various points too, to give me some battles I can actually win.
I like the composition from this post to start:
Quote:
The army that Hannibal used for his campaign in Italy after recruiting some Gallic mercenaries in the north of Italy. A lot of soldiers from different nations.
10/ 12000 Africans (4000 light)
7/8000 Spania (4000 light)
10/15000 Celts
4000 Numidian cavalry
4000 Celtic heavy cavaly
2000 Spanish heavy cavalry
with EB units
1 General
Infantry
1 unit of Balearic light infantry
1 unit of Balearic slingers
1 unit of Iberian caetrati
1 unit of Iberian loricati scutari
2 units of Numidian skirmishers
2 unit of Gaesatae
3 units of Geroas
2 units of Aanatim Aloopim (Elite African pikemen)
1 unit of Dorkim Aloopim (Elite African swordsmen)
Cavalry
2 units of Numidian cavalry
2 units of Brhentin (Gallic noble cavalry)
1 unit of Iberi Lanceari
The Africans in particular should be in the 5-7 experience range, the Iberians in the 2-4 range. That should give them some survivability. Then hopefully the Italians appearing will reinforce the Gallic losses.
What also needs to happen is that on a specific cue (either date or taking a settlement) that army is teleported to Africa to defend the homeland.
As a nice to have, Hasdrubal's army in Spain:
Quote:
Second Punic War – Hispania
Based on the army of Hasdrubal Gisgo and Magon Barca at the battle of Ilipa
50/70000 infantry
4000 cavalry
32 elephants
with EB units
1 General
Cavalry
1 unit of Numidian cavalry
1 unit of Iberi cavalry (lanceari, cursi, equites caetrati)
2 units of elephants
Infantry
1 units of Misteret Izrahim Tsarim (Phoenician citizen phalanx)
1 units of Dorkim Lubaim-Ponnim Mesoarianim (Liby-Phoenician heavy infantry)
2 units of Aanatim Lubim (Lybian spearmen)
4 units of Aanatim Aloopim (Elite African pikemen)
4 units of Iberi infantry
1 unit of Balearic light infantry
1 unit of Balearic slingers
1 unit of Numidian skirmishers
They don't need any regenerating units or anything, just to appear around 209BC.
Possibly some other reinforcements like those landed in Sicily, the ones that nearly got through to Tarentum and those in 215BC and 207BC (the latter resulting in Metaurus).
Alternatively, if it can be done via console command, I'd be appreciative of that.
Any help welcome!
-
Re: [Help!] Scripting the appearance of Hannibal's army
Ave Quintus
To follow from TWC to recreate Hannibal just patse this into your:
eb/data/scripts/show_me/EBBS_SCRIPT.txt
monitor_event CharacterTurnStart FactionType egypt
and I_TurnNumber = 224
spawn_army
faction egypt
character, Hannibal, named character, command 0, influence 0, management 0, subterfuge 0, age 31, , x ?, y ?
unit carthaginian cavalry generals bodyguard, exp 7 armor 1 weapon_lvl 1
unit iberian missile balearic slinger, exp 3 armor 0 weapon_lvl 0
unit iberian infantry light caetratii, exp 4 armor 1 weapon_lvl 1
unit iberian infantry loricati scutarii, exp 4 armor 1 weapon_lvl 1
unit african skirmisher javelinmen, exp 5 armor 0 weapon_lvl 0
unit african skirmisher javelinmen, exp 5 armor 0 weapon_lvl 0
unit celtic infantry gaesatae, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaesatae, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaeroas, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaeroas, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaeroas, exp 0 armor 0 weapon_lvl 0
unit carthaginian infantry aanatim afrikanim aloophim, exp 6 armor 1 weapon_lvl 1
unit carthaginian infantry aanatim afrikanim aloophim, exp 6 armor 1 weapon_lvl 1
unit carthaginian infantry dorkim afrikanim aloophim, exp 7 armor 1 weapon_lvl 1
unit celtic cavalry brihentin, exp 0 armor 1 weapon_lvl 1
unit celtic cavalry brihentin, exp 0 armor 1 weapon_lvl 1
unit iberian cavalry heavy lancearii, exp 4 armor 1 weapon_lvl 1
unit african missile cavalry numidian, exp 5 armor 0 weapon_lvl 0
unit african missile cavalry numidian, exp 5 armor 0 weapon_lvl 0
end
console_command give_trait Hannibal GoodTactician 3
end_monitor
You can give Hannibal further traits to reflect his prowess and recent victories.
You can not script in Italian replacements direct to Hannibal but you can script Italian Allied units around Capua to reflect this?
Just follow the above formula for Hasdrubal's army.
Hope this helps
Regards
KA
EDIT: make sure you obtain the correct x & y coordinates beforehand using the console command: show_cursorstat
-
Re: [Help!] Scripting the appearance of Hannibal's army
Brilliant, thanks for that King Arthur. Any thoughts on this business of having a condition that makes him teleport to Africa?
Does it matter where in the script I put it?
-
Re: [Help!] Scripting the appearance of Hannibal's army
Quote:
Originally Posted by QuintusSertorius
Brilliant, thanks for that King Arthur. Any thoughts on this business of having a condition that makes him teleport to Africa?
You're welcome. Regarding sending Hannibal back too Africa, it is possible, either use a console command move_character "Hannibal" x? , y ? or you can script in conditions such as Rome besieging Capua etc to reflect the end of the war and when this condition is met Hannibal will move to Africa. I haven't actually tried this yet in EB so not 100% it will work, but in theory it should!!
Quote:
Does it matter where in the script I put it?
Nope. I usually place all new additions at the bottom of the file so I know where to look for changes or problems. The engine will look for the faction turn command not script file location. Just make sure it sits above this:
end_script
this marker is the script ending
What I would do though is use a breaker to seperate your Punic War, I use:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Second Punic War: Hannibal in Italy;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
INSERT YOUR SCRIPT HERE
This way its easy to track your 'special events'
-
Re: [Help!] Scripting the appearance of Hannibal's army
actually if you realy want italian replacements put...
monitor_event CharacterTurnStart FactionType egypt
and I_TurnNumber = 220
console_command create_unit Hanibal "BRUTTIAN INFANTRY INTERNAL NAME" 1 3 3 3
console_command create_unit Hanibal "SAMMINITE INFANTRY INTERNAL NAME" 1 3 3 3
That way if hanibal has any free slots in his army, they will spawn.
If you wish to return him, you can do it in the game, and use the move character command.
Also, be carefull to make sure there is not another character in the game called hanibal.
-
Re: [Help!] Scripting the appearance of Hannibal's army
That actually sounds like a simpler (and thus more elegant) solution, just moving him with a console command. Then I can decide when it happens, rather than getting all complicated with scripting.
I take it turn 224 means 56 years (56x4=224) into the game? Now I'm going to have to think about the other armies that need spawning...
I'm going to need to go away and re-read The Fall of Carthage for the major reinforcements to Italy, Sicily and Spain.
Could I script the appearance of a Makedonian army in Illyria? Would dumping an army there cause them to attack if they saw the settlement's garrison was weak?
How do I use the move character command? I'm tempted to use that to shunt some Hai stacks into Seleukid territory, and maybe speed up their reinforcements.
Now my mind is running away with me, has anyone though to scripting the appearance of Antiochos to revive the Seleukids?
-
Re: [Help!] Scripting the appearance of Hannibal's army
Quote:
Originally Posted by QuintusSertorius
I take it turn 224 means 56 years (56x4=224) into the game?
Yep. Your formula is correct. However if you want armies to spawn in Winter add 3 as the X4 formula will take you into Qtr 1.
Quote:
Could I script the appearance of a Makedonian army in Illyria? Would dumping an army there cause them to attack if they saw the settlement's garrison was weak?
It could well do, but it could also just turn around and head back to Macedonia.....
If the army is there just to offer you as the Romani a good battle for the Macedonian wars, you can give the spawned Macedonian General an 'Immovable' trait (I think that's in EB???) and he will stay put, but his army may break away. The only real solution would be to have the army of Macedon spawn on your Romani turn and have an army ready to attck it straight away (assuming this is what you want?). Otherwise you could script the army to attcak a settlement, but it all depends on how complicated you want to get.
Quote:
How do I use the move character command? I'm tempted to use that to shunt some Hai stacks into Seleukid territory, and maybe speed up their reinforcements.
You would need to obtain the name of the General or Captain leading the Hai stack and then using the console type:
move_character "CHARACTER NAME" x?, y?
-
Re: [Help!] Scripting the appearance of Hannibal's army
That business with Makedonia might be getting a bit too tricksome. Perhaps easier to just wander down there and cause some havoc.
Thinking about reinforcements, there isn't a lot to do as it turns out.
In Italy there's three armies: Hannibal's to appear in 216BC in Campania; Reinforcements under Bomilkar to appear in Locri (ie Lucania) in 214BC; Hasdrubal's army marching through the alps in 208/7BC is another one. Then some Italian reinforcements and maybe the odd rebel Italian army wandering about.
In Spain we've got Gisgo/Hasdrubal's army there and Himilco and reinforcements in 216BC (I think the same one who then landed in Sicily in 213BC - so I could just move that stack).
In Sicily Himilco's army in 213BC near Syracuse (perhaps move the stack from Spain).
-
Re: [Help!] Scripting the appearance of Hannibal's army
Quote:
Originally Posted by QuintusSertorius
Could I script the appearance of a Makedonian army in Illyria? Would dumping an army there cause them to attack if they saw the settlement's garrison was weak?
There is no way to predict what the AI will do with a spawned army. AI factions' armies will usualy either move to the closest settlement of that faction or become pinned while rebel stacks will most of the time just stand around idle.
-
Re: [Help!] Scripting the appearance of Hannibal's army
Is this for RTW, BI, Alex, or all of the above?
-
Re: [Help!] Scripting the appearance of Hannibal's army
Quote:
Originally Posted by brymht
Is this for RTW, BI, Alex, or all of the above?
It can be used for all the above.
-
Re: [Help!] Scripting the appearance of Hannibal's army
Seems like I'll need to get some spies over to Africa and check out who the family members are.
Or might this be easier if I made Hannibal a general, rather than family member? Or would he get a rubbish bodyguard if I did that?
-
Re: [Help!] Scripting the appearance of Hannibal's army
Quote:
Originally Posted by QuintusSertorius
Or might this be easier if I made Hannibal a general, rather than family member? Or would he get a rubbish bodyguard if I did that?
He would get whatever bodyguard you have as first unit in your spawned stack (that's how some Greek FMs get Spartiates as bodyguards in EB).
-
Re: [Help!] Scripting the appearance of Hannibal's army
Quote:
Originally Posted by konny
He would get whatever bodyguard you have as first unit in your spawned stack (that's how some Greek FMs get Spartiates as bodyguards in EB).
Are there any advantages in making him a general, rather than family member?
-
Re: [Help!] Scripting the appearance of Hannibal's army
Quote:
Originally Posted by QuintusSertorius
Are there any advantages in making him a general, rather than family member?
I would stick with him being a FM - you can give him some nice traits this way and Ancilliaries. Not sure if there are any benefits of just being a general. Also if he is a FM he can hire Mercs, generals can not.
-
Re: [Help!] Scripting the appearance of Hannibal's army
So turn 225 is summer 216BC, right? Turn 233 is summer 214BC. Turn 256 is Spring 208BC.
Would it be worth making the less important generals (like Himilco and Bomilkar) just Generals, rather than family members? There's a risk here if I put the other reinforcements in that I'mm ballooning up the Qarthadastim family tree.
-
Re: [Help!] Scripting the appearance of Hannibal's army
Having generals won't mmake the duplicate name problem go away.
And spies are a waste of time.
In the game, just before you use the script, use the console and type, character_reset Hanibal (what ever surname you will give the scripted hanibal). If a error comes up saying he doesn't exist, then you know the name slot is free.
-
Re: [Help!] Scripting the appearance of Hannibal's army
If there is a character called Hannibal when I put the command in, what happens?
Oh, and how do I give him the trait related to knowledge of Logistics?
-
Re: [Help!] Scripting the appearance of Hannibal's army
Quote:
Originally Posted by QuintusSertorius
Oh, and how do I give him the trait related to knowledge of Logistics?
Quintus, you may add traits underneath the army spawn script. So, too look back at page 2 of this thread:
Quote:
monitor_event CharacterTurnStart FactionType egypt
and I_TurnNumber = 224
spawn_army
faction egypt
character, Hannibal, named character, command 0, influence 0, management 0, subterfuge 0, age 31, , x ?, y ?
unit carthaginian cavalry generals bodyguard, exp 7 armor 1 weapon_lvl 1
unit iberian missile balearic slinger, exp 3 armor 0 weapon_lvl 0
unit iberian infantry light caetratii, exp 4 armor 1 weapon_lvl 1
unit iberian infantry loricati scutarii, exp 4 armor 1 weapon_lvl 1
unit african skirmisher javelinmen, exp 5 armor 0 weapon_lvl 0
unit african skirmisher javelinmen, exp 5 armor 0 weapon_lvl 0
unit celtic infantry gaesatae, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaesatae, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaeroas, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaeroas, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaeroas, exp 0 armor 0 weapon_lvl 0
unit carthaginian infantry aanatim afrikanim aloophim, exp 6 armor 1 weapon_lvl 1
unit carthaginian infantry aanatim afrikanim aloophim, exp 6 armor 1 weapon_lvl 1
unit carthaginian infantry dorkim afrikanim aloophim, exp 7 armor 1 weapon_lvl 1
unit celtic cavalry brihentin, exp 0 armor 1 weapon_lvl 1
unit celtic cavalry brihentin, exp 0 armor 1 weapon_lvl 1
unit iberian cavalry heavy lancearii, exp 4 armor 1 weapon_lvl 1
unit african missile cavalry numidian, exp 5 armor 0 weapon_lvl 0
unit african missile cavalry numidian, exp 5 armor 0 weapon_lvl 0
end
console_command give_trait Hannibal GoodTactician 3
end_monitor
What you need too do is simply add:
console_command give_trait Hannibal LogisticalSkill 3
3 is the the higest level - this will appear as "Logistician" in game on his traits section. If you didn't want it this high simply change to either 1 or 2
-
Re: [Help!] Scripting the appearance of Hannibal's army
The traits and the movement codes will affect the other hanibal.
-
Re: [Help!] Scripting the appearance of Hannibal's army
So the bit I'm going to chuck in is thus:
Quote:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Second Punic War: Hannibal in Italy;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
monitor_event CharacterTurnStart FactionType egypt
and I_TurnNumber = 225
spawn_army
faction egypt
character, Hannibal, named character, command 0, influence 0, management 0, subterfuge 0, age 31, , x 105, y 124
unit carthaginian cavalry generals bodyguard, exp 7 armor 1 weapon_lvl 1
unit iberian missile balearic slinger, exp 3 armor 0 weapon_lvl 0
unit iberian infantry light caetratii, exp 4 armor 1 weapon_lvl 1
unit iberian infantry loricati scutarii, exp 4 armor 1 weapon_lvl 1
unit african skirmisher javelinmen, exp 5 armor 0 weapon_lvl 0
unit african skirmisher javelinmen, exp 5 armor 0 weapon_lvl 0
unit celtic infantry gaesatae, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaesatae, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaeroas, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaeroas, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaeroas, exp 0 armor 0 weapon_lvl 0
unit carthaginian infantry aanatim afrikanim aloophim, exp 6 armor 1 weapon_lvl 1
unit carthaginian infantry aanatim afrikanim aloophim, exp 6 armor 1 weapon_lvl 1
unit carthaginian infantry dorkim afrikanim aloophim, exp 7 armor 1 weapon_lvl 1
unit celtic cavalry brihentin, exp 0 armor 1 weapon_lvl 1
unit celtic cavalry brihentin, exp 0 armor 1 weapon_lvl 1
unit iberian cavalry heavy lancearii, exp 4 armor 1 weapon_lvl 1
unit african missile cavalry numidian, exp 5 armor 0 weapon_lvl 0
unit african missile cavalry numidian, exp 5 armor 0 weapon_lvl 0
end
console_command give_trait Hannibal GoodTactician 3
console_command give_trait Hannibal LogisticalSkill 2
end_monitor
I still need an exact location, which I'll work out. Can I add Traits to him with console commands? Any ideas on additional ones he should have? I'm thinking the one about being a skilled cavalry commander should be in there. Something to do with taking Eagles perhaps?
Any thoughts on the random Italian armies? Could they be spawned as rebels?
Quote:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Second Punic War: Italian Rebel armies;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
monitor_event CharacterTurnStart FactionType slave
and I_TurnNumber = 228
spawn_army
faction slave
character, Figvlvs, named character, command 0, influence 0, management 0, subterfuge 0, age 30, , x ?, y ?
unit italic cavalry campanian, exp 3 armor 1 weapon_lvl 1
unit samnite infantry spearmen, exp 0 armor 0 weapon_lvl 0
unit samnite infantry spearmen, exp 0 armor 0 weapon_lvl 0
unit samnite infantry swordsmen, exp 0 armor 0 weapon_lvl 0
unit samnite infantry swordsmen, exp 0 armor 0 weapon_lvl 0
unit greek infantry lucanian spearmen, exp 0 armor 0 weapon_lvl 0
unit greek infantry lucanian spearmen, exp 0 armor 0 weapon_lvl 0
unit italic infantry bruttian, exp 0 armor 0 weapon_lvl 0
unit italic infantry bruttian, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaemile liguriae, exp 0 armor 0 weapon_lvl 0
unit celtic infantry gaemile liguriae, exp 0 armor 0 weapon_lvl 0
unit celtic missile ioasatae, exp 0 armor 0 weapon 0
unit greek smirmisher akontistai, exp 0 armor 0 weapon 0
unit celtic cavalry ligurian, exp 0 armor 0 weapon_lvl 0
end
end monitor
Or could I just do this with a console command whenever I feel the need to fight some Italian armies? Does spawn_army work as a console command?
-
Re: [Help!] Scripting the appearance of Hannibal's army
Use "show cursorstat" to get the exact location.
Yes you can add traits when you want.
To spawn a rebel you can use create unit with a existing rebel captain.
Spawn army doesn't work in console.
-
Re: [Help!] Scripting the appearance of Hannibal's army
Haven't played any games for a few days, but I'll have some hours to kill in a bit so I'll get my co-ordinates, check that there's no Hannibal already, move some offending Hai family members away from the Sauromatae and possibly try out my Hannibal script. :)
Thanks everyone who's helped so far!
-
Re: [Help!] Scripting the appearance of Hannibal's army
I've put just the Hannibal script in. I'm tempted in the meantime to try out the spawn unit or whatever it's called to bolster the Qarthadast armies in Spain, which are presently pitiful.
-
Re: [Help!] Scripting the appearance of Hannibal's army
Question :
Will spawn_army
faction spain
character, Figvlvs, named character, command 0, influence 0, management 0, subterfuge 0, age 30, , x ?, y ?
spawn a general, or a family member? does it all depend on the kind of unit which is the first to be selected?
-
Re: [Help!] Scripting the appearance of Hannibal's army
I think it depends on the kind of unit that's first underneath it.
-
Re: [Help!] Scripting the appearance of Hannibal's army
How is this going? I'm trying to add a few army spawns cripts right now, and continue to get a CTD, without error message when the trigger turn hits.
-
Re: [Help!] Scripting the appearance of Hannibal's army
I haven't hit summer 216BC when he's supposed to appear, yet. I'm in winter 219BC.
-
Re: [Help!] Scripting the appearance of Hannibal's army
Please let me know and I'll add it in my script as well. Actually, I might spawn Hanibal and a companion army of reinforcements, and a few years later one for Italians.
If you want to test the script just to see if it even works, set the turn number as needed.
-
Re: [Help!] Scripting the appearance of Hannibal's army
FYI, some of my CTDs appear to be the result of using monitor_event CharacterTurnStart.
the EBSS scripts use monitor_event FactionTurnStart might work better.