Results 1 to 14 of 14

Thread: Help with scripting for my Alexandros mod

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    blaaaaaaaaaarg! Senior Member Lusted's Avatar
    Join Date
    Feb 2005
    Posts
    1,773

    Default Help with scripting for my Alexandros mod

    I've had several ideas for scripts for my Alexandros mod and i'd like to know if they are feasible and doable, as scripting is perhpas the only major area of RTw modding i've got no friggin clue about.

    -Firstly, i wonder if it is possible to have a script that gives the player a certain amount of money when they take Susa, which was the Persian treasury to reflect the monetray boos tthis gave to Alexander. How would i go about doing this?

    -Secondly, is it possible to have a script that once Thebes and Athens are taken give the player the option of accpeting money and troops from Greek cities and make an alliance between the greeks and macedon/give all the Greek cities to macedon at once. If the plaer clicks no they will have to cnquer the cities themselves.

  2. #2

    Default Re: Help with scripting for my Alexandros mod

    Yes, they both sound possible.

    If this is all you want then I would recommend using event scripts rather than a background script - as it would mean the player would only have to do anything when the event occurred rather than every time they reloaded the game.

    First off read the Beginner Guide to Scripting.

    For an event script you need three things-
    - a Trigger – contained within export_descr_advice.txt
    - an Advice Thread – also contained within export_descr_advice.txt
    - a Script – a text file itself contained within data\scripts\show_me\ folder

    For the Susa event this is the sort of thing you would start off with:

    The script (Susa_event.txt) would be straightforward:

    Code:
    script
    console_command add_money 1000 
    end_script
    The Advice thread would look something like this:

    Code:
     ;------------------------------------------
    AdviceThread Susa_event_Thread
        GameArea Campaign
    
        Item Susa_event_Text_01
            Uninhibitable
            Verbosity  0 
            Threshold  1 
            Attitude Normal
            Presentation Default
            Title Susa_event_Text_01_Title
            Script scripts\show_me\Susa_event.txt
            Text Susa_event_Text_01_Text1
    Note that you would have add entries into text/export_advice.txt to make the new text appear. The text would read something like "Would you like to receive lots of money? Click the show me how button to accept."

    And the trigger would look something like this:

    Code:
    ;------------------------------------------
    Trigger Susa_event_Trigger
        WhenToTest GeneralCaptureSettlement
    
        Condition CharacterIsLocal
    and FactionType macedon
    and SettlementName Susa
    
        AdviceThread Susa_event_Thread  0
    Now, this will work so long as Susa is captured by an army led by a general and not a captain. There's a workaround for this which I can go into if you want.


    The second one is more complicated:

    Similar advice thread:

    Code:
     ;------------------------------------------
    AdviceThread Capture_Greece_Thread
        GameArea Campaign
    
        Item Capture_Greece_Text_01
            Uninhibitable
            Verbosity  0 
            Threshold  1 
            Attitude Normal
            Presentation Default
            Title Capture_Greece_Text_01_Title
            Script scripts\show_me\Capture_Greece.txt
            Text Capture_Greece_Text_01_Text1
    You'd want two different triggers:

    Code:
    ;------------------------------------------
    Trigger Capture_Greece_Athens_Trigger
        WhenToTest GeneralCaptureSettlement
    
        Condition CharacterIsLocal
    and FactionType macedon
    and SettlementName Athens
    and I_SettlementOwner Thebes = macedon
    
        AdviceThread Capture_Greece_Thread  0
    
    ;------------------------------------------
    Trigger Capture_Greece_Thebes_Trigger
        WhenToTest GeneralCaptureSettlement
    
        Condition CharacterIsLocal
    and FactionType macedon
    and SettlementName Thebes
    and I_SettlementOwner Athens = macedon
    
        AdviceThread Capture_Greece_Thread  0
    And the script (Capture_Greece.txt) would be:

    Code:
    script
    console_command add_money 1000
    console_command create_unit Athens "greek hoplite" 2 
    console_command create_unit Thebes "greek hoplite" 2 
    console_command diplomatic_stance macedon greek_cities allied
    end_script
    This would be the basics and it should all work, it's not completely foolproof or polished though and savvy/goldfish brain players can either exploit it or miss the benefits completely and the AI can break the alliance - but there are ways to offset that and to do some of the alternate things you suggested if you want to get more complicated.
    Last edited by Epistolary Richard; 09-20-2006 at 08:47.
    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
    blaaaaaaaaaarg! Senior Member Lusted's Avatar
    Join Date
    Feb 2005
    Posts
    1,773

    Default Re: Help with scripting for my Alexandros mod

    Thank you for your help on this.

    Im gonna have a 12tpy script running as well, so should i include these 2 events in it, or have them as event scripts so the message pops up? And would my other idea for the greece capture script work, eg where thebes and athens get captured and all greek cities become macedon. Could you also add in yearly tribute to the capture greece script. And i don't mind if the Greeks break the alliance, they came close to doing so several times in history.
    Last edited by Lusted; 09-20-2006 at 00:35.

  4. #4

    Default Re: Help with scripting for my Alexandros mod

    If you want lasting effects then a background script would be best. You'd add this above your 12 turn script.

    Code:
    ; Susa event
    monitor_event GeneralCaptureSettlement CharacterIsLocal
    and FactionType macedon
    and SettlementName Susa
    
    console_command add_money 5000
    
    terminate_monitor
    end_monitor
    
    
    ; Turnly tribute
    monitor_event FactionTurnStart FactionIsLocal
    and FactionType macedon
    and I_SettlementOwner Thebes = macedon
    and I_SettlementOwner Athens = macedon
    and DiplomaticStanceFromFaction greek_cities = allied
    
    console_command add_money 10
    
    terminate_monitor
    end_monitor
    If you want to give the player the choice with the Capture_Greece event then you'll probably want to use an event script - though it can be integrated in the background script with some trouble.


    Yes, you can give the other settlements to Macedon using the capture_settlement console command, however it would ejected their garrisons so you'd end up with a lot of Greek armies (or rebel if the faction has been destroyed) around the place.
    Last edited by Epistolary Richard; 09-20-2006 at 08:51.
    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

  5. #5
    blaaaaaaaaaarg! Senior Member Lusted's Avatar
    Join Date
    Feb 2005
    Posts
    1,773

    Default Re: Help with scripting for my Alexandros mod

    So if i give players the choice with the greece event, it will be difficult to implement tribute then?

  6. #6

    Default Re: Help with scripting for my Alexandros mod

    No, you put the choice element (including alliance/capturing cities) in the event script and you put the tribute in the background script.
    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