Results 1 to 7 of 7

Thread: Can't make M2TW: Kingdoms engine recognize GuidUpgraded event (or Guild built or anything similar)!

Hybrid View

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

    Default Can't make M2TW: Kingdoms engine recognize GuidUpgraded event (or Guild built or anything similar)!

    SHORT VERSION: Seems triggers with SettlementBuildingFinished >= (any guild buildings)DO NOT execute (meaning game works but no effect) BUT they DO execute if there is some other type of building after >= part of the condition. GuidUpgraded event also ISN'T recognize by either export_descr_ancillaries.txt or export_descr_character_traits.txt OR even by campaign_script.txt (of course it makes sense if one doesn't recognize it, neither will the rest but this causes problems and headaches!)

    I have very strange problem. I am trying to mod DLV 6.1. There is a big problem with Hanseatic guild buildings and all scripts concerning them. It looks like someone actually wrote about 610+ triggers in export_descr_ancillaries.txt file (yes OVER 600 I guess they had some Python or similar script) just to add H_Founder_Of_Hanse trait and even with those 600 it seems player can get H_Founder_Of_Hanse trait regardless if can build Hanseatic league buildings or not (England can't even build them so player who built 0 Hanseatic league buildings can still get the trait if I read it right)

    They all look like this:

    Trigger H_HanseEngland01
    WhenToTest CharacterTurnEnd

    Condition IsFactionLeader
    and not Trait H_Founder_Of_Hanse > 0
    and not Trait H_Descendant_Of_Hanse = 1
    and not I_WorldwideAncillaryExists H_Comes_Hansae
    and I_SettlementOwner London = england
    and I_SettlementOwner Antwerp = england
    and I_SettlementOwner Hamburg = england
    and I_SettlementOwner Stettin = england
    and CharFactionType england

    Affects H_Founder_Of_Hanse 1 Chance 100

    Now I wanted to compress these 610 + traits to save processing cycles (DLV seems to like wasting them a LOT) as one single trait that will actually fire only when you build gm_hanseatic_guild building. Now DLV had only ONE LEVEL for Hanseatic guild buildings but I did menage to make it so there are 3. I tested it and all 3 levels can be built (even without reloading campaign).
    After that I tried to make that single trait to give your faction leader trait H_Founder_Of_Hanse (threshold is just 1).
    While I could do it in a lot of ways (if m_hanseatic_guild or latger is present or if someone builds building OTHER then a guild with either modifying export_descr_ancillaries.txt or export_descr_character_traits.txt) but I can not at all get it to fire when any building is built. Well I didn't stop there , and tried to use already existing triggers but then I found that any type of trigger that relies on SettlementBuildingFinished WILL NOT EXECUTE (game works but there is no trigger effect) .

    For example I tried changing Trigger master_smith_vnv_trigger
    WhenToTest GovernorBuildingCompleted
    Condition SettlementBuildingFinished >= swordsmiths_guild

    AcquireAncillary master_smith chance 100

    ;I just changed the chance

    (and basically ANY similar trigger for any guild, of course before it I changed points awarded each turn for target guild in export_descr_guilds.txt). ALL of these (with different guilds) refused to execute at all. There was never any change no matter what that chance was always 100 and no matter what were the things it affected. As longs as it contained SettlementBuildingFinished >= and after >= there was ANY type of guild building it NEVER worked.
    AM I blind and doing something seriously wrong or did DLV makers enter something wrong ; triggers look the same to me as those used in Teutonic or SS (then again I could be blind), or is there some problem with M2TW: Kingdoms code that makes it not execute triggers with SettlementBuildingFinished >= (GUILD BUILDING)? BUT IT DOES execute it if there is some other type of building

    Can this type of trigger be written so it will actually execute or do I have to add monitor_event BuildingCompleted to the campaign_script.txt (and will changing of campaign_script.txt require campaign restart to function properly?)

    Sorry for rather long post and thanks in advance .

  2. #2

    Icon1 Re: SettlementBuildingFinished (of type guild) REFUSES to excecute

    Guilds are not constructed. So events or conditions which use building ‘completed’
    or ‘finished’ will probably not work.

    Try this. It may work.

    Trigger master_smith_vnv_trigger
    WhenToTest GuildUpgraded
    Condition GovernorBuildingExists >= swordsmiths_guild

    AcquireAncillary master_smith chance 100

    Or this:

    Trigger master_smith_vnv_trigger
    WhenToTest GuildUpgraded
    Condition SettlementBuildingExists >= swordsmiths_guild

    AcquireAncillary master_smith chance 100

  3. #3

    Default Re: SettlementBuildingFinished (of type guild) REFUSES to excecute

    Quote Originally Posted by TNZ View Post
    Guilds are not constructed. So events or conditions which use building ‘completed’
    or ‘finished’ will probably not work.

    Try this. It may work.

    Trigger master_smith_vnv_trigger
    WhenToTest GuildUpgraded
    Condition GovernorBuildingExists >= swordsmiths_guild

    AcquireAncillary master_smith chance 100

    Or this:
    I tried that before as a condition inside export_descr_ancillaries.txt and event clause in campaign_script.txt but it didn't seem to execute either. I now tried again just to be sure.
    Thank you but it seems that of M2TW: Kingdoms script language wont acknowledge GuildUpgraded as either clause for WhenToTest or for a valid condition inside export_descr_ancillaries.txt file. And on top of that it wont acknowledge it inside campaign_script.txt so I can't even write a proper counter. It simply just passes through it (I guess it wont parse since it wont be recognized properly, since it exists as separate event inside parts of script language used for M2TW and C ++ or whatever used to actually program engine) . What is even more hilarious is that even s from CA didn't notice that their own clauses don't seem to execute (or they did and simply they do not care).

    +Rep (as useless as that is anyway since only you bothered to try to help).

  4. #4

    Icon1 Re: SettlementBuildingFinished (of type guild) REFUSES to excecute

    Maybe this will work:

    monitor_event GuildUpgraded BuildingName = swordsmiths_guild

    Or:

    Trigger master_smith_vnv_trigger
    WhenToTest GuildUpgraded
    Condition BuildingName = swordsmiths_guild

  5. #5

    Default Re: SettlementBuildingFinished (of type guild) REFUSES to excecute

    Quote Originally Posted by TNZ View Post
    Maybe this will work:

    monitor_event GuildUpgraded BuildingName = swordsmiths_guild

    Or:

    Trigger master_smith_vnv_trigger
    WhenToTest GuildUpgraded
    Condition BuildingName = swordsmiths_guild
    Tried it before. Event GuildUpgraded will not parse (script will just pass through it as if it was not there). But thanks again .

  6. #6

    Icon1 Re: Can't make M2TW: Kingdoms engine recognize GuidUpgraded event (or Guild built or anything similar)!

    Grimblade, this one I tested and it works. The faction leader acquired the ancillary master smith, but the next two faction leaders did not.

    Spoiler Alert, click show to read: 
    campaign_script:

    monitor_event FactionTurnEnd FactionBuildingExists = swordsmiths_guild
    set_event_counter founded_swordsmiths_guild 1
    terminate_monitor
    end_monitor

    monitor_event CharacterTurnEnd HasAncType Mssg
    set_event_counter founded_swordsmiths_guild 2
    terminate_monitor
    end_monitor

    export_descr_ancillaries:

    Ancillary master_smith
    Type Mssg
    Transferable 0
    Image ZMasterSmith.tga
    ExcludedAncillaries master_of_horse, master_mason
    Description master_smith_desc
    EffectsDescription master_smith_effects_desc
    Effect TrainingUnits 2

    Trigger master_smith_vnv_trigger
    WhenToTest CharacterTurnStart
    Condition IsFactionLeader
    and FactionBuildingExists >= swordsmiths_guild
    and I_EventCounter founded_swordsmiths_guild = 1

    AcquireAncillary master_smith chance 100

Posting Permissions

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