Results 1 to 14 of 14

Thread: Help with scripting for my Alexandros mod

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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

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