Results 1 to 30 of 43

Thread: [Help!] Scripting the appearance of Hannibal's army

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default [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:

    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:

    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!
    Last edited by QuintusSertorius; 04-24-2008 at 00:26.
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  2. #2

    Default 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
    Last edited by King_Arthur; 04-24-2008 at 16:06.

  3. #3
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default 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?
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  4. #4

    Default 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!!

    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'
    Last edited by King_Arthur; 04-24-2008 at 16:29.

  5. #5

    Default 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.

  6. #6
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default 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?
    Last edited by QuintusSertorius; 04-24-2008 at 17:06.
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  7. #7

    Default 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.

    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.


    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?

  8. #8
    Whatever Member konny's Avatar
    Join Date
    Oct 2007
    Location
    Germania Inferior
    Posts
    1,787

    Default 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.

    Disclaimer: my posts are to be considered my private opinion and not offical statements by the EB Team

  9. #9
    Member Member brymht's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, Georgia, US.
    Posts
    292

    Default Re: [Help!] Scripting the appearance of Hannibal's army

    Is this for RTW, BI, Alex, or all of the above?

  10. #10

    Default 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.

  11. #11
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default 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?
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  12. #12
    Whatever Member konny's Avatar
    Join Date
    Oct 2007
    Location
    Germania Inferior
    Posts
    1,787

    Default 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).

    Disclaimer: my posts are to be considered my private opinion and not offical statements by the EB Team

  13. #13
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default 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?
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  14. #14
    Member Member brymht's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, Georgia, US.
    Posts
    292

    Default 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.

  15. #15
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default 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.
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  16. #16
    Member Member brymht's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, Georgia, US.
    Posts
    292

    Default 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.

  17. #17
    Member Member brymht's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, Georgia, US.
    Posts
    292

    Default 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.

  18. #18

    Default Re: [Help!] Scripting the appearance of Hannibal's army

    In the same manner as scripting Hannibal and his army, could you script the appearance of a rebel faction general with an army of roman troops, representing a civil war or the rebellion of an army?

    where do you find the in-game names for units and family members?

  19. #19
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default Re: [Help!] Scripting the appearance of Hannibal's army

    In-game names are all in the names.txt, which I think is in Data\text. That tells you what names are valid. I'm fairly certain you could script rebel armies for the civil war. I'm also thinking of doing that for "barbarian" migrations.
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  20. #20

    Default Re: [Help!] Scripting the appearance of Hannibal's army

    could you script a rebel army with roman legions

  21. #21
    Member Member brymht's Avatar
    Join Date
    Mar 2007
    Location
    Atlanta, Georgia, US.
    Posts
    292

    Default Re: [Help!] Scripting the appearance of Hannibal's army

    In the EBSS script, I see the command "Kill Character" before spawning a character. I'm guessing you can't have two characters with the same name.

    In some place it is mentioned twice. Are there any constraints around this? Hownecessary is it?

  22. #22
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default Re: [Help!] Scripting the appearance of Hannibal's army

    You definitely can't have two with the same internal name, although sometimes they can appear to have the same name in the game.
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  23. #23
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default Re: [Help!] Scripting the appearance of Hannibal's army

    AAARGH!!!!

    After all this effort, nothing happened, and I found out why:



    A Hannibal came of age a few years before the event. What's worse, I can't move him either, his internal name is not "Hannibal", I've no idea what it is.

    I've got a save before the thing was supposed to go down; is there something I can put in the script to kill the existing one?
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  24. #24
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default Re: [Help!] Scripting the appearance of Hannibal's army

    I tried adding console_command kill_character "Hannibal", but it didn't do a thing.

    Any ideas? It seems the script doesn't work at all, probably because of the aforementioned family member.

    Is there a simpler way without turn-counters that just spawns him on the next turn, since I'm in summer 216BC anyway?
    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


  25. #25
    EBII Hod Carrier Member QuintusSertorius's Avatar
    Join Date
    Apr 2008
    Location
    UK
    Posts
    23,381

    Default Re: [Help!] Scripting the appearance of Hannibal's army

    I've given up on scripting his army, instead I transported a convenient FM with a small army and zinged him up to a full stack. Now I just have to give him some appropriate traits.

    It began on seven hills - an EB 1.1 Romani AAR with historical house-rules (now ceased)
    Heirs to Lysimachos - an EB 1.1 Epeiros-as-Pergamon AAR with semi-historical houserules (now ceased)
    Philetairos' Gift - a second EB 1.1 Epeiros-as-Pergamon AAR


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO