Results 1 to 10 of 10

Thread: Can if's exist outside of monitors?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Alpha Zeke's Avatar Vicarius
    Join Date
    Dec 2006
    Location
    The US of A
    Posts
    2,931

    Default Can if's exist outside of monitors?

    Topic title is question
    Couldnt find this in a search anywhere, so, any answers and hopefully detailed explanations?

    For example i mean could this happen
    if so and so
    command
    end if

    instead of
    monitor
    if
    commmand
    end if
    end monitor
    Last edited by Alpha Zeke; August 11, 2010 at 12:46 AM.

  2. #2

    Default Re: Can if's exist outside of monitors?

    Do you even try this kinda stuff before making a thread about it?
    Coz seriously i think u should try it first in game thats the only way u can learn. For me it's only the hard way i can always memorize it.


    Anyways the answer to your question is NO. It has to be:-

    monitor_..........
    script........
    if
    script2.....
    end_monitor

  3. #3
    Alpha Zeke's Avatar Vicarius
    Join Date
    Dec 2006
    Location
    The US of A
    Posts
    2,931

    Default Re: Can if's exist outside of monitors?

    Try it? Yes. About 50 times. SO many different combinations of things >.<
    But thank you

  4. #4

  5. #5
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: Can if's exist outside of monitors?

    Of course they can, but i do not see any reason to do so.
    The campaign script is made in such a way, that everything outside a "monitor_" is executed on script start. So if you for example have an if outside any monitor_ then the if will get checked before any monitors are loaded, and the game will either do or do not the thing inside the if. The only thing is - since you can only test a few conditions with an if, it just doesn't make any sense to actually use it.
    So to sum up, everything inside monitor_ is caught by the magical "wait_monitors" at the end of the script. Anything outside, is executed instantly at script start and NEVER again (since the if can either return true or false).

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Can if's exist outside of monitors?

    I have used commands outside monitors, never conditions. Somehow it wouldn't make sense, difficult to explain, but I think gracul's explanation makes the most sense.










  7. #7
    Alpha Zeke's Avatar Vicarius
    Join Date
    Dec 2006
    Location
    The US of A
    Posts
    2,931

    Default Re: Can if's exist outside of monitors?

    Edit: Also, about things firing outside monitors. If you declare a counter then or set_counter, it will only be set once if outside a monitor?
    set_counter ftt 1
    Alone like that, would only be used once?

    Hmm. Ok then, another question about it.
    Code:
    monitor_event CharacterComesOfAge AgentType = princess
    	and FactionType sicily
    	and not FactionIsLocal
    	if I_CompareCounter ftt = 0
    		terminate_monitor
    	end_if
    
    	historic_event princess_sicily
    
    end_monitor
    Would that terminate the monitor before the historic event happen, or would the historic event happen once and then the monitor would never fire again? (Assuming ftt = 0)

  8. #8
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: Can if's exist outside of monitors?

    Quote Originally Posted by Historydude View Post
    Would that terminate the monitor before the historic event happen, or would the historic event happen once and then the monitor would never fire again? (Assuming ftt = 0)
    Usually all files a parsed from top to bottom. This is very important, for example, with traits because the triggers are executed in the order they are listed in the file:
    Code:
    ;--------------------------------
    Trigger One
    WhenToTest [something]
    
    Condition [whatever]
           and Trait TraitA = 0
           and Trait TraitB = 0
    
    Affects TraitA 1 Chance 50
    ;--------------------------------
    Trigger Two
    WhenToTest [something]
    
    Condition Trait TraitA = 0
    
    Affects TraitB 1 Chance 100
    This would work in the way that each character who neither has TraitA nor TraitB gets TraitA by a 50% chance, and all others get TraitB. If we turn that around it would no longer work:

    Code:
    ;--------------------------------
    Trigger Two
    WhenToTest [something]
    
    Condition Trait TraitA = 0
    
    Affects TraitB 1 Chance 100
    ;--------------------------------
    Trigger One
    WhenToTest [something]
    
    Condition [whatever]
           and Trait TraitA = 0
           and Trait TraitB = 0
    
    Affects TraitA 1 Chance 50
    Now everyone gets TraitB and no one TraitA.

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

  9. #9
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Can if's exist outside of monitors?

    If the counter is true then the monitor should terminate before the historic event.










  10. #10
    Alpha Zeke's Avatar Vicarius
    Join Date
    Dec 2006
    Location
    The US of A
    Posts
    2,931

    Default Re: Can if's exist outside of monitors?

    ...Alright. Thanks I'll keep attempting my project now. Hopefully one time it might work...

Posting Permissions

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