Results 1 to 19 of 19

Thread: FatherAnc Issue

  1. #1
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,710

    Default FatherAnc Issue

    Good evening fellow modders,

    I came across an issue with the FatherAnc condition.
    Code:
    ;------------------------------------------
    Trigger Dads_ProudLegacy_Crown_France
     WhenToTest CharacterComesOfAge
     
     Condition FatherAnc roi_crown ; <- line 12360 
     
     Affects FathersLegacy 1 Chance 100
    Code:
    21:50:58.904 [game.script] [error] Condition parsing error in mods/Italian_Wars/data/export_descr_character_traits.txt, at line 12360, column 22
    Ancillary is not declared or invalid
    But my log says no...
    I do have everything correct in my eda file, though.
    It is seems that it is rather a problem with the condition monitor than with the anc itself.
    Since the problem occurs even if I use a vanilla anc.

    Any suggestions?

    Best regards,
    Aneirin
    Proud son of Aikanár and brother of Iskar

  2. #2
    Ngugi's Avatar TATW & Albion Local Mod
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    10,693

    Default Re: FatherAnc Issue

    Not having skill in this area, isn't there supposed to be a "AcquireAncillary"-line there too?

    Kingdom of Lindon preview video out





    DCI: Last Alliance
    - WIP Second Age mod | DCI: Tôl Acharn - mighty Dúnedain Counter Invasions |
    Additional Mercenary Minimod - more mercs; for TATW and DCI | Family Tree minimods - lore improvements | Remade Event Pictures - enhance cultures trough images |
    Favorite TATW compilation: Withwnars Submod Collection
    Patron of Mank, Kiliç Alì, FireFreak111, MIKEGOLF & Arachir Galudirithon, Earl of Memory

  3. #3
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,710

    Default Re: FatherAnc Issue

    Acquire is for Ancs

    Affects for traits.
    Proud son of Aikanár and brother of Iskar

  4. #4
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,458
    Blog Entries
    24

    Default Re: FatherAnc Issue

    You can give traits and ancillaries in the EDA. Not sure if it is possible the other way round as well, but I don't think so.

    Edit: something is not kosher, this monitor crashes the game on loading (using Bare Geomod), I gave king william that ancillary:

    Code:
    monitor_event CharacterTurnStart FactionType england
        and FatherAnc accomplice
        historic_event FIRST_WINDMILL
    end_monitor

    This way it crashes when clicking turn end:

    Code:
    monitor_event CharacterTurnEnd FatherAnc accomplice
        add_money england 1000
    end_monitor
    FatherTrait works without a hitch


    Edit2: the condition tests for the type, not the individual ancillary - something else to add to collection:

    Code:
    Ancillary accomplice
        Type Security
    
    ; --- Crash ---
    monitor_event CharacterTurnEnd FatherAnc accomplice
        historic_event FIRST_WINDMILL
    end_monitor
    
    ; --- Works ---
    monitor_event CharacterTurnEnd FatherAnc security
        historic_event FIRST_WINDMILL
    end_monitor
    Drat, withwhar was right - using a non-existing type fires true as well.

    Code:
    monitor_event CharacterTurnEnd FatherAnc doesnotexist
        historic_event FIRST_WINDMILL
    end_monitor
    Last edited by Gigantus; February 21, 2017 at 12:26 AM.



  5. #5
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,710

    Default Re: FatherAnc Issue

    Ah I see. It needs an anctype rather the and itself.
    Thanks!
    Proud son of Aikanár and brother of Iskar

  6. #6
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,458
    Blog Entries
    24

    Default Re: FatherAnc Issue

    Sorry if I was misleading, it was a false positive, see here:
    Drat, withwhar was right - using a non-existing type fires true as well.
    In other words: as long as you do not use an existing ancillary name that monitor will always fire. See my last piece of code - that triggered the event message.



  7. #7
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,710

    Default Re: FatherAnc Issue

    So the trigger fires either way?
    Proud son of Aikanár and brother of Iskar

  8. #8
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,458
    Blog Entries
    24

    Default Re: FatherAnc Issue

    Yup, we actually had it in our 'script stuff that does not work' thread for a while, completely forgot about it.



  9. #9
    Aneirin's Avatar of flowing verse
    Join Date
    Nov 2012
    Location
    Gododdin
    Posts
    2,710

    Default Re: FatherAnc Issue

    Good to know
    Well, then I'll have to find another way.

    Thank's!

    Edit:

    That's my new code
    Code:
    ;------------------------------------------
    Trigger Dads_ProudLegacy_Factionleader
     WhenToTest CharacterComesOfAge
     
     Condition FatherTrait Factionleader  >= 1
     
     Affects FathersLegacy 1 Chance 100
    Last edited by Aneirin; February 21, 2017 at 05:05 AM.
    Proud son of Aikanár and brother of Iskar

  10. #10
    Gigantus's Avatar The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it
    Patrician Moderator Emeritus Administrator Emeritus Modding Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    47,458
    Blog Entries
    24

    Default Re: FatherAnc Issue




  11. #11

    Default Re: FatherAnc Issue

    Now I know FatherAnc tests the ancillary type, not its own name. But I'm still a bit confused. If the anc type does exist in EDA but not owned by the character, will it fire?

    I mean, for example we have only defined the anc type "type_1", "type_2" in EDA, while "type_3" doesn't exist, i.e. is not defined.

    Then, the character's father only owns the anc type "type_1", so
    - FatherAnc type_1 : return true
    - FatherAnc type_2 : return ??
    - FatherAnc type_3 : return true

    If "FatherAnc type_2" does return false, we can still say FatherAnc works fine as long as we're careful enough not to put non-existing (I say undefined) anc type there, right?

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

    Default Re: FatherAnc Issue

    FatherAnc type_2 : return false - it is defined but the father does not have it
    FatherAnc type_3 : not sure ... log error?

    Referencing things that have not been defined is surely asking for trouble.

  13. #13

    Default Re: FatherAnc Issue

    For the case of type_3 I'm referring to this:
    Quote Originally Posted by Gigantus View Post
    Sorry if I was misleading, it was a false positive, see here:
    "Drat, withwhar was right - using a non-existing type fires true as well."
    In other words: as long as you do not use an existing ancillary name that monitor will always fire. See my last piece of code - that triggered the event message.
    I hope I didn't misunderstand Gigantus' words.

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

    Default Re: FatherAnc Issue

    Ah. I should have read the thread before posting.

    By what gsthoed is saying in that link - and Gigantus here as well? - it returns true always: when the father has an anc of a defined type, does not have an anc of a defined type, or the condition is a type which is not defined. My own post in that link suggests that it always returns false but it looks like I was using name not type in those tests.

    i.e. The problem is that it returns true whether his father has the anc or not. Therefore useless. And even worse: it will CTD if used with an undefined type (in campaign script at least, judging by Gig's examples).

  15. #15

    Default Re: FatherAnc Issue

    The "accomplice" Gigantus used and caused CTD is anc name, so it turned to be confusing again if your test using name always returns false. Maybe the situation in CS is different from EDA?

    By the way I just took a look at vanilla EDA and found these:
    Code:
    ;------------------------------------------
    Ancillary shard_of_the_true_cross
        Type Relic
        Transferable  1 
        Image relic_christianreliquary.tga
        ExcludeCultures middle_eastern
        Description shard_of_the_true_cross_desc
        EffectsDescription shard_of_the_true_cross_effects_desc
        Effect Piety  2 
        Effect Command  1 
    
    (...)
    
    ;------------------------------------------
    Trigger shard_of_the_true_cross_father_anc_trigger
        WhenToTest FatherDiesNatural
        Condition Attribute Piety > 2
              and FatherAnc shard_of_the_true_cross
              and not HasAncType Relic
    
    
        AcquireAncillary shard_of_the_true_cross chance  60
    The parameter it uses is ancillary name, or we can say an undefined anc type. I believe this trigger doesn't cause CTD since vanilla game is still playable. So it always returns false?



    But anyway, now I know I must turn to FatherTrait instead. Thank you.

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

    Default Re: FatherAnc Issue

    Yes, it seems that script usage causes CTD but EDA doesn't. Though I also tried script in that other thread and that didn't CTD. Something strange there.

    And yes, I believe that those vanilla ones must be broken too, as they always return false from what we've found in these threads.

    EDIT: fortunately FatherTrait does work. You can use HasAncType on the father to give him a trait when he has a certain anc (type) and then use FatherTrait on the son to test for that trait on the father. If the anc is transferable then another trait trigger is required to remove the trait on the father when it sees that he no longer has the anc. So it's more involved than FatherAnc but not too bad and at least it works.
    Last edited by Withwnar; December 03, 2019 at 06:19 AM.

  17. #17

    Default Re: FatherAnc Issue

    My another question may be, does HasAncType work in EDCT?

    Some says it can't work, while the others say it can. For example Squid's ATVTW tells me I shouldn't use it in EDCT, while this issue is not listed here at all.

    What's your experience with that?

    To avoid any possible bugs I've been giving ancillaries unused attribute, for example Subterfuge for generals, and testing it with Attribute Subterfuge = 1 or so on in EDCT. But if HasAncType really works in EDCT then codes can be greatly simplified indeed.

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

    Default Re: FatherAnc Issue

    does HasAncType work in EDCT?
    Most definitely. I use it a lot there.

    FactionwideAncillaryExists does not work in EDCT. Maybe the validator tool got them confused.

  19. #19

    Default Re: FatherAnc Issue

    Great! Thank you again, man.

Posting Permissions

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