Results 1 to 5 of 5

Thread: SettlementBuildingsExists issues

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Linyoa's Avatar Civis
    Join Date
    Apr 2008
    Location
    Switzerland
    Posts
    103

    Icon9 SettlementBuildingsExists issues

    Hey guys,

    So I've finally tried to dip my toe into the scripting pool, and after read up some classes at the university I think I've gotten a basic knowledge of it. Sadly my first (rather basic script) is not working. I've tried my best to figure out the problem but to no avail

    Spoiler Alert, click show to read: 
    script
    declare_counter shrine_niren

    monitor_event SettlementTurnEnd SettlementBuildingExists == shrine_nirentosh
    and SettlementName Midgar
    set_counter shrine_niren 1
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    and I_CompareCounter shrine_niren == 1
    historic_event venice_king_event
    end_monitor

    monitor_event SettlementTurnEnd SettlementBuildingExists != shrine_nirentosh
    and SettlementName Midgar
    set_counter shrine_niren 0
    end_monitor

    monitor_event FactionTurnEnd FactionIsLocal
    and I_CompareCounter shrine_niren == 0
    historic_event england_king_event
    end_monitor

    wait_monitors
    end_script


    I am fairly sure the problem lies in the third monitor, which sets the shrine_niren counter to 0 if shrine_nirentosh is not present, as I have made sure that the other three monitors are working.

    Can you not use != (building not present) ? I haven't been able to find an example of someone else using it that way but I'm sure I read that you could somewhere.

    Thanks in advance for any help

    Friendship is like peeing yourself. Everyone can see it, but only you get that warm feeling it gives.

  2. #2
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: SettlementBuildingsExists issues

    Hrm, never used another logic token besides = or == with SettlementBuildingExists.
    Have you tryed to use "not SettlementBuildingExists == shrine_nirentosh" instead of the != logic token?
    Like:
    Code:
    monitor_event SettlementTurnEnd SettlementName Midgar
    and not SettlementBuildingExists == shrine_nirentosh
    set_counter shrine_niren 0
    end_monitor
    Edit: ah and since it's testing for the level of the building
    Quote Originally Posted by Docudemons 4.0
    Code:
    Identifier:	SettlementBuildingExists
    Trigger requirements:	settlement
    Parameters:	building description, logic token, test level
    Sample use:	SettlementBuildingExists = governors_house
    Description:	Test to see if the settlement has a building at a particular level
    Battle or Strat:	Strat
    Class:	SETTLEMENT_BUILDING_LEVEL_EXISTS_TEST
    Most probably > < and = might work ... never tested anything besides = and == though
    Last edited by Aikanár; February 13, 2012 at 03:44 PM.


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

  3. #3
    Linyoa's Avatar Civis
    Join Date
    Apr 2008
    Location
    Switzerland
    Posts
    103

    Default Re: SettlementBuildingsExists issues

    I'll try "not settlementbuilding... " though I recall that I read that that would not work.
    Gee it would probably be pretty helpful if I could find where I read this stuff
    Thanks for the help

    Edit:
    Well it worked! I probably should have thought to try that on my own
    Thanks for the help!
    +rep
    Last edited by Linyoa; February 12, 2012 at 07:16 PM.

    Friendship is like peeing yourself. Everyone can see it, but only you get that warm feeling it gives.

  4. #4
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: SettlementBuildingsExists issues

    Quote Originally Posted by Linyoa View Post
    I'll try "not settlementbuilding... " though I recall that I read that that would not work.
    I said it recently somewhere so it might have been me. I don't know if it was for SettlementBuildingExists specifically but I was under the impression that "not" can not be used with conditions that take logical operators (< > etc.).

    I was told this on good authority and have adhered to the rule ever since. But now that I look at some code I can see things like "and not Trait Saruman > 0" being used all over the place and presumably working fine.

    Now I'm unsure about this rule. I'll find that recent post of mine and change it.

  5. #5
    Aikanár's Avatar no vaseline
    Join Date
    Mar 2009
    Location
    Sanctuary
    Posts
    12,516
    Blog Entries
    3

    Default Re: SettlementBuildingsExists issues

    You're very welcome, I'm glad it works for you


    Son of Louis Lux, brother of MaxMazi, father of Squeaks, Makrell, Kaiser Leonidas, Iskar, Neadal, Sheridan, Bercor and HigoChumbo, house of Siblesz

    Not everything that counts can be counted, and not everything that can be counted counts.

Posting Permissions

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