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

    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

  2. #2
    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?

  3. #3

    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