Results 1 to 20 of 20

Thread: Intermediate Guide to Scripting Discussion

Hybrid View

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

    Default Re: Intermediate Guide to Scripting Discussion

    Well, perhaps it's a silly answer, but the first possible mistake is "roman Triarii" instead of "roman triarii".
    Didn't think of that. I'll fix it an give it a go.

    The second point is that I cannot see the need for a background script only for this purpose. It would be enough with a normal trigger in export_descr_advice, as in Client Kingdoms mod.
    Sorry, I didn't make it clear. I'm running a background script for a whole lot of things - such as 4tpy, historical events and such. I wanted to add this as a show_me script from the background script as the background script has the "suspend_unscripted_advice true" line added (otherwise I couldn't stop the script from continuously reloading).

    Third point: Did you try the final script without the authomatic "button pressing"?
    Good point, I'll give it a go if the Triarii typo doesn't fix it.

    You should include some "mark" just to know where the method is failing.
    Not entirely sure what you mean, or how to do it.

    When you say not working, does the advisor come up at all? Do you have entries in text\export_advice for that advice thread?
    Advisor doesn't even come up. Yes, as I said earlier, I have the text set up properly.

    Thanks for the help, guys, I'll give the script another go with a few changes.

    AFAIK RTW doesn't support multiple scripts running side by side; you'll have to include the event script in the background script in an event_monitor ButtonPressed ButtonPressed advisor_button_of_choice (excluding show_me button - no multiple scripts -> no script running -> no registered click on the button, or something to that effect; this limits the button quite surely to advisor_portrait_button).
    Good point, but I could have sworn that the TFT mod made this work...
    Last edited by Cheexsta; 12-07-2005 at 14:52.

  2. #2

    Default Re: Intermediate Guide to Scripting Discussion

    Quote Originally Posted by Cheexsta
    Not entirely sure what you mean, or how to do it.
    He means put something in the background script monitor or the script so you'll be able to see if its even being accessed. The discerning scripter uses the infamous console_command puppify_my_love for the purpose, for example:

    Code:
    monitor_event SettlementTurnStart SettlementName Rome and SettlementIsLocal and Treasury > 5000 console_command puppify_my_love advance_advice_thread Recruit_Legion_Thread end_monitor


    If your faction symbol turns into a puppy when you fulfil those criteria then you at least know that that monitor is being accessed.



    And Mark, I'm pretty sure you can run a show_me script during the campaign script of the Prologue. Guy made a special mention of how difficult it had been to get the two running at the same time.
    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
    Simulation Monkey Member The_Mark's Avatar
    Join Date
    Dec 2004
    Location
    Helsinki, Finland
    Posts
    2,613

    Default Re: Intermediate Guide to Scripting Discussion

    Hmm. I remember Guy stating that RTW didn't support multiple scripts at all, though I could very well be mistaken. Have you tried declare_show_me command, if that'd affect it?

  4. #4

    Default Re: Intermediate Guide to Scripting Discussion

    Solution found! In export_descr_script.txt I put the following trigger:
    Code:
    Trigger 2134_Recruit_Legion_Trigger
        WhenToTest SettlementPanelOpen
        
        Condition I_SettlementSelected Rome
        
        AdviceThread Recruit_Legion_Thread 0
    And in the background script:
    Code:
    monitor_event SettlementPanelOpen Rome
    	and Treasury >= 5000
    	suspend_unscripted_advice false
    end_monitor
    
    monitor_event ButtonPressed advisor_speech_bubble
    	suspend_unscripted_advice true
    end_monitor
    And then finally the Legion Recruitment script:
    Code:
    script
    
    select_ui_element advisor_dismiss_button
    simulate_mouse_click lclick_down
    simulate_mouse_click lclick_up
    
    console_command create_unit Rome "roman hastati" 2
    console_command create_unit Rome "roman princeps" 2
    console_command create_unit Rome "roman velite" 2
    console_command create_unit Rome "roman triarii" 1
    console_command create_unit Rome "roman light cavalry" 1
    console_command add_money -5000
    console_command add_population Rome -1210
    
    terminate_script
    end_script
    So what happens is that if you open the settlement panel for Rome (ie, double-click Rome) while the background script is running, it momentarily disables the "suspend_unscripted_advice" command, allowing seperate show_me scripts to run. Simultaneously, the Legion Recruitment show_me script runs (but only if Rome is selected), and the advisor pops up. Then, when the player clicks on the advisor's face (at least I think that's what advisor_speech_bubble is), the background script re-enables the "suspend_unscripted_advice" command.

    For some reason, this can only be run once per turn, though, but that's no problem. I've only tested it briefly, so there may be some more little problems, but so far so good.

    Now, to get it working with post-Marian Legions as well...
    Last edited by Cheexsta; 12-11-2005 at 13:11.

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