Results 1 to 3 of 3

Thread: Making a Faction Re-emerge

Hybrid View

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

    Default Making a Faction Re-emerge

    I am trying to make a simple script to have a dead faction re-emerge. However, some scripting conditions are not working for me;

    and RiotRisk > 30 ( I am not sure what this even means or what the riotrisk refers to.)
    and SettlementLoyaltyLevel < loyalty_happy ( I managed to get this one working, but the army spawns regardless of what the settlement's loyalty is.)

    I have tried them in different ways and on their own, but I can't get them to work at all. Can anyone explain how these work? Or tell me another way to have the script check the settlements happiness, or unrest, or if it is rioting?


    Here is the whole script, everything works as it should without those two conditions. But when I use any variation of either nothing happens.

    Code:
    monitor_event FactionTurnStart FactionType slave
    	and IsFactionAIControlled
    	and not I_WorldwideAncillaryExists steward_gondor
    	and not I_SettlementOwner Anorien = sicily
    ;	and SettlementLoyaltyLevel Anorien < loyalty_happy
    ;	and RiotRisk Anorien > 30
    
    			add_money sicily 8000
    	spawn_army 
    	faction sicily
    	character	Pilimor, named character, age 44, x 245, y 126
    	traits LoyaltyStarter 1 , GoodCommander 2 , ReligionStarter 1
    		unit	Gondor Bodyguard		exp 3 armour 1 weapon_lvl 0
    		unit	Kingsguard		exp 3 armour 0 weapon_lvl 0
    		unit	Gondor Spearmen		exp 2 armour 0 weapon_lvl 0
    		unit	Gondor Spearmen		exp 1 armour 0 weapon_lvl 0
    		unit	Gondor Infantry		exp 3 armour 0 weapon_lvl 0
    		unit	Gondor Infantry		exp 2 armour 0 weapon_lvl 0
    		unit	Gondor Infantry		exp 1 armour 0 weapon_lvl 0
    		unit	Gondor Infantry		exp 2 armour 0 weapon_lvl 0
    		unit	Dismounted Kofm		exp 1 armour 0 weapon_lvl 0
    		unit	Dismounted Kofm		exp 1 armour 0 weapon_lvl 0
    		unit	Dismounted Kofm		exp 0 armour 0 weapon_lvl 0
    		unit	Dismounted Kofm		exp 2 armour 0 weapon_lvl 0
    		unit	Axemen of Lossarnach		exp 3 armour 0 weapon_lvl 0
    		unit	Gondor Archers		exp 2 armour 0 weapon_lvl 0
    		unit	Gondor Archers		exp 2 armour 0 weapon_lvl 0
    		unit	Ithilien Rangers		exp 1 armour 0 weapon_lvl 0
    		unit	Ithilien Rangers		exp 4 armour 0 weapon_lvl 0
    		unit	Ithilien Rangers		exp 3 armour 0 weapon_lvl 0
    	end
    
    terminate_monitor
    end_monitor

    Also, is there anyway to get the script to check if a faction still exists or not like the 'ancillaryexists' condition?
    Last edited by alreadyded; January 30, 2012 at 08:24 PM.

  2. #2

    Icon1 Re: Making a Faction Re-emerge

    alreadyded: You cannot use ‘SettlementLoyaltyLevel’ and ‘RiotRisk’ with ‘FactionTurnStart’: it won't work. You need to use an event that has ‘settlement’ in its exports line:
    Spoiler Alert, click show to read: 
    events:
    Code:
    ---------------------------------------------------
    Identifier:         FactionTurnStart
    Event:              A Faction has started its turn
    Exports:            faction
    Class:              ET_FACTION_TURN_START
    Author:             Guy
    ---------------------------------------------------
    
    ---------------------------------------------------
    Identifier:         SettlementTurnEnd
    Event:              A Settlement is being processed for the end of its faction's turn
    Exports:            faction, settlement, region_id
    Class:              ET_SETTLEMENT_TURN_END
    Author:             Guy
    ---------------------------------------------------
    conditions:
    Code:
    ---------------------------------------------------
    Identifier:              SettlementLoyaltyLevel
    Trigger requirements:    settlement
    Parameters:              logic token, value (loyalty_revolting, loyalty_rioting, loyalty_disillusioned, loyalty_content, loyalty_happy)
    Sample use:              SettlementLoyaltyLevel > loyalty_rioting
    Description:             How loyal is the settlement?
    Battle or Strat:         Either
    Class:                   SETTLEMENT_LOYALTY_LEVEL
    Implemented:             Yes
    Author:                  Guy
    ---------------------------------------------------
    
    ---------------------------------------------------
    Identifier:              RiotRisk
    Trigger requirements:    settlement
    Parameters:              logic token, percentage (integral, < 40 since there is never more than a 40% chance of rioting)
    Sample use:              RiotRisk > 30
    Description:             What is the chance of this settlement rioting?
    Battle or Strat:         Either
    Class:                   RIOT_RISK
    Implemented:             Yes
    Author:                  Guy
    ---------------------------------------------------
    Code:
    declare_counter spawn_sicily
    
    	monitor_event SettlementTurnEnd SettlementName Anorien
    		and not I_SettlementOwner Anorien = sicily
    		and I_NumberOfSettlements sicily = 0
    		and SettlementLoyaltyLevel < loyalty_happy
    		and RiotRisk > 30
    		set_counter spawn_sicily 1
    	terminate_monitor
    	end_monitor

  3. #3

    Default Re: Making a Faction Re-emerge

    Thanks for the info! Got everything working.

Posting Permissions

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