Page 4 of 6 FirstFirst 123456 LastLast
Results 61 to 80 of 119

Thread: How-to: Add a background script to your mod

  1. #61

    Default Re: How-to: Add a background script to your mod

    Alright , so it didn't CTD , but the message never showed up either .. Gonna check it up again ..

    EDIT : Alright , tweaked the whole script a bit , all should work fine now ..

    background_script
    Spoiler Alert, click show to read: 
    Code:
    script
    
    ; some stuff
    
    ;;;;;;;;;;;;;;;;;;;;;
    ;;;; Mission setup ;;
    
    ;;; First Mission Setup ;;;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_LocalFaction romans_julii
       and I_TurnNumber = 2
    
    advance_advice_thread first_mission
    
    end_monitor
    
    ;;; Second Mission Setup ;;;
    
    monitor_event FactionturnStart FactionIsLocal
       and I_TurnNumber = 11
       and I_CompareCounter Fmission > 0
    
       advance_advice_thread second_mission
    
    end_monitor
    
    ;;;;;;;;;;;;;;;;;;;;
    ;;;; Mission completed ;;;
    
    ; First mission succes ;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_SettlementOwner Patavium = romans_julii
       and I_TurnNumber < 10
       and I_LocalFaction romans_julii
    
       declare_counter Fmission
       set_counter Fmission 1
       console_command add_money 50000
       advance_advice_thread first_missions
    
    terminate_monitor
    end_monitor
    
    ; First mission failed ;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_SettlementOwner Patavium != romans_julii
       and I_TurnNumber = 10
    
       declare_counter Fmission
       advance_advice_thread first_missionf
       set_counter Fmission 1
    
    end_monitor
    
    ; Second mission succes ;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_SettlementOwner Thermon = romans_julii
       and I_CharacterTypeNearTile romans_julii admiral, 2 139,52
       and I_TurnNumber < 27
    
       declare_counter Smission
       set_counter Smission 1
       advance_advice_thread second_missions
    
    terminate_monitor
    end_monitor
    
    ; Second mission failed ;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_SettlementOwner Thermon != romans_julii
       and I_TurnNumber = 16
    
       declare_counter Smission
       set_counter Smission 1
       advance_advice_thread second_missionf
    
    end_monitor
    
    while I_TurnNumber < 99999
      suspend_unscripted_advice true
    end_while
    end_script


    Added some terminate_monitors were needed , tweaked the counters bit a little .. I assume it should work now

    Thx makanyane !

  2. #62
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: How-to: Add a background script to your mod

    I'm very suspicious of declaring counters inside monitors.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  3. #63

    Default Re: How-to: Add a background script to your mod

    Well I don't know I tried without , yet didn't work apparently ..

  4. #64

    Default Re: How-to: Add a background script to your mod

    You need to declare the counter - just don't do it inside a monitor

    normal practice is to declare all the counters just after the start of the script

  5. #65

    Default Re: How-to: Add a background script to your mod

    So , I suppose it should look like this ? :

    Spoiler Alert, click show to read: 
    Code:
    script
    
    ; some stuff
    
    declare_counter Fmission
    declare_counter Smission
    
    ;;;;;;;;;;;;;;;;;;;;;
    ;;;; Mission setup ;;
    
    ;;; First Mission Setup ;;;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_LocalFaction romans_julii
       and I_TurnNumber = 2
    
    advance_advice_thread first_mission
    
    end_monitor
    
    ;;; Second Mission Setup ;;;
    
    monitor_event FactionturnStart FactionIsLocal
       and I_TurnNumber = 11
       and I_CompareCounter Fmission > 0
    
       advance_advice_thread second_mission
    
    end_monitor
    
    ;;;;;;;;;;;;;;;;;;;;
    ;;;; Mission completed ;;;
    
    ; First mission succes ;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_SettlementOwner Patavium = romans_julii
       and I_TurnNumber < 10
       and I_LocalFaction romans_julii
    
       set_counter Fmission 1
       console_command add_money 50000
       advance_advice_thread first_missions
    
    terminate_monitor
    end_monitor
    
    ; First mission failed ;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_SettlementOwner Patavium != romans_julii
       and I_TurnNumber = 10
    
       advance_advice_thread first_missionf
       set_counter Fmission 1
    
    end_monitor
    
    ; Second mission succes ;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_SettlementOwner Thermon = romans_julii
       and I_CharacterTypeNearTile romans_julii admiral, 2 139,52
       and I_TurnNumber < 27
    
       set_counter Smission 1
       advance_advice_thread second_missions
    
    terminate_monitor
    end_monitor
    
    ; Second mission failed ;
    
    monitor_event FactionTurnStart FactionIsLocal
       and I_SettlementOwner Thermon != romans_julii
       and I_TurnNumber = 16
    
       set_counter Smission 1
       advance_advice_thread second_missionf
    
    end_monitor
    
    while I_TurnNumber < 99999
      suspend_unscripted_advice true
    end_while
    end_script


    Btw , does it work when you put it in those conditions with 'I_' in fornt of it ? For instance :

    Code:
    If I_TurnNumber = 1
    
    declare_counter Fmission
    
    end_if

  6. #66
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: How-to: Add a background script to your mod

    It's best to declare them before-hand, outside of any conditionals/monitors.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  7. #67

    Default Re: How-to: Add a background script to your mod

    Alright , thx mate

  8. #68

    Default Re: How-to: Add a background script to your mod

    Anyone got scripting movies to work ?

    I have this in my background script :

    Code:
    monitor_event FactionTurnStart FactionIsLocal
      and I_TurnNumber = 2
    
      play_video data/fmv/wonders/wonder_pyramids.mpg
    
    end_monitor
    I'm using a modfolder , if that's of any help ..

  9. #69
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: How-to: Add a background script to your mod

    The play_video command is not implemented.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  10. #70

    Default Re: How-to: Add a background script to your mod

    Thx .. So the only possibilty is Wonder movies , but even then ..

    Is it implented in Med2 ? I assume it is ..

  11. #71
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: How-to: Add a background script to your mod

    Well, you can insert a movie into any event scroll by tweaking descr_event_images.txt. It isn't limited to just the wonder_captured event.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  12. #72

    Default Re: How-to: Add a background script to your mod

    Well that's interesting information .. thx HouseofHam !

  13. #73
    Praepositus
    Citizen

    Join Date
    Aug 2009
    Location
    Australia
    Posts
    5,155

    Default Re: How-to: Add a background script to your mod

    Great Tutorial, especially for a begginner like me. +Rep
    Last edited by ulti; October 02, 2009 at 07:02 AM.

  14. #74

    Default Re: How-to: Add a background script to your mod

    Hi, HofH, I have a question. can two background scripts be running at same time? say, I am currently playing with EB mod so I have EB background script running. but is that possible to create my own background_script (another script) and make it run with the EB script at same time? will this cause any problem to the gameplay?

    Thanks for your reply.

  15. #75
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: How-to: Add a background script to your mod

    Nope, you'll need to add your stuff to the one that's already there.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  16. #76

    Default Re: How-to: Add a background script to your mod

    thanks for your prompt reply. I have another question. If I want to add few units to the city of Rome when I click on an UI button during gameplay, can I just add the following piece of codes to the existing EB script?

    monitor_event ButtonPressed ButtonPressed family_tree_button

    console_command create_unit Rome "roman hastati" 3 1 0 0

    end_monitor
    Last edited by jazz_chow; December 09, 2009 at 09:19 PM.

  17. #77

    Default Re: How-to: Add a background script to your mod

    EDIT : Nvm, misunderstood the post above of me
    Last edited by Killerbee; December 11, 2009 at 12:09 PM.

  18. #78
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: How-to: Add a background script to your mod

    Quote Originally Posted by jazz_chow View Post
    thanks for your prompt reply. I have another question. If I want to add few units to the city of Rome when I click on an UI button during gameplay, can I just add the following piece of codes to the existing EB script?
    The code looks valid. Give it a try.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  19. #79
    Senator
    Join Date
    Apr 2009
    Location
    Estonia
    Posts
    1,151

    Default Re: How-to: Add a background script to your mod

    Very good tutorial !

  20. #80
    Arbitrary Crusader's Avatar Praefectus
    Join Date
    Oct 2009
    Location
    In his own delusional mind
    Posts
    6,876

    Default Re: How-to: Add a background script to your mod

    I've have did what the instruction say but I'll get CTD at the starting screen.

    ♪ Now it's over, I'm dead and I haven't done anything that I want, or I'm still alive and there's nothing I want to do

Page 4 of 6 FirstFirst 123456 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •