Results 1 to 7 of 7

Thread: how to add dilemmas?

  1. #1

    Default how to add dilemmas?

    This mod is one of the few (only?) I have seen which adds dilemmas. I have tried to trace in the various pack files to see how this works, but I haven't been able to figure it out. Using PFM 1.6.5, I can see that you have added files like db/dilemmas_tables/tron_dilemmas, but PFM doesn't know the format of these files. Could you please give a few lines of inspiration about how other modders can add dilemmas?

  2. #2

    Default Re: how to add dilemmas?

    You need Taws converter to access these files. Other then getting that one to run creating new dilemmas is straightforward. You can't have custom made effect bundles though.

  3. #3

    Default Re: how to add dilemmas?

    If you could help me a little more, that would be great. I have now used the binary editor and taws data to enhance pfm, so that it can read these files:
    cdir_events_dilemma_option_junction
    cdir_events_dillema_payloads
    cdir_events_dilemma_incidents
    dilemmas_table

    But, I have several questions in order to add new dilemmas.

    1. I don't understand how file cdir_events_dilemma_incidents fits in. It defines a number of new strings for the dilemma. For example, the dilemma d_ambitious_traders has four strings defined in this table:

    c_ambitious_traders_FIRST_able_sailors
    c_ambitious_traders_FIRST_lucrative_shipping
    c_ambitious_traders_SECOND_prosperity
    c_ambitious_traders_SECOND_thriving_markets

    These four strings don't seem to be used anywhere else I can find. Can you help me to understand if I should add these for new dilemmas?

    2. It seems that file cdir_events_dilemma_option_junctions is needed to control how dilemmas are triggered. I can vaguely understand part of this. But if there is a reference with more details, that would be helpful. I am particularly interested in triggering dilemmas directly at certain times, and there doesn't "appear" to be any way to do this. For example, we see the following lines for d_ambitious_traders:

    CND_CAMPAIGN True jap_shogun
    CND_MIN_TRADE True 1
    CND_MIN_TRADE_NODE_OCCUPIED True 1
    VAR_CHANCE True 5
    CND_FIRST_ROUND True 8
    CND_ROUNDS_UNTIL_NEXT True 48
    VAR_FOLLOWUP_CHANCE True 25
    GEN_TARGET_NONE False

    I suppose each line is a condition which must be satisfied. The first line checks to make sure that the shogun campaign is in effect. The third line checks that the player has at least one trade node occupied. The other lines "may" have something to do with how many turns must elapse between checks for this dilemma and what is the chance that it will occur at each check. But the details are not clear. Can you explain your understanding of these fields?

    In order to test a new dilemma, it seems it would be very important to set up a condition so that the dilemma is guaranteed to occur. How have you done testing for your dilemmas? For example, if I put a single line into the above table with my new dilemma, and give "VAR_CHANCE 100", does it guarantee that the dilemma will pop up in turn 1?

    3. The file cdir_events_dilemma_payloads appears to describe what payload ("effect bundle") is applied by the player's choice. For d_ambitious_traders, this is simple enough:

    FIRST p_foreign_prosperity True DURATION[6]
    SECOND p_thriving_markets True DURATION[6]

    The DURATION field must clearly set the number of turns duration. However, for some dilemmas, there is a mystery group "TARGET True EVENT". For example, these lines:

    FIRST d_ronin_spears TARGET True EVENT
    FIRST d_ronin_swords TARGET True EVENT
    SECOND d_conflict_beliefs_christian TARGET True EVENT
    SECOND d_conflict_beliefs_buddhist TARGET True EVENT

    What do these represent?

    Any advice you could give would be greatly appreciated.

  4. #4

    Default Re: how to add dilemmas?

    Quote Originally Posted by davidlallen View Post
    If you could help me a little more, that would be great. I have now used the binary editor and taws data to enhance pfm, so that it can read these files:
    cdir_events_dilemma_option_junction
    cdir_events_dillema_payloads
    cdir_events_dilemma_incidents
    dilemmas_table

    But, I have several questions in order to add new dilemmas.

    1. I don't understand how file cdir_events_dilemma_incidents fits in. It defines a number of new strings for the dilemma. For example, the dilemma d_ambitious_traders has four strings defined in this table:

    c_ambitious_traders_FIRST_able_sailors
    c_ambitious_traders_FIRST_lucrative_shipping
    c_ambitious_traders_SECOND_prosperity
    c_ambitious_traders_SECOND_thriving_markets

    These four strings don't seem to be used anywhere else I can find. Can you help me to understand if I should add these for new dilemmas?
    This file defines follow up events with no choices (incidents) that can happen either with the FIRST or the SECOND choice of a dilemma. You will find these again in the incidents tables. VAR_FOLLOWUP_CHANCE defines the chance of sucha follow up incident.

    Quote Originally Posted by davidlallen View Post
    2. It seems that file cdir_events_dilemma_option_junctions is needed to control how dilemmas are triggered. I can vaguely understand part of this. But if there is a reference with more details, that would be helpful. I am particularly interested in triggering dilemmas directly at certain times, and there doesn't "appear" to be any way to do this. For example, we see the following lines for d_ambitious_traders:

    CND_CAMPAIGN True jap_shogun
    CND_MIN_TRADE True 1
    CND_MIN_TRADE_NODE_OCCUPIED True 1
    VAR_CHANCE True 5
    CND_FIRST_ROUND True 8
    CND_ROUNDS_UNTIL_NEXT True 48
    VAR_FOLLOWUP_CHANCE True 25
    GEN_TARGET_NONE False

    I suppose each line is a condition which must be satisfied. The first line checks to make sure that the shogun campaign is in effect. The third line checks that the player has at least one trade node occupied. The other lines "may" have something to do with how many turns must elapse between checks for this dilemma and what is the chance that it will occur at each check. But the details are not clear. Can you explain your understanding of these fields?
    I don't understand all of them either. If you want to trigger a dilemma at a certain year try this:

    CND_CAMPAIGN True jap_shogun
    VAR_CHANCE True 100
    CND_FIRST_ROUND True 10
    CND_UNIQUE True

    Use CND_FIRST_ROUND to define the year by calculating it in number of turns. CND_UNIQUE will make shure the dilemma will not happen again, while CND_ROUNDS_UNTIL_NEXT make the dilemma repeatable. GEN_TARGET_NONE is for global dilemmas without a target: Targets can be certain provinces or generals/daimyos.

    Quote Originally Posted by davidlallen View Post
    In order to test a new dilemma, it seems it would be very important to set up a condition so that the dilemma is guaranteed to occur. How have you done testing for your dilemmas? For example, if I put a single line into the above table with my new dilemma, and give "VAR_CHANCE 100", does it guarantee that the dilemma will pop up in turn 1?
    I would think so.

    Quote Originally Posted by davidlallen View Post
    3. The file cdir_events_dilemma_payloads appears to describe what payload ("effect bundle") is applied by the player's choice. For d_ambitious_traders, this is simple enough:

    FIRST p_foreign_prosperity True DURATION[6]
    SECOND p_thriving_markets True DURATION[6]

    The DURATION field must clearly set the number of turns duration. However, for some dilemmas, there is a mystery group "TARGET True EVENT". For example, these lines:

    FIRST d_ronin_spears TARGET True EVENT
    FIRST d_ronin_swords TARGET True EVENT
    SECOND d_conflict_beliefs_christian TARGET True EVENT
    SECOND d_conflict_beliefs_buddhist TARGET True EVENT

    What do these represent?

    Any advice you could give would be greatly appreciated.
    A local event, for example a unit spawning in a province or a effect bundle that is restricted to a province. Global effects don't have this line.

    Btw you can define new effect bundles. I just missed one neccessary table.
    Last edited by Yarkis de Bodemloze; August 04, 2011 at 04:44 PM.

  5. #5

    Default Re: how to add dilemmas?

    That is great information, I think I can use this to get started. While we are here, I have two other questions I have been unable to get answered elsewhere.

    1. Is there any way to tell which effects can be used by which types of object? In the db table for effects we can see many interesting effects, such as "campaign_map_stealth" (enables army to lay ambush in any terrain). It isn't clear whether this can be added to an ancillary, or a building for example. For some other effects, the name has a prefix such as "clan_trait_shimazu_superior_katana_hero" and we could "assume" this can only be applied to a clan, not to a general, or building, or tech. I have tried adding some building effects to ancillaries, for example. The effect shows up in the ancillary info card, but it doesn't seem to have any actual effect.

    ==> Is there any way to see which effects will actually work when applied to a certain object?

    2. Is there a way to "autoplay" say, ten turns, where the computer will take over my position and play it with standard AI, then give me back control after that number of turns? In other games, this is a helpful way to test a mod.

  6. #6

    Default Re: how to add dilemmas?

    Quote Originally Posted by davidlallen View Post
    That is great information, I think I can use this to get started. While we are here, I have two other questions I have been unable to get answered elsewhere.

    1. Is there any way to tell which effects can be used by which types of object? In the db table for effects we can see many interesting effects, such as "campaign_map_stealth" (enables army to lay ambush in any terrain). It isn't clear whether this can be added to an ancillary, or a building for example. For some other effects, the name has a prefix such as "clan_trait_shimazu_superior_katana_hero" and we could "assume" this can only be applied to a clan, not to a general, or building, or tech. I have tried adding some building effects to ancillaries, for example. The effect shows up in the ancillary info card, but it doesn't seem to have any actual effect.

    ==> Is there any way to see which effects will actually work when applied to a certain object?

    2. Is there a way to "autoplay" say, ten turns, where the computer will take over my position and play it with standard AI, then give me back control after that number of turns? In other games, this is a helpful way to test a mod.
    1. Other then the effects files, no. I look how the effects are used in the game or test them out. Clan traits for example work with techs, since they are simply global effects. Some effects don't work at all.

    2. Not that I am aware of. The old TW games had this feature through the console or scripting, but since ETW I had to test everything manually.

  7. #7

    Default Re: how to add dilemmas?


Posting Permissions

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