Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: TargetFactionType FactionIsLocal = Error

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default TargetFactionType FactionIsLocal = Error

    Would someone know how I can work around this?

    Condtion: TargetFactionType FactionIsLocal will get me this error:

    Condition parsing error in mods/1648_Beta02/data/world/maps/campaign/imperial_campaign/campaign_script.txt, at line 2982, column 27
    faction type not recognised
    I would like to make a condition where the target faction should be the player.

    monitor_event GeneralDevastatesTile not FactionIsLocal
    ; and TargetFactionType FactionIsLocal
    and TargetRegionIsLocal ;instead?
    historic_event pluenderung

    end_monitor
    Last edited by Gigantus; November 01, 2009 at 01:04 AM.










  2. #2

    Icon1 Re: TargetFactionType FactionIsLocal = Error

    Try this:
    Code:
    	monitor_event GeneralDevastatesTile RegionIsLocal
    		historic_event pluenderung
    	end_monitor
    Or this:
    Code:
    	monitor_event GeneralDevastatesTile TargetRegionIsLocal
    		historic_event pluenderung
    	end_monitor

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: TargetFactionType FactionIsLocal = Error

    Thanks, I will give it a try.

    Edit: My correction works and so does your first one. Haven't tried the second one.
    Last edited by Gigantus; November 01, 2009 at 02:20 AM.










  4. #4
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: TargetFactionType FactionIsLocal = Error

    Your first try didn't work because TargetFactionType expects an actual faction not another condition. In fact I don't think you can link conditions at all the way you did. FactionIsLocal returns true/false and not a specific faction.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: TargetFactionType FactionIsLocal = Error

    I will keep testing, but up to now it works fine and the way I wanted:

    When a player tile gets devastated by a non player an event fires.










  6. #6
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,760
    Blog Entries
    3

    Default Re: TargetFactionType FactionIsLocal = Error

    I meant the initial code (and TargetFactionType FactionIsLocal) not your correction of it.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: TargetFactionType FactionIsLocal = Error

    Sorry for the misunderstanding. Still don't know why I didn't find the correct code in the docudemons.










  8. #8
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: TargetFactionType FactionIsLocal = Error

    At the risk of sounding stupid, is this of any use... TargetFactionIsLocal ?

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: TargetFactionType FactionIsLocal = Error

    It might work, not sure. Devastation is in a region. But then the ways of scripting are mysterious.










  10. #10
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: TargetFactionType FactionIsLocal = Error

    Sorry I wasn't paying enough attention, that was to fix the error in the OP; factionislocal is not used with a target faction.

    On closer inspection the exports suggest no target faction to be specified.

    Exports: nc_character_record, character_record, faction, region_id, character_type, settlement

    Which kinda suggests to me that 'faction' is the general's faction. It could be the region's faction... but that should be a target faction if the focus is the general and not the tile.

    Anyway, I now see you have fixed it, nice work

    BTW is it for a script to allow a player to earn money by devastating the AI's land? (seems a nice idea)
    Last edited by Taiji; November 02, 2009 at 07:18 AM.

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

    Default Re: TargetFactionType FactionIsLocal = Error

    Quote Originally Posted by Taiji View Post
    BTW is it for a script to allow a player to earn money by devastating the AI's land? (seems a nice idea)
    Yes. Use the event GeneralDevastatesTile

    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

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: TargetFactionType FactionIsLocal = Error

    You can use it for that purpose, I also wanted to use it to inform the player that there is an enemy army in his regions. Pity you can't a locate button for this kind of event, that would have been ideal.










  13. #13
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: TargetFactionType FactionIsLocal = Error

    I like the idea, Gigantus +rep (locate would have been a pretty cool addition, shame about that)

  14. #14
    The Border Reiver's Avatar Artifex
    Patrician

    Join Date
    Feb 2006
    Location
    Australia
    Posts
    3,703

    Default Re: TargetFactionType FactionIsLocal = Error

    This idea is good gigantus, especially when using a larger map. Tell me does the tile devestate when armies are hiding in sparse forests, or is it only when armies are in the open?

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: TargetFactionType FactionIsLocal = Error

    I am not sure about the hiding part, but I remember vaguely that that was a way of finding the buggers. Can't say for sure, it would need testing. But I am pretty sure the event would fire, even if the tile doesn't change on the stratmap.










  16. #16
    The Border Reiver's Avatar Artifex
    Patrician

    Join Date
    Feb 2006
    Location
    Australia
    Posts
    3,703

    Default Re: TargetFactionType FactionIsLocal = Error

    Gigantus, the more i think about this, it is actually a very interesting scripting command for factions at war, but I wonder could this be used for Transgression as well? Such as below

    monitor_event Transgression RegionIsLocal
    historic_event cattleraid
    end_monitor
    I can't remember it's so long since I played Kingdoms or MTW2, but do having allied or neutral armies in your regions deplete resources? I think from memory, in RTW I always had the freeloading Senate park their armies in my region and it was impossible to produce goods and income while they were there. The Trangsression event only fires every now and again and I would love to make this work each time.

    Further to this, could the above be replicated to produce a different message for each faction?

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: TargetFactionType FactionIsLocal = Error

    "Transgression" only exports faction, target_faction and resource_description (guess that is the type of transgression) - so the RegionIsLocal won't work in my opinion.
    What should work:
    FactionType
    TargetFactionType
    and the names of the various transgressions. Do a search in descr_faction_standing with "Condition TransgressionName =" and you will come up with a god handful. TC_THREATEN_WAR is one of them, and is also one of them where I don't know what situation that actually is.

    So it might work like this:

    monitor_event Transgression TC_THREATEN_WAR
    and TargetFactionType FactionIsLocal
    historic_event cattleraid
    end_monitor










  18. #18
    The Border Reiver's Avatar Artifex
    Patrician

    Join Date
    Feb 2006
    Location
    Australia
    Posts
    3,703

    Default Re: TargetFactionType FactionIsLocal = Error

    Actually, you're right about not being able to do Regionislocal for Transgression Gigantus, while you wrote the above I was away testing. I'll try the other later on tonight.

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,095
    Blog Entries
    35

    Default Re: TargetFactionType FactionIsLocal = Error

    These are the transgressions I found in the kingdoms EXE:

    === Transgression ===

    TC_ATTACKING_CRUSADING_GENERAL
    TC_DECLARED_WAR
    TC_BROKE_ALLIANCE
    TC_INVADED_FORT
    TC_STOLE_BACK_SETTLEMENT
    TC_INVADED_SETTLEMENT
    TC_INVADED_WATCHTOWER
    TC_INVASION
    TC_CRUSADE_INVASION
    TC_FLEE_INVASION
    TC_BROKE_TREATY_TERMS
    TC_THREATEN_WAR
    TC_MINOR_ASSASSINATION_ATTEMPT
    TC_MAJOR_ASSASSINATION_ATTEMPT
    TC_DIPLOMATIC_INSULT
    TC_SABOTAGE
    TC_SPYING
    TC_DISHONOUR
    TC_BRIBED_AWAY_CHARACTER
    TC_BRIBED_AWAY_ARMY
    TC_BRIBED_AWAY_FORT
    TC_BRIBED_AWAY_SETTLEMENT
    TC_INSTIGATE_SIEGE
    TC_BATTLE_ENGAGEMENT
    TC_NULLIFIED_ALLIANCE
    TC_INSTIGATE_ASSAULT
    TC_UNDECLARED_ATTACK
    TC_UNDECLARED_ATTACK_WITHDRAWN
    TC_BLOCKADE

    === Forgiveness ===
    FC_MILITARY_ASSISTANCE
    FC_OBVIOUS_BRIBE










  20. #20
    The Border Reiver's Avatar Artifex
    Patrician

    Join Date
    Feb 2006
    Location
    Australia
    Posts
    3,703

    Default Re: TargetFactionType FactionIsLocal = Error

    Well this actually does work with the corrected version you posted above. At least to say it works (so far) in a rudimentary way. By adding the "importance high" to the desc event images file under Trangression, you are alerted to every occurence, however you're not alerted to the location.

    This is the current setup i've tested to get the "magnifying glass" to click on for the location:

    Spoiler Alert, click show to read: 
    transgression
    icon diplomacy
    importance high
    heading_items 3
    format
    {
    title center verdana black
    string center verdana_med black
    image center diplomacy_worsenedrelations
    spacer 16
    bodystring left verdana_sml khaki left
    spacer 8
    condition ;; was anyone hurt
    {
    true
    {
    condition ;; If any settlements are affected
    {
    true
    {
    string left verdana_sml black characters_affected
    list 1 verdana_sml khaki
    }
    }
    condition ;; If any characters are affected
    {
    true
    {
    string left verdana_sml black buildings_affected
    list 1 verdana_sml khaki
    }
    }
    spacer 8
    group left 4
    {
    string left verdana_sml khaki your_citizens_killed
    integer left verdana_sml khaki
    }
    group left 4
    {
    string left verdana_sml khaki your_soldiers_killed
    integer left verdana_sml khaki
    }
    }
    false
    {
    multistring left verdana_sml khaki left nobody_harmed
    }
    }
    }


    Would there be a better way to write it? Have you tried to get this feature added before?

Page 1 of 2 12 LastLast

Posting Permissions

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