Results 1 to 9 of 9

Thread: Rebels Attack script, little help pls?

Hybrid View

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

    Default Rebels Attack script, little help pls?

    I've got this idea working.
    Spoiler Alert, click show to read: 

    ;--Swiss Uprising
    monitor_event EventCounter EventCounterType swiss_uprising
    and EventCounter > 0
    spawn_army
    faction slave
    character Skaris, named character, age 42, x 330, y 119,
    traits GoodCommander 4 , GoodAttacker 3 , NaturalMilitarySkill 3 , StrategyChivalry 3 , GoodAdministrator 2 , BattleChivalry 4, NightBattleCapable 2
    unit NE Bodyguard exp 6 armour 1 weapon_lvl 1
    unit Swiss Pikemen exp 6 armour 1 weapon_lvl 1
    unit Swiss Pikemen exp 6 armour 1 weapon_lvl 1
    unit Swiss Pikemen exp 6 armour 1 weapon_lvl 1
    unit Swiss Pikemen exp 6 armour 1 weapon_lvl 1
    unit Mercenary Ribault exp 3 armour 0 weapon_lvl 0
    unit Mercenary Ribault exp 3 armour 0 weapon_lvl 0
    unit Mercenary Ribault exp 3 armour 0 weapon_lvl 0
    unit Hussites exp 3 armour 0 weapon_lvl 0
    unit Hussites exp 3 armour 0 weapon_lvl 0
    unit Hussites exp 3 armour 0 weapon_lvl 0
    end
    siege_settlement Skaris, Bern, maintain
    siege_settlement Skaris, Bern, attack
    set_counter new_counter 1
    terminate_monitor
    end_monitor

    The only problem I have is if Bern is controlled by rebels, it causes a CTD. How can I make the script not run if the settlement is rebel owned?

  2. #2

    Default Re: Rebels Attack script, little help pls?

    to check if the rebels do not own the settlement you need to use a condition I_settlementOwner

    "not I_SettlementOwner = slave".
    Last edited by J@mes; August 08, 2008 at 05:25 PM.


  3. #3

    Default Re: Rebels Attack script, little help pls?

    OK, thanks for the help J@mes. This is progress, the CTD is no more. However the rebel general doesn't attack now, whether Bern is slave owned or owned by a faction.

    23:45:19.549 [game.script] [error] Script execution error for <siege_settlement>, at line 297, in mods/expanded_americas/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Attacker <Leopold> cannot siege settlemnt <Bern>.
    23:45:19.549 [game.script] [error] Script execution error for <siege_settlement>, at line 298, in mods/expanded_americas/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    Attacker <Leopold> cannot siege settlemnt <Bern>.

  4. #4

    Default Re: Rebels Attack script, little help pls?

    you have spawned a character called Skaris in the above script but your log says: Attacker <Leopold> cannot siege settlemnt <Bern>., is this a different script?


  5. #5

    Default Re: Rebels Attack script, little help pls?

    No sorry to confuse, I've just added the name Leopold to the slave section in the name.txt
    Here is the full script.

    Spoiler Alert, click show to read: 

    monitor_event EventCounter EventCounterType swiss_uprising
    and EventCounter > 0
    and not I_SettlementOwner Bern = slave
    spawn_army
    faction slave
    character Leopold, named character, age 42, x 330, y 119,
    traits GoodCommander 4 , GoodAttacker 3 , NaturalMilitarySkill 3 , StrategyChivalry 3 , BattleChivalry 4, NightBattleCapable 1
    unit NE Bodyguard exp 6 armour 1 weapon_lvl 1
    unit Swiss Pikemen exp 6 armour 1 weapon_lvl 1
    unit Swiss Pikemen exp 6 armour 1 weapon_lvl 1
    unit Swiss Pikemen exp 6 armour 1 weapon_lvl 1
    unit Swiss Pikemen exp 6 armour 1 weapon_lvl 1
    unit Swiss Pikemen exp 6 armour 1 weapon_lvl 1
    unit Mercenary Ribault exp 3 armour 0 weapon_lvl 0
    unit Mercenary Ribault exp 3 armour 0 weapon_lvl 0
    unit Mercenary Ribault exp 3 armour 0 weapon_lvl 0
    unit Chivalric Knights exp 4 armour 1 weapon_lvl 1
    unit Chivalric Knights exp 4 armour 1 weapon_lvl 1
    unit Dismounted Mercenary Knights exp 4 armour 0 weapon_lvl 1
    unit Dismounted Mercenary Knights exp 4 armour 0 weapon_lvl 1
    unit Dismounted Mercenary Knights exp 4 armour 0 weapon_lvl 1
    unit Dismounted Mercenary Knights exp 4 armour 0 weapon_lvl 1
    unit Hussites exp 3 armour 0 weapon_lvl 0
    unit Hussites exp 3 armour 0 weapon_lvl 0
    unit Hussites exp 3 armour 0 weapon_lvl 0
    end
    siege_settlement Leopold, Bern, maintain
    siege_settlement Leopold, Bern, attack
    set_counter new_counter 1
    terminate_monitor
    end_monitor


    Without the monitor the rebel army spawns, besieges and attacks bern, no errors at all (provided bern is owned by a faction other than slave). However without the monitor if the settlement is already slave owned the army spawns besieges and attacks and then CTD's as it starts to zoom in. Presumably because a faction cannot attack itself...

  6. #6
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: Rebels Attack script, little help pls?

    Without the monitor the rebel army spawns
    How is the rebel army spawning without the monitor?? Or did you mean without the I_SettlementOwner condition?

  7. #7

    Default Re: Rebels Attack script, little help pls?

    Quote Originally Posted by GrnEyedDvl View Post
    How is the rebel army spawning without the monitor?? Or did you mean without the I_SettlementOwner condition?
    Yes sorry, I've gone a bit bug eyed at this point... Without the I_SettlementOwner condition.

  8. #8

    Default Re: Rebels Attack script, little help pls?

    I where starting to wonder the army would not spawn with the settlement not being slave so attacking its own faction should not be a problem here. (correct me if i'm wrong its 12.41am here)


  9. #9

    Default

    OK guys, sorry to waste time, but changing the name back from Leopold to Skaris allows the little blighter to attack again, (don't know why) just gonna check it as bern slave owned...

    OK, success! With Bern slave owned, I still get the event but no army spawns. Which at this time of night will do nicely for me!! Thanks for your help!!
    +rep
    Last edited by Amroth; August 09, 2008 at 10:51 AM. Reason: dp

Posting Permissions

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