Results 1 to 30 of 116

Thread: An Intermediate Guide to Scripting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: An Intermediate Guide to Scripting

    Hi to all the scripters.

    I've been "fighting" against some script commands, and I've revised the old thread about commands working or not working (or not tested).

    As that thread was hidden in the ancient times (last year ), I prefer to post here my doubts and commments, and perhaps somebody could update the list.

    suspend_unscripted_advice true
    I thought that this command disables all the advices, except those launched in the script.
    If so, then I'm doing something wrong, as I put this at the beginning of the script and I receive advices about ships, armies and so on.
    I'm studying the scripts from other mods and in one case (I don't remember if it was TFT) this command was repeated in all the turns of the 4tpy script.
    As I'm not using 4tpy, I need a loop to keep the script monitoring events and conditions. Thus the structure of the script is this:

    Code:
    script
    suspend_unscripted_advice true
    while I_TurnNumber < 500
    here the whole script
    end_while
    terminate_script
    Should I include the suspend_unscripted advice inside the loop? I think I did it, but the advices keep on being launched.
    Should I put some repetition for this command in every turn? I'm thinking in something like this:

    Code:
    monitor_event FactionTurnStart FactionType carthage
    and I_TurnNumber < 500
    suspend_unscripted_advice true
    terminate_monitor
    select_ui_element
    I'm trying that the scripted advices will be shown directly. For this purpose I tried this structure:

    Code:
    advance_advice_thread MyNewAdvice_Thread no_dismiss
    select_ui_element advisor_portrait_button
    simulate_mouse_click lclick_down
    simulate_mouse_click lclick_up
    But I must click on the portrait manually.
    Is the ui_element advisor_portrait_button wrong? I think I saw it in some list of ui elements.

    test_message
    This is the most intriguing problem for me. I've been trying to launch different types of message, such as historic events, wonder captured, civil war... with no success.
    Just in case it was a problem of the conditions or event, I tried to launch it at the start and the end of the faction turn, at the start and the end of a character turn, but no way.
    And all those conditions or events were functional for other commands such as advices, creation of buildings or training of units.
    If the campaign must fullfil the requirements for the event, then the command test_message is useless.
    What am I doing wrong?

    senate_mission
    About the possible update of the list of working commands, I tried several of them related with senate missions:
    Code:
    senate_mission_help_player (with money or units)
    senate_mission_declare_war
    senate_mission_take_city
    The three are working, with some limitations: only for roman factions as LocalFaction, and the mission is not authomatically assigned, only the message appears.

    Cheers.

  2. #2
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

    Default Re: An Intermediate Guide to Scripting

    select_ui_element
    I'm trying that the scripted advices will be shown directly. For this purpose I tried this structure:

    ... ...

    But I must click on the portrait manually.
    Is the ui_element advisor_portrait_button wrong? I think I saw it in some list of ui elements.
    I used this once after automatically running a show me script at the start of a campaign, I wanted to dismiss the advisor. Only problem is I can't remember if it worked or not...

  3. #3
    EB2 Baseless Conjecturer Member blacksnail's Avatar
    Join Date
    Jan 2006
    Posts
    3,074

    Default Re: An Intermediate Guide to Scripting

    I can't find this anywhere else so I'll ask here.

    Say there's a building in a settlement and I want the script to open the building info scroll for that particular building (ie, the equivalent of "right-clicking" the building in the city scroll). How would I go about this? IE, assume I have the "if building X exists in settlement Y" setup correct, what command could I use to open the scroll for that particular building?

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