Results 1 to 30 of 102

Thread: A Beginner's Guide to Scripting & Scripting "How To"s

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default How to: spawn an army

    How to: Spawn an Army
    Code:
    script
    spawn_army
    faction romans_julii
    character Flavius Julius, general, command 0, influence 0, management 0, subterfuge 0, age 20, x 89, y 80
    unit roman generals guard cavalry, soldiers 20 exp 9 armour 1 weapon_lvl 0
    unit roman legionary first cohort ii, soldiers 40 exp 0 armour 0 weapon_lvl 0
    unit roman legionary cohort ii, soldiers 60 exp 0 armour 0 weapon_lvl 0
    unit roman praetorian cohort i, soldiers 60 exp 0 armour 0 weapon_lvl 0
    end
    end_script
    If you are playing as the Julii this will create an army banner with the relevant captain/family member as you define. Most of the syntax is the same as in descr_strat, however the missing clue was the positioning of the commas after the unit names as discovered here

    Family members who are spawned, however, do not appear to join that faction's family tree.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  2. #2
    Ja mata, TosaInu Forum Administrator edyzmedieval's Avatar
    Join Date
    May 2005
    Location
    Fortress of the Mountains
    Posts
    11,441

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Excellent guide Richard. Thanks for gathering all the info!
    Ja mata, TosaInu. You will forever be remembered.

    Proud

    Been to:

    Swords Made of Letters - 1938. The war is looming in France - and Alexandre Reythier does not have much time left to protect his country. A novel set before the war.

    A Painted Shield of Honour - 1313. Templar Knights in France are in grave danger. Can they be saved?

  3. #3

    Default Re: How to: spawn an army

    Quote Originally Posted by Epistolary Richard
    How to: Spawn an Army
    Code:
    script
    spawn_army
    faction romans_julii
    character Flavius Julius, general, command 0, influence 0, management 0, subterfuge 0, age 20, x 89, y 80
    unit roman generals guard cavalry, soldiers 20 exp 9 armour 1 weapon_lvl 0
    unit roman legionary first cohort ii, soldiers 40 exp 0 armour 0 weapon_lvl 0
    unit roman legionary cohort ii, soldiers 60 exp 0 armour 0 weapon_lvl 0
    unit roman praetorian cohort i, soldiers 60 exp 0 armour 0 weapon_lvl 0
    end
    end_script
    If you are playing as the Julii this will create an army banner with the relevant captain/family member as you define. Most of the syntax is the same as in descr_strat, however the missing clue was the positioning of the commas after the unit names as discovered here

    Family members who are spawned, however, do not appear to join that faction's family tree.
    Do you know if this can be randomized like the Marian Reforms? How would you set the date for the event if possible?
    PatWest the 'Intermediate Level Modder'

  4. #4

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    im trying to spawn an army but im lost what must i change in the advice thread for the spawn army not the mo money. im a noob modder

  5. #5
    is not a senior Member Meneldil's Avatar
    Join Date
    Aug 2004
    Location
    France
    Posts
    3,074

    Default Re : A Beginner's Guide to Scripting & Scripting "How To"s

    Hum, another issue there. I'm trying to make a simple campaing map perfect spy script.

    I edited export descr advice (both in the data and bi/data)
    ;------------------------------------------
    AdviceThread Help_Campaign_Keyboard_Shortcuts_Scroll_Thread
    GameArea Campaign

    Item Help_Campaign_Keyboard_Shortcuts_Scroll_Text_01
    Uninhibitable
    Verbosity 0
    Threshold 1
    Attitude Normal
    Presentation Default
    Title Help_Campaign_Keyboard_Shortcuts_Scroll_Text_01_Title
    Script scripts\show_me\spy.txt
    Text Help_Campaign_Keyboard_Shortcuts_Scroll_Text_01_Text1
    I added the spy.txt file in the correct folder (in fact, since I wasn't sure where to put it, I made a spy.txt for data/scripts/show_me/ and one for bi/data/scripts/show_me/

    The campaign works fine, but if I press F1 and click on the advice button ('?'), the advisor appears, but the game freezes.
    Any idea about what's going on ?

  6. #6
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    @Meneldil

    I think that your problem is in the script. Something similar happened also to me when there were errors in the script.
    It would be better if you post it here, or look for the help of the "scripting Gods".

  7. #7
    is not a senior Member Meneldil's Avatar
    Join Date
    Aug 2004
    Location
    France
    Posts
    3,074

    Default Re : A Beginner's Guide to Scripting & Scripting "How To"s

    Well, I don't think so actually.
    With BI, the shortcut advisor apparently doesn't work (there are commas that prevent the script from working) : if you click on the advice button, nothing will happen.
    I deleted the commas, both before the trigger and before the advisor thread, and I did not add any script. I launched the campaign, and clicked on '?' in the shortcut panel, and the game stopped aswell.

    Edit : Oddly, the script will work with another advisor help request command.
    Last edited by Meneldil; 12-06-2005 at 22:35.

  8. #8

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    I have a little (though annoying problem) regaring this script. Maybe I did it wrong way but here it goes.

    In my Imperator mod, I added the spawn army script to make Phyrrus army reappeared in summer 275 BC. I edited base on the 4TPY script. Everything goes fine, the years came and the army 'arrived' and I had another great but difficult battle with the Greeks when I thought that Phyrrus has finally been banished from Italy.

    The problem came after the event has passed. Everytime I restarted the game, after save and reloading, everytime I started the 4TPY script the army reappears , even when the Greek Cities has been eliminated. Didn't cause CTD or anything, and the game can goes on with no problem at all (except the battle with Phyrrus with his elephant army again... )

    Do note however, this only happened 'after' restarting the game If reload a save game from already on going game this 'bug' wont appear. What I always did is reload again and the spawn thing didn't appear anymore.

    I'm at lost....
    Say: O unbelievers, I serve not what you serve, nor do you serve what I serve, nor shall I serve what you are serving, nor shall you be serving what I serve.
    To you your religion, and to me my religion.

  9. #9

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Hi, Richard, I read your great guide, but still have a few questions.
    I made a script to spawn an army, but I do not know where to save it in the game files. 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


    terminate_monitor
    end_monitor
    end_script

  10. #10
    Son of a Camel Member anelious phyros's Avatar
    Join Date
    Apr 2008
    Location
    Your freagin suitcase!
    Posts
    528

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    I think it's data/scripts, also here's another guide that might help you -
    How to:Script spawn...

  11. #11

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Do anyone know a solution to make the enemy AI army, to do as you wants it to? Like scripting, creating a historical battle etc etc. Maybe some editor program (like Caligula & Hadrian) wich make script for you, Is this possible?

  12. #12

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    This files are from folder Data\world\maps\battle\custom\"Gergovia"
    1 - bookmarks.rcb
    2 - map.rbm
    3 - map.wfc
    4 - descr_battle.txt
    5 - descr_script.txt
    6 - description.txt

    This is from same folder but my map

    1- bookmarks.rcb
    2- map.wfc
    3- descr_battle.txt
    4- editor_log.txt

    How to make descr_script for battle map? What program i must use for this?
    I use Battle editor to make battles, there is no tool to make command for AI.

  13. #13
    Anything that isn't 'member' Member Squid's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    596

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    Any old text editor will do.

    -Trait/Ancillary/Building Editor

    "Two things are infinite: the universe and human stupidity;
    and I'm not sure about the universe." -----Albert Einstein

  14. #14

    Default Re: A Beginner's Guide to Scripting & Scripting "How To"s

    This might seem silly, but does a counter endure when the game is restarted, or do they have to be redefined each time the game is started? Ie. can they be used to store information through a game restart?

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