Now that we have done an incident, let us add a dilemma. Build upon the mod file you created in the first post.
11. Dilemma file (g) is similar to incident file (b) in step 4. Delete all the other lines and add one line with the internal ID of your dilemma, "tut_dilemma". None of the long string fields matter; the game fetches these from file (i) anyway. Make sure the first field is "True"; I believe this is required to enable the dilemma.
12. Dilemma file (h) is similar to incident file (c) in step 5. The main difference is that each line has a field to indicate whether it applies to the FIRST or SECOND choices in the dilemma. Delete all the lines and add these two lines:
Code:
FIRST | tut_dilemma | 3001 | 0 | p_foreign_prosperity | True | DURATION[6]
SECOND | tut_dilemma | 3002 | 0 | p_thriving_markets | True | DURATION[6]
If your PFM does not show a boolean field, that is fine; you can ignore it.
13. Dilemma file (i) is similar to incident file (d) in step 6. Later, you can trace out any base game dilemmas and their conditions. Delete all the lines and enter the new lines:
Code:
tut_dilemma | 5001 | 0 | VAR_CHANCE | 100
tut_dilemma | 5002 | 0 | GEN_TARGET_NONE
tut_dilemma | 5003 | 0 | CND_UNIQUE
14. Dilemma file (j) is similar to incident file (e) in step 7. *DO NOT* delete the lines in this file. Add six lines at the bottom:
Code:
dilemmas_localised_title_tut_dilemma | My Dilemma | True
dilemmas_localised_description_tut_dilemma | My top text. | True
dilemmas_localised_first_choice_title_tut_dilemma | First Button | True
dilemmas_localised_first_choice_label_tut_dilemma | First Text. | True
dilemmas_localised_second_choice_title_tut_dilemma | Second Button | True
dilemmas_localised_second_choice_label_tut_dilemma | Second Text. | True
15. Similar to steps 8-10. Update the string in table (f) with a newer string, like "Look! My dilemma mod loaded!". Double check your work. Save the pack file. Copy the pack file into the game data directory. Play a game! The dilemma should show up within the first 10 turns.
16. A dilemma can have "chained" or "child" incidents, depending on which choice you picked. This shows the consequences of your decision later in the game. We will add two more incidents and link them to this dilemma. The key table which captures this information is (k). Delete the contents, then add the lines:
Code:
FIRST | tut_dilemma | tut_dil_foll_1
SECOND | tut_dilemma | tut_dil_foll_2
17. Add the details to files you have previously modified. In file (b), add the lines:
Code:
False | tut_dil_foll_1 | ... | ... | False
False | tut_dil_foll_2 | ... | ... | False
The first and last fields must be false. These are related to enabling the incidents. If you put "True", then the chained incident can appear even if you did not make the corresponding dilemma choice. Where I have written "..." you can leave any valid icon name there, from a line which you may clone. In file (c), add the lines:
Code:
7002 | 0 | tut_dil_foll_1 | p_able_sailors | DURATION[6]
7003 | 0 | tut_dil_foll_2 | p_able_sailors | DURATION[8]
For the purposes of this tutorial, I have kept the same effect bundle but different duration. The only way you will notice the difference is by the duration. In file (d), add the lines:
Code:
6004 | 0 | tut_dil_foll_1 | VAR_CHANCE | 100
6005 | 0 | tut_dil_foll_1 | GEN_TARGET_NONE | 100
6006 | 0 | tut_dil_foll_1 | CND_UNIQUE
6007 | 0 | tut_dil_foll_2 | VAR_CHANCE | 100
6008 | 0 | tut_dil_foll_2 | GEN_TARGET_NONE | 100
6009 | 0 | tut_dil_foll_2 | CND_UNIQUE
In file (e), add the lines:
Code:
incidents_localised_title_tut_dil_foll_1 | My First Followup | True
incidents_localised_description_tut_dil_foll_1 | My incident text. | True
incidents_localised_title_tut_dil_foll_2 | My Second Followup | True
incidents_localised_description_tut_dil_foll_2 | My incident text. | True
In file (i), add the line:
Code:
tut_dilemma | 5004 | 0 | VAR_FOLLOWUP_CHANCE | 100
18. Update the string in table (f) with a newer string, like "Look! My chain mod loaded!". Double check your work; files (b,c,d,e,i,k) are all modified with the chain information. Save the pack file. Copy the pack file into the game data directory. Play a game! Remember which button you chose during the dilemma; play a few more turns; the corresponding incident should show up.