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

    My question might sound obvious, but I'm trying to create a script that would order a AI character to attack a given settlements during AI turn, but I can't really find out what I should do. Is it a campaign or a show me script ?

  2. #2

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

    It would depend on whether or not you wanted the player to be able to save either before the script ran or while it was running. If it was something that happened at the very start of the campaign you can use a campaign script.

    What you can do is what Myrddraal does with his scripts and that is use a campaign script to start a show_me script. This means that the script starts running at the beginning of a campaign without player involvement, but all the campaign script does is advance the advice thread and simulate the show_me buttons being pressed. So a second into the campaign, the campaign script has finished running and therefore the player can save. After that, the show_me script is in control and the player can save as normal.

    The campaign/show_me division solely relates to how the script is initiated. Show_me scripts are then further divided into event scripts and background scripts.

    The difference between the two is essentially whether the script is intended to have a single, instantaneous effect on the game (such as creating a unit or giving more money) or whether the script is designed to be constantly running in the background of the game (such as the multiple turns script).

    Both rely on the player to activate them, however an event script requires player interaction on each and every occasion it wants to make a change to the game, whereas once a background script has been activated it can make lots of changes to the game without the player's approval or even knowledge.

    Generally speaking, it's better to use a background script for anything that involves the AI.
    Last edited by Epistolary Richard; 05-03-2005 at 10:20.
    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

  3. #3
    Member Member Jason's Avatar
    Join Date
    May 2005
    Location
    Ft. Worth, Texas
    Posts
    30

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

    Richard,

    Yes I noticed the spaces the board put in your notes but after comparison with the file I saw that they werent supposed to be there so I didnt put them in. So I guess I didnt actually follow your instructions to the letter

    I will try that show_err command when I get home and report back then.

    Jason

  4. #4
    Member Member Jason's Avatar
    Join Date
    May 2005
    Location
    Ft. Worth, Texas
    Posts
    30

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

    Alas show_err did not give me any errors. It just simply crashes to the desktop whenever I put that script line in AdviceThread Help_Campaign_Keyboard_Shortcuts_Scroll_Thread.

  5. #5

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

    Hmmm... I really can't think what it might be. You are putting the mo_money.txt file in data\scripts\show_me\ and not just in data\scripts\ right? If all else fails, try referencing the advicethread to one of the scripts you get with the original game.
    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

  6. #6
    Member Member Jason's Avatar
    Join Date
    May 2005
    Location
    Ft. Worth, Texas
    Posts
    30

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

    Yay! I found what my problem was. And this took some finding by the way.

    Ok so when I made the mo_money.txt file I right clicked in the show_me folder to create a text file. I then named the file mo_money.txt

    This created the problem. It confused the hell out of my poor copy of RTW because even though MS thought it was a txt file it was actually labeled improperly. Once I deleted the file, and named the new one simply mo_money and cut and pasted what was in the original post everything worked as advertised.

    So all that being said Im going to go over here and hide in the corner with my stupidity. Thank you for your help and hopefully I will be able to pull of other mods with a little better success rate.

    Jason

  7. #7

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

    You know what? I made exactly the same mistake once when messing around with custom tiles. I think our computers must be on a setting where they conceal the extension so that you actually named it mo_money.txt.txt.
    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