Results 1 to 10 of 10

Thread: Monitoring Win Conditions

Hybrid View

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

    Default Monitoring Win Conditions

    Is it possible to monitor via a script the Faction Win Conditions is what I would like to know?

    I have an idea for a script and need to interupt the win/loose conditions either achieved or not pop up. I have looked through the Docudemons (thanks GrnEyed ), but can't find any conditions that fit. Which probably means there arn't any However, I am a noob at this and I might have overlooked something.

    Any help would be great

    Andrew

  2. #2
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Monitoring Win Conditions

    What do you mean by monitor the faction win conditions? What is it you're trying to do? I need an idea so I know if what I was going to suggest is worth elaborating on.

  3. #3

    Default Re: Monitoring Win Conditions

    I think it would depend on the type of win condition you wish to monitor and what it is you want to do with it. If the win condition is something like Outlive Faction B then checking for the death of that faction is easy, same with holding a specific number of regions.

    Are you trying to change the Win Conditions midway throughout the campaign? or just wish to know how far along a faction is to achieving thier win conditions (at a specified point in the campaign)?
    ...longbows, in skilled hands, could reach further than trebuchets...

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

    Default Re: Monitoring Win Conditions

    I don't realy understand what you want to do either, but if you want to trigger winning or losing the game by script instead of descr_win_conditions.txt you should define win_conditions that cannot be achieved, like take_regions 200, and have the script check for your own conditions that finaly result in a pop up window that says "you have won the game".

    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

  5. #5

    Default Re: Monitoring Win Conditions

    Ok sorry my post was vague. Your all asking the same basic question, so if you don't mind I will try and be more specific in one go.

    Right, what I want to do is add permanent forts to the map in strategic locations and have a number of forts that need to be captured (I don't yet know how many), as part of the win/victory conditions.

    I don't think this is possible to do via the win_conditions.txt file directly, so it would have to be a script. Of course there is then a possibility that the standard win conditions trigger before the fort count is reached, so I need to delay the trigger until both of the conditions are met.

    I know that the forts are not goverened in the same way as settlements in game so at first I didn't think it was possible. Then I found this in docudeamons:

    Identifier:
    IsFortGarrisoned
    Trigger requirements:
    fort
    Parameters:

    Sample use:
    IsFortGarrisoned
    Description:
    Are there any troops in the fort?
    Battle or Strat:
    Strat
    Class:
    IS_FORT_GARRISONED


    I am now thinking that if its not possible to count forts and the faction owner directly, that it might be possible to count the garrison. This would then also give you the faction to whom the fort belongs.

    Obviously there are other considerations such as pathfinding on the map and how the AI will react. So before I spend hours and weeks knocking my brains out what do you guys think? Am I barking mad (I probably am he he), or would this be likey to work?

    Like I said, I haven't gone to far with this yet, but I hope this helps clarify my poor first post on it.

    Cheers

    Andrew

  6. #6
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Monitoring Win Conditions

    Okay that's what I thought you meant. You can't effect victory conditions via script. What you can do is make the victory conditions technically impossible. Require the player to capture an inaccessible region in order to win, and use scripts to mirror the actual win conditions with counters, then when they meet the conditions, spawn an army there for them to take the settlement, or use give_everything_to_faction to gift it to the player.

  7. #7

    Default Re: Monitoring Win Conditions

    Yeah I guessed you couldn't adjust win conditions SignifireOne.

    Quote Originally Posted by Augustus Lucifer View Post
    Okay that's what I thought you meant. You can't effect victory conditions via script. What you can do is make the victory conditions technically impossible. Require the player to capture an inaccessible region in order to win, and use scripts to mirror the actual win conditions with counters, then when they meet the conditions, spawn an army there for them to take the settlement, or use give_everything_to_faction to gift it to the player.
    Ok so this looks like a useful way of doing it (Konnys' suggestion too thanks Konny!), AL will give it a try.

    Thanks for your help guys

    Andrew

  8. #8
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Monitoring Win Conditions

    Nope, it's not possible to scriptedly affect victory conditions.


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

  9. #9

    Default Re: Monitoring Win Conditions

    Might as well write here since the title is ok for my dilemma. Unlike max274, I am not looking for extra scripted win conditions though. I dislike 'winning' or 'loosing' in m2, always found that the concept just don't fit a strategy game of this kind.
    All I need is freezing victory or defeat for every factions, player and ai controlled. But I also need to have some that say: 'hold this and that regions', because it really seem that the ai is using them to direct itself sometimes, in my ai tests at least.
    I have already done that, it is the freezing part that leave me a doubt. This is a quote from one of the 'crashes and how to fix threads':
    Player and Slave crash

    Q: The mod crashes after 4-6 turns when the only remaining factions are the player and slave. The slave factions does not have viable victory conditions.

    A: The mod will crash if there is only one factions left with viable victory conditions but they have not achieved victory. Giving the slave factions viable victory conditions will remove this error (controlling every province is NOT a viable victory condition, nor is controlling more provinces then there are in the mod).
    I never experienced this but my actual playing time has been rather short since I have the game. I don't want to use the holding too many regions trick, the ai might get confused if it is really 'reading' victory conditions. I want to use hold_regions X Y, for y turns, with y lasting longer than the campaign.
    So far so good, but will that really work without problems during a entire campaign? Any thoughts, or ideas on how to turn off victory and defeat otherwise?

    The warning above seem quite old, I would want to believe it is a mistake or the like...

  10. #10

    Default Re: Monitoring Win Conditions

    Well I tested it after all since I hate potential long term causes of crashes. (Doesn't everyone?)
    Verdict, the quoted warning above is either a mistake or it doesn't apply to entries such as this:

    hold_regions London_Province 2000
    take_regions 1
    short_campaign hold_regions
    take_regions 1
    outlive france

    I took out every factions from the vanilla descr_strat, except for only england, france and slave, gave them each victory conditions like this and quickly killed france by script. Then I quickly passed more than 50 turns with a few fast actions here and there, and nothing bad happened. Victory and defeat were frozen without any problem. One less headeache to worry about.

Posting Permissions

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