Results 1 to 11 of 11

Thread: Raiding Script

Hybrid View

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

    Default Raiding Script

    Please note , this is not a question about modidng , it's an idea/proposal

    Alright , i was thinking bout a way to get a nice raid feature in-game for a mod of mine (concentrated on the mongols) , so i thought of a way . I thought it could be usefull for mods who include raiding factions in em (like vikings or whatever) . I know it's not the best way , and if you have another idea , please tell me , but here's mine :

    First of all , i'd make a raid like a crusade or so . But let me explain . I'd use a practically unused button (construction advice button) , to trigger a raid . A raid would take like 15 turns . First of all , when you push the button , you'll loose quite some money (like 25K or something ?) , but stacks of light infantry and cavalry instantly join your faction (i was thinking bout making new units , who have no upkeep (as they're raiders) , and pretty low stats (but high numbers)) Then , the raid session starts . You must capture(actually sack/exterminate ) as many provinces as possible within the given turns (undecided) . For each city you take , you get a money bonus (i was thinking bout 500-2000 florins - depending on how big the captured city is (if that's possible to determine in a script)) You sack the city , destroy all buildings , put taxes very high , leave 1 or 2 light raider units in it , and take the rest of your raiding force to the next city . I think it'd be a nice strategic feature : The fact that you have to pay 25K at the beginning can cause that you actually lose mony rather than gaining it , and you'd better do it in densely (sp?)populated area , so you can sack as much cities as possible .. I noticed there doesn't seem to be a "GeneralCapturedSettlement" condition , so i'd suggest the player would need to make a building (that took 1 turn to make) , so that i can use the SettlementBuildingFinished condition ..

    Alright , on to the script (it's a base , and if you see any errors , please tell me ) :

    Spoiler Alert, click show to read: 
    Code:
    script
    
    declare_counter waitraid 
    
    monitor_event ButtonPressed ButtonPressed show_construction_advice_button
       and I_CompareCounter waitraid = 0 ; You have to wait 14 turns after you activated a raid .
    
    add_events
    event	 counter	raid_accepted
    event counter	raid_declined 
    date	0
    end_add_events
    
    historic_event raid true
    
    end_monitor
    
    monitor_event FactionTurnEnd FactionIsLocal
      and I_EventCounter raid_accepted = 1
    
    console_command add_money mongols, -25000
    
    spawn_army ; Light troops
    faction mongols
    -army-
    end
    
    set_event_counter raid_accepted 0 ; Set counter to 0 so that you won't have an army spawning every turn
    set_counter waitraid 1
    
    end_monitor
    
    ; +++++++++++ Turn Counting +++++++++++++ ;
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 1
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 2
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 3
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 4
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 5
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 6
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 7
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 8
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 9
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 10
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 11
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 12
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 13
    
    inc_counter waitraid 1
    
    end_monitor
    
    monitor_event FactionTurnStart FactionType mongols
      and FactionIsLocal
      and I_CompareCounter waitraid = 14
    
    set_counter waitraid 0
    
    end_monitor
    
    ;; +++++++++++++++ End of Turn Counting +++++++++++++++++ ;;
    
    ;; City capturing bonus ;;
    
    while I_CompareCounter waitraid >= 0 ; While there's a raid busy
    monitor_event SettlementTurnStart SettlementBuildingFinished = raid_building
    
    console_command add_money mongols, 500
    
    end_monitor
    end_while
    
    wait_monitors
    end_script


    Known flaws :

    - AI will not know what the building's for and just construct it (cost will be 0 , but still ..)
    - The player can just make the building in his first settlements , to get cheap cash
    - The player can demolish the building , and re-create it to get another 500 florins ..

    Please sat what you think/could be improved

    Chears,
    KingTheoden1

  2. #2
    Emperor of The Great Unknown's Avatar Primicerius
    Join Date
    Nov 2008
    Location
    far enough where verizon cant go
    Posts
    3,110

    Default Re: Raiding Script

    maybe instead of a building the general can get a trait like raided city then put in a script to add 500 money when he gains the trait or somthing, havn't tested it of corse.
    Give a man a fish you feed him for a day, teach a man to fish you feed him for a lifetime.
    cant read?

  3. #3

    Default Re: Raiding Script

    Quote Originally Posted by Emperor of The Great Unknown View Post
    maybe instead of a building the general can get a trait like raided city then put in a script to add 500 money when he gains the trait or somthing, havn't tested it of corse.
    Yep , but the thing is , afaik , there is no condition that looks up if you captured a settlement , so the game wouldn't know when to give a trait

  4. #4
    Emperor of The Great Unknown's Avatar Primicerius
    Join Date
    Nov 2008
    Location
    far enough where verizon cant go
    Posts
    3,110

    Default Re: Raiding Script

    isn't their a trigger tho? In the trait file.
    Give a man a fish you feed him for a day, teach a man to fish you feed him for a lifetime.
    cant read?

  5. #5

    Default Re: Raiding Script

    Hmm .. I did found this in the traits file :

    Code:
        WhenToTest SackSettlement
    Could be usefull i guess ..

    Another way is to give all settlements the raid building , so i can use the "SettlementBuildingExists" condition .. Ofcourse giving a 100+ regions is a no-life job

  6. #6
    Emperor of The Great Unknown's Avatar Primicerius
    Join Date
    Nov 2008
    Location
    far enough where verizon cant go
    Posts
    3,110

    Default Re: Raiding Script

    maybe you could just add a trait to them the Looting attribute when there is a raid.
    Give a man a fish you feed him for a day, teach a man to fish you feed him for a lifetime.
    cant read?

Posting Permissions

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