Almost 2 years since my last post on this. I got back to work relearning modding for CK2.
I post this to help describe and review how to code a decision and message, with the ability to enter different actions. I named different parts after animals to see how each code relates to its functions in the game. I did think quick (still took hours) and is still more a a reference to myself. I hope to continue to place other bits of code and show what they do.
This will show how to create a decision, with a pop up message, and the associated tool tips.
Seems a simple message, but took some effort.
I used Notepad++ for the text files and Open Office for the csv file of the localisation.
The mod requires the decisions, events, interface, and localisation folders.
I named parts of the code to different animals to see what they reference.
Within the text file for decisions I placed the following:
Code:
############Decisions############
decisions = {
############Test Message############
Test_Msg = {
potential = {
age = 16
}
allow = {
war = no
custom_tooltip = {
text = TMC2_TOOLTIP_FOX
}
}
effect = {
character_event = {
id = testmsg.0000
}
custom_tooltip = {
text = TMC2_TOOLTIP_CAT
}
wealth = 50
}
ai_will_do = {
factor = 0.0
}
}
}
######################################
In the
decisions folder, you can type stuff to make a decision appear in the intrigue menu of the game. In this case, Test_Msg. If you do not meet the requirements, the option will not show and you won't see it, no option for activation.
-The
potential portion codes what is required for it to appear in the intrigue menu for you the player. In this case, you just have to be at least 16 years old. But this can be edited for all
sort of requirements.
-The
allow portion codes what is required to actually click and activate the option. Again, this can be edited for all
sorts of requirements, for example must have 100 gold. If you don't have the requirements, the option will show, but will be greyed out, not available for activation.
-The
effect portion codes what will happen if you activate the option in the intrigue menu when you have the requirements. In this case it activates id testmsg.0000 and makes that code happen. It also gives 50 gold through wealth. The custom_tooltip references what the tooltip will say if you hover your cursor over the option.
-The
ai_will_do portion of the code determines if the ai will ever do the action. I put 0.0 so that is will never do the option.
Within the text file for events I placed the following:
Code:
namespace = TMC2
#Test Messsage
character_event = {
id = testmsg.0000
title = TMC2NAME0000
desc = TMC2DESC0000
picture = GFX_evt_battle
mean_time_to_happen = {
days = 1
}
option = {
name = TMC2OPTA0
prestige = 100
custom_tooltip = {
text = TMC2_TOOLTIP_FROG
}
}
}
Within the text file for interface I placed the following:
Code:
spriteTypes = {
spriteType = {
name = "GFX_Test_Msg"
texturefile = "gfx\\interface\\decision_icon_aquire_ingredients.dds"
}
}
Interface deals with images and what you can see in game (in short). GFX_Test_Msg references Test_Msg that is coded in the decisions file. By placing the GFX designation and referencing the .dds image, this makes the little image appear beside the decision Test Message Turtle, the plant image.
Within the csv file for localisation I placed the following:
Code:
TMC2NAME0000;Test Message Tiger;x
TMC2OPTA0;Test Message Lion;x
TMC2DESC0000;Test Message Zebra;x
Test_Msg;Test Message Turtle;x
Test_Msg_desc;Test Message Monkey;x
TMC2_TOOLTIP_FOX;Test Message Fox!;x
TMC2_TOOLTIP_CAT;Test Message Cat;x
TMC2_TOOLTIP_FROG; Test Message Frog;x
Maybe I'll type more explaination later.