Results 1 to 21 of 21

Thread: Campaign script - adding a building

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Campaign script - adding a building

    Can anyone tell me how I might add a building to a settlement in a campaign before the player has his turn - but using a script? It is a descr_strat script, but I am not sure of the coding. Thx.
    "One of the most sophisticated Total War mods ever developed..."

  2. #2
    Member Member Stuie's Avatar
    Join Date
    Aug 2001
    Location
    Upper Gwynedd, PA
    Posts
    406

    Default Re: Campaign script - adding a building

    The coding is:

    Code:
    console_command create_building [settlement name] [building level id]
    Note that "settlement name" in this case is the name that appears on the map in-game.

  3. #3
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Campaign script - adding a building

    Thx Stuie.

    However that neither works from the RomeShell or from inside a script.txt declared (linked) at the bottom of the DS file.

    I desire the latter of course.
    "One of the most sophisticated Total War mods ever developed..."

  4. #4

    Default Re: Campaign script - adding a building

    It should work from a DS script. I use it in XGM to do some AI balancing at campaign start. There are some limitations. You can't upgrade buildings (it has to be a type that doesn't exist in the settlement yet) and you can't add things that would be visible on the strat map like walls, roads, or ports.

  5. #5
    Axebitten Modder Senior Member Dol Guldur's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,550

    Default Re: Campaign script - adding a building

    Does it do all levels of buildings in a tech tree if they are all set at the same settlement level?

    The test I am using is seeking to add a new building (i.e. one created by us) - which has no prior tree level present - to a village; the tech tree being keyed to the village level.

    So, to recap, I have:

    script
    script.txt

    at the end of the DS file. And then the script.txt is in the same folder as DS (this is a provincial campaign), that file being a single line as:

    console_command create_building [settlement name] [building level id]


    The settlement name is recognised as I added population to it in the RomeShell. I have tried various alternatives such as putting "script" and "end script" in and alos the tech tree level as well as just the level codename of the building. I even tried it without the console_command prefix.

    There is no recognition by the game of this script.

    I should confess I am not a scripter and do not intend to use scripts for anything but small tasks where they are essential to the game - no doubt just these campaign scripts for initial game set up. All the tutorials seem to be on all the other types of scripting :(

    Maybe now someone can see what I may be doing wrong.
    "One of the most sophisticated Total War mods ever developed..."

  6. #6

    Default Re: Campaign script - adding a building

    Okay, campaign scripts can be a little fiddly:

    Your script file should look something like:

    Code:
    console_command create_building Londinium muster_field
    console_command puppify_my_love
    end_script
    Note it does not need the 'script' command at the beginning as it would with a show_me script.

    Also, and I don't know why this is, leave a few blank lines at the bottom of your DS file and at the top of script.txt.

    As for creating stuff in a village - you can put anything anywhere using a script - you can put a Royal Barracks in a village if you want. The only thing you have to be careful of is buildings that affect the look of the campaign map (governor houses, roads, ports, walls), some of these cause problems.
    Last edited by Epistolary Richard; 04-14-2006 at 10:58.
    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

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