Results 1 to 30 of 116

Thread: An Intermediate Guide to Scripting

Hybrid View

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

    Default Re: An Intermediate Guide to Scripting

    Question guys, which I feel is a little silly but here it is nonetheless: how do you test if a character has a certain trait, and what level of the trait? I tried the following and it doesn't work:

    Code:
    monitor_event CharacterTurnStart TrueCondition
       if FactionType empire_west
          if Trait AgeTraitLevel1 = 1
             ; do some stuff
          end_if
       end_if
    end_monitor
    Last edited by SigniferOne; 02-05-2006 at 05:52.

  2. #2
    EB Traiter Member Malrubius's Avatar
    Join Date
    Jan 2005
    Location
    On a tree-covered mountain in Anniston, Alabama, USA
    Posts
    2,633

    Default Re: An Intermediate Guide to Scripting

    Code:
    monitor_event CharacterTurnStart FactionType empire_west
          and Trait AgeTraitLevel1 = 1
             ; do some stuff
         
    end_monitor

    Ah! the Generals! they are numerous, but not good for much (especially if they're Languorous)!
    -- Aristophanes, if he played EB

  3. #3

    Default Re: An Intermediate Guide to Scripting

    Hmm, that's weird, I thought both "FactionType" and "Trait" were conditions, and thus not usable in monitor_event, but only in monitor_conditions, or "if" clauses?

  4. #4
    EB Traiter Member Malrubius's Avatar
    Join Date
    Jan 2005
    Location
    On a tree-covered mountain in Anniston, Alabama, USA
    Posts
    2,633

    Default Re: An Intermediate Guide to Scripting

    Hmm, we have syntax like that in our EBBS background script, and it seems to work.

    Ah! the Generals! they are numerous, but not good for much (especially if they're Languorous)!
    -- Aristophanes, if he played EB

  5. #5
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: An Intermediate Guide to Scripting

    That is because monitor_event in fact requires an event AND a condition.
    If you don't want one, you have to use monitor_event EVENT TrueCondition or else the game will crash.

  6. #6

    Default Re: An Intermediate Guide to Scripting

    Right, but then what could be the reason why isolating the conditions into their own "if" statements, e.g in my code above, doesn't work?

  7. #7

    Default Re: An Intermediate Guide to Scripting

    Because most conditionals require exports from an event (eg, settlement, character) - and therefore need to be included in a monitor_event. It's only conditionals that start with I_ that do not require an event which can be used in if and monitor_conditions.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

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