Results 1 to 14 of 14

Thread: "RandomPercent" parameter

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    EB Traitor Member BozosLiveHere's Avatar
    Join Date
    Jan 2006
    Location
    Uqbar, Tlön
    Posts
    3,662

    Default Re: "RandomPercent" parameter

    As Aradan wrote, using RandomPercent in traits/ancillaries allows you to have non-integer probabilities for triggers, as in this piece here:

    Code:
    ;------------------------------------------
    Trigger harsh_lifestyle1
        WhenToTest CharacterTurnEnd
    
        Condition EndedInSettlement
              and RemainingMPPercentage = 100
              and SettlementBuildingExists = governors_house
              and RandomPercent > 50
    
        Affects Austere  1  Chance  2
        Affects Pragmatic  1  Chance  2
        Affects Stoic  1  Chance  1
    You can also use it to save some lines of code: suppose that you want to trigger a certain trait B whenever a character acquires another trait A. You could either write it like this:

    Code:
    Trigger acquire_A
        WhenToTest CharacterTurnEnd
    
        Condition IsGeneral
              and Trait A < 1
            
    
        Affects  A  1  Chance  20
    
    ;-----------------------------------
    Trigger acquire_B
        WhenToTest CharacterTurnEnd
        
        Condition IsGeneral
              and Trait A = 1
              and Trait B < 1
    
    
        Affects  B  1  Chance  100
    Or you can save some bytes writing it like this:

    Code:
    Trigger acquire_A_then_B
        WhenToTest CharacterTurnEnd
    
        Condition IsGeneral
              and Trait A < 1
              and RandomPercent > 80
            
    
        Affects  A  1  Chance  100
        Affects  B  1  Chance  100
    Last edited by BozosLiveHere; 06-17-2007 at 19:59.

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