Results 1 to 30 of 82

Thread: alpaca's Script-O-Rama

Threaded View

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

    Default Re: alpaca's Script-O-Rama

    Hmm ok well I'll test it out soon enough, this is puzzling for me. Meanwhile, I dug up Epistolary Richard's two scripting threads, which are frankly worth gold. I really think you should make a prominent link to them, or else incorporate them somehow: Beginner's and Intermediate Guide to scripting.

    There are some fascinating tidbits from the Intermediate Guide. For instance, say you want your script to automatically automerge all units for you, but there's only one problem -- there is no scripting command to automerge. No worries, because TW scripting allows you to call shortcuts! Thus, you can create a script to automerge, or to automatically call Ctrl+S to periodically save your campaign, or any other shortcut like that. Here's the code, from the Intermediate Guide:

    Quote Originally Posted by Stuie
    Code:
    monitor_event CharacterSelected FactionType romans_brutii
         and FactionIsLocal          
         call_object_shortcut campaign_hud automerge_units
    end_monitor
    
    monitor_event SettlementSelected FactionType romans_brutii          
         and FactionIsLocal          
         call_object_shortcut campaign_hud automerge_units
    end_monitor
    
    monitor_event CharacterSelected FactionType gauls          
         and FactionIsLocal          
         call_object_shortcut campaign_hud automerge_units
    end_monitor
    or if you want your script to speed things up,

    Quote Originally Posted by Myrddraal
    Code:
    here is a neat scripting command which I found whilst working on the MP campaign:
    
    call_object_shortcut
    
    Here is an example of the syntax:
    
    call_object_shortcut strat_ui speedup_ai
    
    the strat_ui bit is the category of the shortcut. If you open data\text\descr_shortcuts.txt and scroll to the bottom end, you'll find a list of the shortcuts with their categories to the right.
    Here's a list of all ui_elements that can be called: https://forums.totalwar.org/vb/showp...25&postcount=5

    One interesting thing from there is that you can have your script order a "order_halt" shortcut (Backspace), and trigger it whenever an enemy character becomes visible. Without this feature, normally your issued movement orders will be continued to full, even if enemies become visible in the meanwhile; else, you need to carefully watch all your characters' movements and quickly press backspace, not a pleasant alternative. Of course this script would need to be balanced, because you don't want it preventing your characters from movement altogether, when within sight of enemies. So you'd have the script disable itself after it first triggers.
    Last edited by SigniferOne; 04-11-2007 at 21:15.

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