• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

TeMarChi

Private
32 Badges
May 10, 2015
23
0
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Stellaris: Synthetic Dawn
  • Stellaris: Galaxy Edition
  • BATTLETECH
  • Crusader Kings III
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • BATTLETECH - Digital Deluxe Edition
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
Botanic Society CKII Mod
TeMarChi
2 July 2017

Purpose:
This is the step by step journal on how I made a mod. It doesn't work, but it is closer to getting created. To discuss with and help others in what to do and generate more mod creations.

Background:
I didn’t include references because of forum rules. The Hanging Gardens of Babylon were around the BC era? After Rome’s fall, monks kept gardens for spiritual purposes, Hortus conclusus. In 1530 a picture book was publish about some plants. Possibly in 1545 orangeries began to appear. Herbariums didn’t appear until later, maybe in Bologna, Italy around 1570. In the 1700s, Carl Linnaeus worked on the binomial naming system. A major focus was on exotic plants and prestige.

For the Mod:
My goal, vision, is to have a society called The Botanical Society. An option is given to go on an expedition to collect floral samples. While gone a regent takes over the realm. Then after 2 months, a message will pop up saying you returned from your trip with a plant sample. You look in your artifacts and you will have a picture of a plant. When the cursor is placed over it, it will have a botanical name, genus, of a plant (example: Acer, as in maple; Artemisia, wormwood; etc.). Each plant will give a very small amount of prestige, but can add up with different plants, not duplicates of the same ones. I’m afraid to go any more complex. The mod would be for those wishing to explore different regions and just may learn a plant or two while collecting. The fun will be for collectors and the excitement of obtaining different plants from different places. Besides a little prestige, the mod would do little to affect winning the game. It would be more as a player side goal.

After an Initial Working Mod is created:
A single picture could be used for all plants, unique pictures for each is a goal for later. One plant per continent will suffice to start, or even select places. Having a different plant for each county a large undertaking for later. I won’t worry about ranks too much until initial creation. Maybe the gardener trait comes later. Perhaps have 20 different plants, you can make a once in a lifetime book on plants that gives some kind of stat modifier.

After completion:
If all is explained well, then this can serve as a guide to teach others how to do some modding. The mod could then be changed to collect religious texts, gemstones, anything by just renaming stuff. The fun is in collecting and you don’t know what you will get.

Thank you and credits to Arumba as listed below in text.
Also looked at Maal's "The Great Trade League" work as he is the first to make a custom society and all hail him as the king.
I learned by doing and testing and yeah, sometimes stuff didn't work.

Newer posts make this first one outdated. But I keep it as a journal record.

Part 1 - Creating the Initial Mod Folder
Part 2 - Creating the Society in Game
Part 3 - Editing Society Ranks
Part 4 - Enable Rank Powers - Portrait Membership

----------------------------------------
Part 1 - Creating the Initial Mod Folder

Reference
Arumba. 2013. Crusader Kings 2 How to make a Mod. I removed links due to forum rules, but he explained it well.

First create a mod folder so you don't break the game.
There will be two CKII folders. One it the C drive where the game is installed. The other in Documents.

Step 1. Go to your documents folder:....Documents\Paradox Interactive\Crusader Kings II\mod
Created a new folder within the mod folder. I named mine Botanic.

Step 2. Next I have to copy some game files into the newly created mod folder, Botanic.
I went to the installed game file folder: C:\Program Files (x86)\Steam\steamapps\common\Crusader Kings II
I copied the following 6 folders:
common
decisions
events
gfx
interface
localisation
And placed this into my newly created folder: ...Documents\Paradox Interactive\Crusader Kings II\mod\Botanic

Step 3. In that mod folder:....Documents\Paradox Interactive\Crusader Kings II\mod
Create a new txt file.
In the txt file I placed the following two lines (I recommend all lowercase for the future):
Code:
name = "Botanic"
path = "mod/Botanic"

I then saved the txt file. You might have to go into your control panel to make file extensions visible. To do that go into your control panel>Folder Options>View tab and then uncheck the "Hide extensions for known file types"
Then you can rename the txt file to: Botanic.mod

Now you can open your CKII game. Look at your mod options. "Botanic" should now be a selectable option.
If you see it, then success.
This created a folder with files we can edit so we don't mess up our original game.

----------------------------------------
Part 2 - Creating the Society in Game

Step1. I went into the folder I created: ...Documents\Paradox Interactive\Crusader Kings II\mod\Botanic\common\societies
In that folder I opened the txt file: 00_societies.txt
There I scrolled through and looked at the file. I could determine the different society groups. I then found the "hermetics" section. I copied this entire section from
Code:
hermetics
to the last "}" just before
Code:
###THE ASSASSINS###

In a text editor, name removed, I pasted the code. I then began to edit.
First at the top I placed
Code:
###BOTANIC ORDER###

I changed "hermetics = {" to "Botanic = {"

I then pasted all this code after the last "}" of the hermetic section and just before the "###THE ASSASSINS###"

To test I started a new game with the mod activated and found Botanic appears. When the button is pressed, can't join it.

----------------------------------------
Part 3 - Editing Society Ranks

Using a datebase program, I created a csv file in the folder: ...Documents\Paradox Interactive\Crusader Kings II\mod\Botanic\localisation
I named it Botanic.csv
Only in the first column I added the following lines in their own cell:
Code:
#CODE;ENGLISH;FRENCH;GERMAN;;SPANISH;;;;;;;;;x
Botanic;The Botanical Society;;;;;;;;;;;;;x 
Botanic_rank_1_female;Gardener;Néophyte;Neophyt;;neófita;;;;;;;;;x
Botanic_rank_2_female;Farmer;Initiée;Novizin;;iniciada;;;;;;;;;x
Botanic_rank_3_female;Botanist;Adepte;Adeptin;;adepta;;;;;;;;;x
Botanic_rank_4_female;Currator;Mage;Magus;;sabia;;;;;;;;;x
Botanic_rank_1_male;Gardener;Gardener;Gartener;;Gardeno;;;;;;;;;x
Botanic_rank_2_male;Farmer;;;;;;;;;x
Botanic_rank_3_male;Botanist;;;;;;;;;x
Botanic_rank_4_male;Currator;;;;;;;;;x

To explain:
The first line "#CODE;" indicates the game is set up for 4 different languages. The first is English, I am working on the English Version.
For one I played around and put other languages, but it didn't matter and I don't care at this time. Maybe I will edit it later.
For the other lines, "Botanic" starts off the code. This is in relation to the mod.
For this line "Botanic;The Botanical Society;;;;;;;;;;;;;x" the first "Botanic" links the files together. The next section allows you to change the name as it appears at the join society screen. It says The Botanical Society rather than Botanic.
The rest of the lines explain their own ranks. This is for renaming the ranks only. It doesn't do anything else at this time.

----------------------------------------
Part 4 - Enable Rank Powers

Step1. In folder ...Documents\Paradox Interactive\Crusader Kings II\mod\Botanic\localisation\customizable_localisation I open "00_customizable_localisation_FR.txt"
Within "00_customizable_localisation_FR.txt" added an equal entry whever hermetics was found.

hermmetics was mention twice in one section:
Code:
text = {
       localisation_key = String_hermetics_DuDelaDes
       trigger = { society_member_of = hermetics }

I edited for Botanic (I wish I didn't capitalize the B, but I did and will keep using it).
Code:
text = {
       localisation_key = String_Botanic_DuDelaDes
       trigger = { society_member_of = Botanic }
I then added these lines just before the hermetics entry.

Step2. In folder ...Documents\Paradox Interactive\Crusader Kings II\mod\Botanic\localisation\customizable_localisation I open "00_customizable_localisation.txt"
Within "00_customizable_localisation.txt" added an equal entry whever hermetics was found.

Code:
#GetHermeticsRank
#GetBotanicRank

----------------

Code:
text = {
       localisation_key = hermetics
       trigger = { society_member_of = hermetics }
   }
   text = {
       localisation_key = Botanic
       trigger = { society_member_of = Botanic }
   }

----------------

Code:
  text = {
       localisation_key = hermeticsCap
       trigger = { society_member_of = hermetics }
   }
   text = {
       localisation_key = BotanicCap
       trigger = { society_member_of = Botanic }
   }

----------------

Code:
defined_text = {
   name = GetFromThisHermeticsRank
   text = {
       trigger = {
           is_liege_of = FROM
           FROM = { has_minor_title = title_hermetics_apprentice }
       }
       localisation_key = String_GetMasterMistress
   }
   text = {
       trigger = {
           NAND = {
               is_liege_of = FROM
               FROM = { has_minor_title = title_hermetics_apprentice }
           }
       }
       localisation_key = String_GetSocietyRank
   }
}

Code:
defined_text = {
   name = GetFromThisBotanicRank
   text = {
       trigger = {
           is_liege_of = FROM
           FROM = { has_minor_title = title_Botanic_apprentice }
       }
       localisation_key = String_GetMasterMistress
   }
   text = {
       trigger = {
           NAND = {
               is_liege_of = FROM
               FROM = { has_minor_title = title_Botanic_apprentice }
           }
       }
       localisation_key = String_GetSocietyRank
   }
}

----------------

Code:
defined_text = {
   name = GetHermeticsDestinedRole
 
   text = {
       trigger = {
           has_character_flag = destined_steward
       }
       localisation_key = String_steward
   }
   text = {
       trigger = {
           has_character_flag = destined_fighter
       }
       localisation_key = String_figther
   }
   text = {
       trigger = {
           has_character_flag = destined_diplomat
       }
       localisation_key = String_diplomat
   }
   text = {
       trigger = {
           has_character_flag = destined_schemer
       }
       localisation_key = String_schemer
   }
   text = {
       trigger = {
           has_character_flag = destined_scholar
       }
       localisation_key = String_scholar
   }
}


Code:
defined_text = {
   name = GetHermeticsDestinedRole
 
   text = {
       trigger = {
           has_character_flag = destined_steward
       }
       localisation_key = String_steward
   }
   text = {
       trigger = {
           has_character_flag = destined_fighter
       }
       localisation_key = String_figther
   }
   text = {
       trigger = {
           has_character_flag = destined_diplomat
       }
       localisation_key = String_diplomat
   }
   text = {
       trigger = {
           has_character_flag = destined_schemer
       }
       localisation_key = String_schemer
   }
   text = {
       trigger = {
           has_character_flag = destined_scholar
       }
       localisation_key = String_scholar
   }
}

----------------

Code:
defined_text = {
   name = GetHermeticsDestinedExpertise
 
   text = {
       trigger = {
           has_character_flag = destined_steward
       }
       localisation_key = String_administration
   }
   text = {
       trigger = {
           has_character_flag = destined_fighter
       }
       localisation_key = String_battle
   }
   text = {
       trigger = {
           has_character_flag = destined_diplomat
       }
       localisation_key = String_diplomacy
   }
   text = {
       trigger = {
           has_character_flag = destined_schemer
       }
       localisation_key = String_intrigue
   }
   text = {
       trigger = {
           has_character_flag = destined_scholar
       }
       localisation_key = String_scholarship
   }
}



Code:
defined_text = {
   name = GetBotanicDestinedExpertise
 
   text = {
       trigger = {
           has_character_flag = destined_steward
       }
       localisation_key = String_administration
   }
   text = {
       trigger = {
           has_character_flag = destined_fighter
       }
       localisation_key = String_battle
   }
   text = {
       trigger = {
           has_character_flag = destined_diplomat
       }
       localisation_key = String_diplomacy
   }
   text = {
       trigger = {
           has_character_flag = destined_schemer
       }
       localisation_key = String_intrigue
   }
   text = {
       trigger = {
           has_character_flag = destined_scholar
       }
       localisation_key = String_scholarship
   }
}

----------------

The next string delt with the quest to get ingredients. Instead of duplicating, I tried to include an or statement as in the following areas:

Code:
text = {
       localisation_key = String_might_take_up_too_much_space
       trigger = {
           any_artifact = {
               has_artifact_flag = selected_ingredient_1
               NOT = { artifact_type = ingredient_metal_exotic6 } #Gold
           }
           society_member_of = hermetics
           has_character_flag = built_laboratory
       }






Code:
text = {
       localisation_key = String_might_take_up_too_much_space
       trigger = {
           any_artifact = {
               has_artifact_flag = selected_ingredient_1
               NOT = { artifact_type = ingredient_metal_exotic6 } #Gold
           }
           society_member_of = hermetics
           OR =    {society_member_of = Botanic
               }
           has_character_flag = built_laboratory
       }

----------------

Code:
text = {
       localisation_key = String_does_not_send_desired_message
       trigger = {
           any_artifact = {
               has_artifact_flag = selected_ingredient_1
               OR = {
                   artifact_type = ingredient_animal1 #Gallbladder
                   artifact_type = ingredient_animal2 #Kidney
                   artifact_type = ingredient_animal6 #Snout
                   artifact_type = ingredient_animal7 #Heart
                   artifact_type = ingredient_animal8 #Liver
                   artifact_type = ingredient_metal_exotic5 #Brimstone
                   artifact_type = ingredient_herb6 #Wormwood
                   artifact_type = ingredient_herb3 #Mandrake
               }
           }
           NOT = { society_member_of = hermetics
           OR =    { society_member_of = hermetics
               }
           }
       }
   }

----------------

Code:
NOT = { society_member_of = hermetics }


Code:
NOT =    { society_member_of = hermetics
   OR =    {society_member_of = Botanic
       }
   }

----------------

Code:
 text = {
       localisation_key = String_does_not_contribute_to_the_decor
       trigger = {
           any_artifact = {
               has_artifact_flag = selected_ingredient_1
               OR = {

                   artifact_type = ingredient_herb1 #Hibiscus
                   artifact_type = ingredient_herb2 #Ginger Root
                   artifact_type = ingredient_herb3 #Mandrake
                   artifact_type = ingredient_herb4 #Lemongrass
                   artifact_type = ingredient_herb6 #Wormwood
                   artifact_type = ingredient_herb7 #Valerian
                   artifact_type = ingredient_herb8 #Violet
                   artifact_type = ingredient_herb9 #Yarrow
                   artifact_type = ingredient_animal1 #Gallbladder
                   artifact_type = ingredient_animal2 #Kidney
                   artifact_type = ingredient_animal6 #Snout
                   artifact_type = ingredient_animal7 #Heart
                   artifact_type = ingredient_animal8 #Liver
                   artifact_type = ingredient_metal_exotic5 #Brimstone
                   artifact_type = ingredient_herb6 #Wormwood
                   artifact_type = ingredient_herb3 #Mandrake
                   artifact_type = ingredient_metal_exotic7 #Copper
                   artifact_type = ingredient_metal_exotic8 #Iron
                   artifact_type = ingredient_metal_exotic9 #Tin
               }
           }
           NOT = { society_member_of = hermetics }
       }
   }



Code:
text = {
       localisation_key = String_does_not_contribute_to_the_decor
       trigger = {
           any_artifact = {
               has_artifact_flag = selected_ingredient_1
               OR = {

                   artifact_type = ingredient_herb1 #Hibiscus
                   artifact_type = ingredient_herb2 #Ginger Root
                   artifact_type = ingredient_herb3 #Mandrake
                   artifact_type = ingredient_herb4 #Lemongrass
                   artifact_type = ingredient_herb6 #Wormwood
                   artifact_type = ingredient_herb7 #Valerian
                   artifact_type = ingredient_herb8 #Violet
                   artifact_type = ingredient_herb9 #Yarrow
                   artifact_type = ingredient_animal1 #Gallbladder
                   artifact_type = ingredient_animal2 #Kidney
                   artifact_type = ingredient_animal6 #Snout
                   artifact_type = ingredient_animal7 #Heart
                   artifact_type = ingredient_animal8 #Liver
                   artifact_type = ingredient_metal_exotic5 #Brimstone
                   artifact_type = ingredient_herb6 #Wormwood
                   artifact_type = ingredient_herb3 #Mandrake
                   artifact_type = ingredient_metal_exotic7 #Copper
                   artifact_type = ingredient_metal_exotic8 #Iron
                   artifact_type = ingredient_metal_exotic9 #Tin
               }
           }
           NOT =    { society_member_of = hermetics
               OR      {society_member_of = Botanic
                   }
               }
       }
   }


----------

Code:
text = {
       localisation_key = String_do_not_contribute_to_the_decor
       trigger = {
           any_artifact = {
               has_artifact_flag = selected_ingredient_1
               OR = {
                   artifact_type = ingredient_herb5 #Nettles           PLURAL
                   artifact_type = ingredient_animal3 #Eyeballs       PLURAL
                   artifact_type = ingredient_animal4 #Cloven Hooves   PLURAL
                   artifact_type = ingredient_animal5 #Antlers           PLURAL
                   artifact_type = ingredient_animal9 #Intestines        PLURAL
               }
           }
           NOT =    { society_member_of = hermetics
               }
       }
   }




Code:
  text = {
       localisation_key = String_do_not_contribute_to_the_decor
       trigger = {
           any_artifact = {
               has_artifact_flag = selected_ingredient_1
               OR = {
                   artifact_type = ingredient_herb5 #Nettles           PLURAL
                   artifact_type = ingredient_animal3 #Eyeballs       PLURAL
                   artifact_type = ingredient_animal4 #Cloven Hooves   PLURAL
                   artifact_type = ingredient_animal5 #Antlers           PLURAL
                   artifact_type = ingredient_animal9 #Intestines        PLURAL
               }
           }
           NOT =    { society_member_of = hermetics
               OR =    {society_member_of = Botanic
                   }
               }
       }
   }


----------------


Code:
AND = {
                   society_member_of = hermetics
                   any_artifact = {
                       has_artifact_flag = selected_ingredient_1
                       OR = {
                           artifact_type = ingredient_metal_exotic3 #Aqua Regia
                           artifact_type = ingredient_metal_exotic4 #Aqua Fortis
                       }
                   }



Code:
AND = {
                   society_member_of = hermetics
                   OR =    {society_member_of = Botanic
                       }
                   any_artifact = {
                       has_artifact_flag = selected_ingredient_1
                       OR = {
                           artifact_type = ingredient_metal_exotic3 #Aqua Regia
                           artifact_type = ingredient_metal_exotic4 #Aqua Fortis
                       }
                   }

----------------

Code:
text = {
       localisation_key = String_might_possess_hidden_uses
       trigger = {
           any_artifact = {
               has_artifact_flag = selected_ingredient_1
           }
           society_member_of = hermetics
       }



text = {
       localisation_key = String_might_possess_hidden_uses
       trigger = {
           any_artifact = {
               has_artifact_flag = selected_ingredient_1
           }
           society_member_of = hermetics
           OR =    {society_member_of = Botanic
               }
       }

----------------

That replaced them all and I can see where this could be problematic.
Testing it in game, these enabled powers for the ranks, hermetic powers. I still can't join the society.
I didn't notice before, but it may have already happened, but moving the mouse over the portrait of current members, it now indicates that character is a member of The Botanical Society.


----------------------------------------
Part 5 - Still working on it.

I am so new, I'm not sure the rules on posting pictures, but I hope to add them later. This was a sloppy post as I took a few hours to do the work, learn, and type this up even. I hate that it is so long, but I thought it was better than multiple posting on my own thread. If the length violated the rules I apologize, delete this and I will know better next time. I tried to read the rules and removed most references and citations to other materials. I will be studying the 1500 posts in the quick questions guide in the future.

Please post any thoughts or questions. I can already see I am not that active. Thank you for your time and efforts, and have a nice day and Happy Fourth of July!
 
Last edited:
I like the idea. As for joining the society, you need an event to make the character join, like the vanilla societies do. Otherwise clicking on the "join society" button will do nothing.
 
Part 5 - Joining the Society

This is a journal entry of the work. I repeat it and do it better in the following post where I show you have to create the 5 files: AAA, BBB,.... EEE.
Thank you Andrelvis for pointing me in the right direction. That was exactly the words I needed.

Within ...Documents\Paradox Interactive\Crusader Kings II\mod\Botanic\events I looked at mnm_hermetics_events.txt as an example to follow.
I also looked at Maal's "The Great Trade League" work as he is the first to make a custom society and all hail him as the king.
It seems mnm is a tag for events. Different societies go from 1000 and higher. I think they are full and I need to add my own tag.

I created bot_botanic_events.txt

Code:
###########################################
#                                         #
# Botanical Society                 #
#                                         #
# ID BOT.1000-BOT.1999                 #
#                                         #
###########################################

#IDs:
#1000-1999 TeMarChi #I followed the game creators design.

namespace = BOT #this sets the tag. Examples had 3 letters, and BOT wasn't used. This corresponds to my file name bot_botanic_events.txt

###JOINING###

#From on_character_ask_to_join_society
character_event = {
    id = BOT.1001   #BOT is the tag. 1001 is a number for that event. Don't use duplicates. From here on out, they will start to climb from 1001.
   hide_window = yes
    is_triggered_only = yes
    trigger = {
       FROM = { leader = { is_botanic_member_trigger = yes } }
    }
    immediate = {
       FROM = { leader = { character_event = { id = BOT.1002 } } }   #This uses 1002.
    }
}

#Ping event
character_event = {
    id = BOT.1002       #Here 1002 is listed again, but its not a duplicate, rather this links the other mention of 1002.
   hide_window = yes
    is_triggered_only = yes
    immediate = {
       FROM = { letter_event = { id = BOT.1003 } }
    }
}

#Welcome letter #I don't think it will appear if your society is empty and you create it.
letter_event = {
    id = BOT.1003
    desc = EVTDESC_BOT_1003       #These EVTDESC stand for Event Description. They link to text in the .csv file we created.
                   #Now below my society ranks, I added, without the quotes:
                   #"EVTDESC_BOT_1003;There is much to learn in the new field of flora." #into the firs cell
                   #"May you learn much about plants, and much more about yourself.;;;;;;;;;;;;;x"

    border = GFX_event_letter_frame_economy #end tag instead of relegion could be economy. Not sure what this does.

    is_triggered_only = yes
  
   #immediate = { set_character_flag = society_join_block } #not sure what this does so I omitted it by placing a # in front of it.
  
#This next option is the pop-up window.
#EVTOPTA stands for Event Option A. The next has a B.
#These are your choices, A lets you join the society. B takes the default, nothing changes, you don't join.
#Within the Botanic.csv file I created, I had to insert EVTOPTA and EVTOPTB option lines. I could then edit their messages.
    option = {
        name = EVTOPTA_BOT_1003
       wealth = 1
       wealth = -1
       join_society = Botanic
    }
    option = {
        name = EVTOPTB_BOT_1003
    }
}

This allowed me to join the society. But it had no members. It gives a nice message saying your society is dead that you are the founder. This was a big step forward.

A small step backwards, no automatic members. Also the society description was no longer present. But I am happy to see progress.
The reason you can't join it is you have to add the society to the custom effects -- if you look under events, the event to join the society calls a scripted event that needs to have your society added to it.

ADDENDUM: Also, if you want AI to join the society, they actually get forced in via an event--so you'd need to add a mention of your society there as well.
So it appears I have to add this function somewhere.

Progress made: I now can join The Botanical Society. It doesn't do anything. It looks buggy from the out of place text.

Thank you again to Andrelvis for his tip.
----------------------------------------
 
Last edited:
Part 5 - Joining the Society

Thank you Andrelvis for pointing me in the right direction. That was exactly the words I needed.

Within ...Documents\Paradox Interactive\Crusader Kings II\mod\Botanic\events I looked at mnm_hermetics_events.txt as an example to follow.
I also looked at Maal's "The Great Trade League" work as he is the first to make a custom society and all hail him as the king.
It seems mnm is a tag for events. Different societies go from 1000 and higher. I think they are full and I need to add my own tag.

I created bot_botanic_events.txt

Code:
###########################################
#                                         #
# Botanical Society                 #
#                                         #
# ID BOT.1000-BOT.1999                 #
#                                         #
###########################################

#IDs:
#1000-1999 TeMarChi #I followed the game creators design.

namespace = BOT #this sets the tag. Examples had 3 letters, and BOT wasn't used. This corresponds to my file name bot_botanic_events.txt

###JOINING###

#From on_character_ask_to_join_society
character_event = {
    id = BOT.1001   #BOT is the tag. 1001 is a number for that event. Don't use duplicates. From here on out, they will start to climb from 1001.
   hide_window = yes
    is_triggered_only = yes
    trigger = {
       FROM = { leader = { is_botanic_member_trigger = yes } }
    }
    immediate = {
       FROM = { leader = { character_event = { id = BOT.1002 } } }   #This uses 1002.
    }
}

#Ping event
character_event = {
    id = BOT.1002       #Here 1002 is listed again, but its not a duplicate, rather this links the other mention of 1002.
   hide_window = yes
    is_triggered_only = yes
    immediate = {
       FROM = { letter_event = { id = BOT.1003 } }
    }
}

#Welcome letter #I don't think it will appear if your society is empty and you create it.
letter_event = {
    id = BOT.1003
    desc = EVTDESC_BOT_1003       #These EVTDESC stand for Event Description. They link to text in the .csv file we created.
                   #Now below my society ranks, I added, without the quotes:
                   #"EVTDESC_BOT_1003;There is much to learn in the new field of flora." #into the firs cell
                   #"May you learn much about plants, and much more about yourself.;;;;;;;;;;;;;x"

    border = GFX_event_letter_frame_economy #end tag instead of relegion could be economy. Not sure what this does.

    is_triggered_only = yes
  
   #immediate = { set_character_flag = society_join_block } #not sure what this does so I omitted it by placing a # in front of it.
  
#This next option is the pop-up window.
#EVTOPTA stands for Event Option A. The next has a B.
#These are your choices, A lets you join the society. B takes the default, nothing changes, you don't join.
#Within the Botanic.csv file I created, I had to insert EVTOPTA and EVTOPTB option lines. I could then edit their messages.
    option = {
        name = EVTOPTA_BOT_1003
       wealth = 1
       wealth = -1
       join_society = Botanic
    }
    option = {
        name = EVTOPTB_BOT_1003
    }
}

This allowed me to join the society. But it had no members. It gives a nice message saying your society is dead that you are the founder. This was a big step forward.

A small step backwards, no automatic members. Also the society description was no longer present. But I am happy to see progress.

So it appears I have to add this function somewhere.

Progress made: I now can join The Botanical Society. It doesn't do anything. It looks buggy from the out of place text.

Thank you again to Andrelvis for his tip.
----------------------------------------

I'm glad I could help :)

As for the society lacking members, what is your code for startup_populate?
 
I attempted to repeat everything I had learned and then I ran into the joining society problem again. Today I was able to join the society.

I give credit to:
Maal's "The Great Trade League" work as he is the first to make a custom society and all hail him as the king.
By looking at his files I begin to deconstruct the code and figure out what it does. There is probably extra code I don't need, a relic to this work that still exists in the code.

Part 1 - Creating the Initial Mod Folder WORKS nicely.

For this next test, I named everything "lion" to repeat everything. File extentions will show lion, but The Botanical Society is still the theme.

Part 2 - Creating the Society in Game - In the works.
AAA ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\common\societies must be edited.
BBB ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\localisation a csv file must be created.
CCC ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\events a txt file must be created.
DDD ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\common\on_actions a txt file must be created.
EEE ...\Documents\Paradox Interactive\Crusader Kings II\mod\Lion\localisation\customizable_localisation a txt file must be created.

Part AAA - I edited this a little to reduce some of the rubbish. This code was added to the end of ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\common\societies "00_societies.txt" and makes the society appear. In the future I may just try to created a txt file.
Code:
###Edited for Lion Below###
lion = {
   primary_attribute = learning
   society_ranks_gfx = generic_ranks
   opinion_to_other_members = +10
   opinion_per_rank_above = +5
   # opinion_to_perceived_members = -10
   sound = hermetic_society_interface
   non_interference = {
       always = yes
   }
  
   active = {
       # has_dlc = "Mystics"
   }
   indestructible = yes
  
   can_join_society = {
       hidden_trigger = {
           NAND = {
               ai = yes
               is_society_rank_full = {
                   society = lion
                   rank = 1
               }
           }
           # is_landed = yes
       }
       learning = 5
       #OR = {       #I put # to deactivate this spot but to be a placeholder for future changes.
       #   trait = gardener
       #}
       NOT = { has_character_flag = guilds_traitor }
       hidden_trigger = { mercenary = no }
       # scaled_wealth = { value = 0.25 min = 30 }
   }

   show_society = {
       # OR = {
       stewardship = 1
       # }
   }
  
  
   society_rank = {
       level = 1
       limit = 50
       startup_limit = 20
       modifier = {
           church_opinion = -10
           #economy_techpoints = 0.05
       }
   }
  
   society_rank = {
       level = 2
       limit = 25
       startup_limit = 10
       modifier = {
           # stewardship = 1
           church_opinion = -10
           global_tradevalue_mult = 0.05
       }
   }
  
   society_rank = {#forget test bonuses
       level = 3
       limit = 15
       startup_limit = 5
       modifier = {
           # stewardship = 2
           church_opinion = -10
           # max_tradeposts = 1
           global_tradevalue_mult = 0.1
       }
   }

   society_rank = {
       level = 4
       limit = 5
       startup_limit = 2
       modifier = {
           # stewardship = 3
           church_opinion = -10
           # max_tradeposts = 1
           global_tradevalue_mult = 0.2
           build_cost_city_modifier = -0.2
       }
   }
  
   plots = {
   }
  
   monthly_currency_gain = {
       name = currency_name_lion
      
       per_attribute = {
           name = learning
           value = 0.5
       }
      
  
       has_trait = {
           value = 3
           trait = genius
       }
       has_trait = {
           value = 2
           trait = quick
       }
       has_trait = {
           value = 2
           trait = shrewd
       }
       has_trait = {
           value = 2
           trait = diligent
       }
       has_trait = {
           value = 1
           trait = patient
       }
       society_rank = {
           rank = 4
           value = 10
       }
   }

   member_score_per_attribute = 3
   member_score_per_rank = 100

   member_score = {
       value = 10

       modifier = {
           factor = 2
           trait = greedy
       }
       modifier = {
           factor = 1
           trait = patient
       }
       modifier = {
           factor = 1.5
           OR = {
               trait = genius
               trait = quick
               trait = shrewd
           }
       }
   }
  
   startup_populate = {
       trigger = {
           ai = yes
           controls_religion = no
           age = 16
           is_in_society = no
           is_dumb_trigger = no
           is_landed = yes
           OR = {
               AND = { #feudal
                   NOT = { is_priest = yes }
                   OR = {
                       learning = 10
                       trait = gardener
                   }
               }
           }
       }
   }
}
Part BBB - I then went into ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\localisation and created a csv file, I named mine "lion.csv"
Within this file I placed:
Code:
#CODE;ENGLISH;FRENCH;GERMAN;;SPANISH;;;;;;;;;x
lion;The Botanical Society;;;;;;;;;;;;;x  
lion_rank_1_female;Gardener;Néophyte;Neophyt;;neófita;;;;;;;;;x
lion_rank_2_female;Farmer;Initiée;Novizin;;iniciada;;;;;;;;;x
lion_rank_3_female;Botanist;Adepte;Adeptin;;adepta;;;;;;;;;x
lion_rank_4_female;Currator;Mage;Magus;;sabia;;;;;;;;;x
lion_rank_1_male;Gardener;Gardener;Gartener;;Gardeno;;;;;;;;;x
lion_rank_2_male;Farmer;;;;;;;;;x
lion_rank_3_male;Botanist;;;;;;;;;x
lion_rank_4_male;Currator;;;;;;;;;x

lion_desc;The Botanical Society strives to learn about plants.;;;;;;;;;;;;;x
currency_name_lion;Floral Knowledge;;;;;;;;;;;;;x
lion_desc;The Botanical Society is an group of plant researchers.;;;;;;;;;;;;;x



EVTDESC_LIO_102;I have received a letter about your interest in joining our Botanical Society. You must know that we don't care about what you believe in or what you are entitled to
EVTOPTA_LIO_102;Lets study the floral arts.;;;;;;;;;;;;;x
EVTOPTB_LIO_102;Thank you, but I do not want to join the society at this time.;;;;;;;;;;;;;x

IS_GUILDS_TRIGGER;Is a member of The Botanical Society.;;;;;;;;;;;;;x

This csv file puts some information into the society.

Part CCC - An events file must be created. I named mine "lion_events.txt"
Code:
namespace = LIO

# 10 join

#From on_character_ask_to_join_society
character_event = {
    id = LIO.100
   hide_window = yes
    is_triggered_only = yes
    trigger = {
       FROM = { leader = { society_member_of = lion } }
    }
    immediate = {
       FROM = { leader = { character_event = { id = LIO.101 } } }
    }
}

#Ping event
character_event = {
    id = LIO.101
   hide_window = yes
    is_triggered_only = yes
    immediate = {
       FROM = { letter_event = { id = LIO.102 } }
    }
}

#Welcome letter
letter_event = {
    id = LIO.102
    desc = EVTDESC_LIO_102 #Shamefully borrowing from the Pomandres
    border = GFX_event_letter_frame_economy
  
    is_triggered_only = yes

    option = {
        name = EVTOPTA_LIO_102
       wealth = 1
       wealth = -1
       join_society = lion
    }
    option = {
        name = EVTOPTB_LIO_102
    }
}
This code puts event information that sets up being able to join the society. Note: EVTOPTB_LIO_102 has an error at this time.

Part DDD - in ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\common\on_actions I crated a .txt file named "lion_actions.txt"
In this file I placed this code:
Code:
on_character_ask_to_join_society = {
   events = {
       LIO.100 #Join Guilds
   }
}
I believe this makes the join society button clickable so that you can join the society. This checks the events codes and puts the events code from part CCC into action. Parts AAA and BBB give the society content. I think.

Part EEE ...\Documents\Paradox Interactive\Crusader Kings II\mod\Lion\localisation\customizable_localisation a txt file must be created. I name mine "lion_custom_local.txt"
I added this code:
Code:
defined_text = {
   name = GetSocietyCurrency

   text = {
       localisation_key = currency_name_lion
       trigger = { society_member_of = lion }
   }
}

defined_text = {
   name = GetSocietyRank

   text = {
       localisation_key = lion_rank_1_female
       trigger = { is_female = yes society_rank = { society = lion rank == 1 } }
   }
   text = {
       localisation_key = lion_rank_1_male
       trigger = { is_female = no society_rank = { society = lion rank == 1 } }
   }
   text = {
       localisation_key = lion_rank_2_female
       trigger = { is_female = yes society_rank = { society = lion rank == 2 } }
   }
   text = {
       localisation_key = lion_rank_2_male
       trigger = { is_female = no society_rank = { society = lion rank == 2 } }
   }
   text = {
       localisation_key = lion_rank_3_female
       trigger = { is_female = yes society_rank = { society = lion rank == 3 } }
   }
   text = {
       localisation_key = lion_rank_3_male
       trigger = { is_female = no society_rank = { society = lion rank == 3 } }
   }
   text = {
       localisation_key = lion_rank_4_female
       trigger = { is_female = yes society_rank = { society = lion rank == 4 } }
   }
   text = {
       localisation_key = lion_rank_4_male
       trigger = { is_female = no society_rank = { society = lion rank == 4 } }
   }
}

defined_text = {
   name = GetSocietyName # Returns the name of target's society

   text = {
       localisation_key = string_guilds
       trigger = { society_member_of = lion }
   }
}

defined_text = {
   name = GetSocietyNameCap # Returns the name of target's society with inital Capital letter

   text = {
       localisation_key = lion
       trigger = { society_member_of = lion }
   }
}
I think this gives more content to the society making it run like it should.

I was testing and maybe edited other stuff and things got messy. I just don't remember if I changed anything else. These are my notes for today. Once I repeat with success and learn and figure out more, I will edit my first post to reflect these changes.

What this hopes to accomplish, makes the society, gives it a lot of content, and allows you to join the society. The society also is auto populated with some members. Clicking the join button gives you a welcome message, yet still kind of buggy. Also lion and Lion are used, but should be consistent.

Again this is still a work in progress.

Have a nice day!
 
Last edited:
8/6/2017 notes:

Part1. Bug fix and explanation
Part2. Changing Symbols


--------------------------------------
Part1. Bug fix and explanation:

From the previous thread, my last work, joining the society showed a buggy option:

Code:
EVTOPTA_LIO_102;Lets study the floral arts.;;;;;;;;;;;;;x
EVTOPTB_LIO_102;Thank you, but I do not want to join the society at this time.;;;;;;;;;;;;;x

EVTOPTB... showed incorrectly because it had too many characters. There is a limit. I changed this:

Code:
EVTOPTB_LIO_102;I do not want to join.;;;;;;;;;;;;;x

--------------------------------------
Part2. Changing Symbols:

In game, after clicking the society tab, then clicking "List all known Societies" the list of societies is shown. There is a symbol to the left of each society, example: The Benedict Order has a symbol of a cross. Another example: Lucifer's Own has a pentagram. By default I suppose, The Botanical Society has the symbol_small_the_assassins.dds. I didn't define this, so the game chose it.
1. I need to figure out how to define this for my society, link the image to the society interface.

These symbols are found at \Documents\Paradox Interactive\Crusader Kings II\mod\lion\gfx\interface\societies
They are labeled "symbol_small_XXXXXXXXXX" the X's being some text.
I tried to open these images in paint, but it didn't work.
I downloaded and installed GIMP because it is a free utility like photoshop for image editing.
I tried to open these images in GIMP but that failed.
For GIMP I had to find a DDS plugin. I found a thread that led to a site. I downloaded it for my system. Then I had to place that .exe into the GIMP plugin folder.
Then I dragged and dropped the images into GIMP and they showed.
In GIMP I selected: Edit / Preferences / Display / Transparency / Check style: White only. This helped me see the image and not the checkered board grey and black stuff.
2. I need to learn how to make/edit a custom image for use with The Botanical Society. Maybe a leaf or a tree image. Maybe there is a way to import an image and covert it to grey scale.

The images have 2 parts, I guess a greyed out and a selected portion. I'm not familiar with image stuff.
3. Figure out why there are two parts to each image.

Once figured out, it may then be possible to change not only that image, but also the guild rank symbols and the guild interface. If anyone can add there thoughts, it will be appreciated. Took me a while to figure all this out, I was inefficient. But I note my concluding findings here for when I pick up where I left next time.
 
For DDS files, I generally open them with Paint.NET, save them as PNGs for ease of editing, and then open with GIMP. After editing, I save it as a DDS in Paint.NET again (it is good to keep the PNG, since the DDS can lose quality). The DDS plugin for GIMP was unable to open many DDS files for me in the past.
 
I didn't want to, but I looked for images in the game files and I didn't like any of them for a plant. The ingredients for the hermetic society are just pouches. I want to see something that looks like a plant or a flower. This forced me down the path of creating a custom image. This could have been done easier if I had planned it out or worked with images before, but I had to learn. I'll try to put easier suggested the instructions that one may follow, but it still could be simplified:

Programs used:
GIMP (free download off the internet) *May need the dds extension.
Paint (the paint program that comes with windows computers)

Parts
1. Create the brown canvass
2. Create the image
3. Save the image as a game file
4. Testing

Part 1: Create the brown canvass
1. In ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\gfx\interface\inventory\artifacts are the artifacts images as .dds files. Specifically, I open viking_axe.dds into GIMP by just dragging the file and dropping onto the GIMP program. Note “lion” is a copied folder of the game files. Do not edit the original game files. This is modding lesson one. Do not change anything without learning this. I repeat do not proceed if you don’t know what I am talking about. Copy the files before you work with them. See my other post… I’ll try to link it here.
2. I exported the viking_axe.dds file as a .jpg into a new folder just to hold my work in progress stuff.

3. I opened the newly saved .jpg file in Paint. I used Paint because it was easy to work with. Even Andrelvis suggested it ;).
4. I selected the bottom right portion of the image and copied it so I would have the bottom right corner.
5. I pasted that corner back onto the image, rotated it, then placed it in the top right.
6. I then copied the right side of the image, which is all brown now.
7. I then pasted that half onto the image, rotated it, then placed it on the left side.

This resulted in a plain brown background image that looks similar to what the game uses. This is my black brown canvass… to say. I need to figure out how to post images on this forum. Until then, just imagine it is sort of like the viking_axe.dds image but without the axe, just brown, lighter brown in the middle, darker brown near the edges. Ok I figured it out.

Part 2: Create the image
1. I took a picture of a venus flytrap with a camera, uploaded the picture onto my computer as .jpg file.

2. I opened it with GIMP.
3. Using the "Free Select Tool" I drew around the venus flytrap in the image. I copied this selection.
4. I opened my brown canvass image in Paint. I pasted my plant image selection. I dragged the corners to make it a good size. I moved it into the middle of the brown canvass.
5. I saved the plant on brown as plantunsized.jpg.

6. Still in Paint, I selected the image and right clicked it to resize it. I chose the pixel option, set for 118 by 118. I saved this image as plant.jpg.
7. I then resaved the image, but this next time I chose the pixel option set as 59 by 59. I saved this image as plant_small.jpg.
This resulted in the images I plan to use for the game files.

Part 3: Save the image as a game file
The game has an image and small image version for each artifact. To mimic the game files I made the same.
1. I opened my plant.jpg file in GIMP. I then exported the file as plant.dds.
2. I did the same with the plant_small.jpg. I exported the file as plant_small.dds.
3. I pasted this two .dds files of my plant image into the artifact folder.

Part 4: Testing
Since my image is not yet connected to any event, I will test it by replacing the Iron Crown of Lombardia.

1. I renamed my plant.dds and plant_small.dds to iron_crown_of_lombardy.dds and iron_crown_of_lombardy_small.dds respectively. I made a backup of the original files. I then replaced the folder files with my newly modified files.
2. I opened the game. I started a new game. I search for people. Searches for artifacts can be performed like searching for characters. I searched iron and selected the king. I looked into his inventory and success. Note why a image and small image are used. The top is the image. The bottom in the artifact inventory is the smaller image.

3. After success, I did replaced the changed files with the original so that I will have the proper image for the crown back.
What we accomplished. We created an image file and replaced a game image with this file. This process can be used in many other modifications for the game. For this case it was artifacts, but it could be used with boarders, interface, etc. Note the file extensions, where images must be placed, and the size of those images to match that of the game. It was fun. Hopefully, this image will be used for future events in The Botanical Society!
 
Last edited:
you don't seem to be aware than Paradox did things well (for once in gfx modding terms) and provide a generic empty background for artefacts AKA arti_bg.dds
You can easily make some colour variants out of it (paint.net is far enough powerfull for this and much simpler than Gimp, even though i hate promoting paint.net over Gimp :p )
 
From my last post, thank you Arko. I did not know that about the background, I'm glad they included it, and yeah if I would have known... That information practically skips Part 1.
Also note my plant images are too big and expand out of the frame. I believe I know what I have to do, but will fix it later. I just note it here now. I think I need to make it 100 and 50, but for some reason I used 59 and 118 pixels.
The following took me a few days of learning and getting past problems...

In this post I try to make the first thing you can do with the society besides join it.
Much credit goes to Maal and his project The Great Trade League.

Part 1. Code was added to: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\events\lion_events.txt
Part 2. Code was added to: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\common\artifacts\00_artifacts.txt
Part 3. Code was added to: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\decisions\minor_decisions.txt
Part 4. Code was added to: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\localisation\lion.csv
Part 5. 2 images were added to: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\gfx\interface\inventory\artifacts
Part 6. A txt file was created and added as: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\interface\lion.gfx

In addition I learned the spoiler forum code tags. I may go back and change some of my older posts... later.

Overview: To do stuff in the society requires events, so we code one. The event will use an artifact we will create, so we code for it to create one. We also create an option to click in the game, within the intrigue options, so that the event will be performed. We code for this decision.

Part 1. Creating the event. I previously made the lion_events.txt file so that I could have and join a society, mentioned in a previous post; file edited was located in my system at ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\events\lion_events.txt. I kept the above code to show that on how to join I was using LIO.10. But in this next event section, I labeled it LIO.20. I also think it is smart to have the code table of contents on the top. I mimicked this from the game designers, probably standard coding practice etc. etc. but I'm just a guy learning.The section #20 is the new stuff.
I placed a line of ###### to make it easier to read. Note # make text in the code, its not used for code after that on the line.
For labeling within the code, I named the event #Collect plant in the local forest
Then the code starts with character_event = {.
The id = LIO.200 is the tag that other codes will use to recall this event and make it play.
desc = EVTDESC_LIO_200 recalls information from the .csv file we will edit in Part 4.
picture = GFX_evt_bandits_forest is code, but it doesn't work at this time. It is a bug for my code, I will fix later.
is_triggered_only = yes
option = { is just stuff I have to put...

So this event makes a pop-up window appear with some words and it give you two choices. Each choice is coded, show here as A and B with:
name = EVTOPTA_LIO_200
add_artifact = lio_plant this recalled and uses the code for the artifact I will edit in Part 2.
ai_chance = { this part give the ai a chance to perform the event. Not too sure how it works. Factor 5 is bigger than factor 2, so I guess the ai will get the plant more often than not. But I stop the ai in Part 3 from getting the artifact.
factor = 5
modifier = {
factor = 0
has_artifact = lio_plant I think this parts added the artifact to your artifact inventory.

Option B is coded similar but doesn't give the plant into your inventory.
This concludes Part 1.

namespace = LIO

# 10 join
# 20 decisions (located in ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\decisions)


########################################################################

# 10 join
#From on_character_ask_to_join_society
character_event = {
id = LIO.100
hide_window = yes
is_triggered_only = yes
trigger = {
FROM = { leader = { society_member_of = lion } }
}
immediate = {
FROM = { leader = { character_event = { id = LIO.101 } } }
}
}

#Ping event
character_event = {
id = LIO.101
hide_window = yes
is_triggered_only = yes
immediate = {
FROM = { letter_event = { id = LIO.102 } }
}
}

#Welcome letter
letter_event = {
id = LIO.102
desc = EVTDESC_LIO_102 #Shamefully borrowing from the Pomandres
border = GFX_event_letter_frame_economy

is_triggered_only = yes

option = {
name = EVTOPTA_LIO_102
wealth = 1
wealth = -1
join_society = lion
}
option = {
name = EVTOPTB_LIO_102
}
}

########################################################################

# 20 decisions
#Collect plant in the local forest
character_event = {
id = LIO.200
desc = EVTDESC_LIO_200
picture = GFX_evt_bandits_forest

is_triggered_only = yes

option = {
name = EVTOPTA_LIO_200
add_artifact = lio_plant
ai_chance = {
factor = 5
modifier = {
factor = 0
has_artifact = lio_plant
}
}
}
option = {
name = EVTOPTB_LIO_200
ai_chance = {
factor = 2
modifier = {
factor = 10
has_artifact = lio_plant
}
}
}
}

Part 2. In this part we code the artifact we are going to use. Note in Part 1 it was named lio_plant in the code. I go into: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\common\artifacts\00_artifacts.txt.
The first and last part are ### lines so I know what I am doing. Here is the actual code:

lio_plant = { gives the name of the artifact
picture = "GFX_lio_plant" recalls the location of the images of the artifact. We add these images in Part 5.
#active = { society_member_of = lion } with the #, this code is currently disabled. But if I remove the #, it would be active. active or not active are rules that will make the modifications of the artifact available to the character. For example, some artifact bonuses are only applied when the character is of a specific religion. In this case I am ready to activate it to only be active if you are a member of the society, coded as lion, but is shown in game as The Botanical Society.
Allowed_gift = { I think allows you to give it away to other characters, but I say no.
quality = 2 I think is just to show the rarity of the artifact. Common ones are 1, rare are like 4. It is set by the coder, like here I put 2 but I could put 100 or whatever.
Stacking = no decides if you can have more than one of these in your inventory. I tested, if yes, I can click the event any number of times and keep added the artifact into my inventory within the game. But I put no to allow just one in my inventory.
That is it for this code. other artifacts have different stuff, like equipping them, but this is a plant. No wearing it on your head. You want to do that, then you code for it. We coded for the artifact. This concludes Part 2.

####Edited Section Below####
##################
#Custom Artifacts#
##################

lio_plant = {
picture = "GFX_lio_plant"
#active = { society_member_of = lion }
allowed_gift = {
always = no
}
quality = 2
stacking = no
}


####Edited Section Above####

Part 3.This part we create a character decision in the intrigue screen and options tab within the game. Code was added to: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\decisions\minor_decisions.txt. This will show an option, you click on it, then it will recall the event code, make a pop-up window appear with the A and B choices.

#Collect a plant is the decision name.
lio_collect_a_plant = { is the code tag for the decision.
only_playable = yes I believe means only human players get this option, the ai won't, so no artifact for the ai.
potential = { set up rules to look for to allow the option to appear in a characters intrigue list of options.
In this potential I put must be a society member, playable character and a few other to do's because I stripped this code from another code and left what the previous code had. Don't be a prisoner. No war. The inaccessible_trigger is to disable this option for other events. For example I think if you go on a pilgrimage, it would disable this option. I didn't care, so I left it. Probably bad coding practice and form, but whatever.
effect = {
character_event = { id = LIO.200 } So when the decision is clicked, the code then recalls LIO.200 which we coded in Part 1. That event will then play out.
In the end we created the decision that will play our event and give us the artifact in game. This concludes Part 3.

################## Edited ##########################################
#Collect a plant
lio_collect_a_plant = {
only_playable = yes
potential = {
society_member_of = lion
#society_rank >= 1 # Not needed because obviously you will be =>rank 1 when you join.
is_playable = yes
OR = {
is_feudal = yes
is_tribal = yes
is_nomadic = yes
}
prisoner = no

}
allow = {
war = no
prisoner = no
NOT = { is_inaccessible_trigger = yes }
custom_tooltip = {
text = is_not_busy_trigger_tooltip
hidden_tooltip = { NOT = { has_character_flag = do_not_disturb } }
}
}
effect = {
character_event = { id = LIO.200 }
}
revoke_allowed = {
always = no
}
ai_will_do = {
factor = 1

}
}

#### Edited ###

Part 4. Code was added to: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\localisation\lion.csv, this is the file that has descriptions as shown in game for artifacts and options, and it also has the text for any pop-up messages from game events.

EVTDESC_LIO_200 this might not do anything, but I have it apparently.
EVTDESC_LIO_200_desc;Collect a plant.;;;;;;;;;;;;;x I believe when you put your cursor over the intrigue option, the tool tip will pop-up saying Collect a plant
EVTDESC_LIO_200;While on a walk you notice an unusual plant just beyond a powerful stream.;;;;;;;;;;;;;x This is the text in the pop-up message which give you the two options...
EVTOPTA_LIO_200;Risk life to collect the plant.;;;;;;;;;;;;;x This is option A, with the text Risk life... the plant.
EVTOPTB_LIO_200;Too risky.;;;;;;;;;;;;;x This is the text shown to click on for option B.
lio_collect_a_plant;Collect a rare plant.;;;;;;;;;;;;;x More tool tip options... i think.
lio_collect_a_plant_desc;Gather plant;;;;;;;;;;;;;x More tool tip options... i think.

#Artifacts below here
lio_plant;A rare plant;;;;;;;;;;;;;x This is the text shown to describe the artifact within game, so I could read A rare plant when I put my cursor over the artifact.

#decisions below here
collect_a_plant_desc;Collect a plant.;;;;;;;;;;;;;x I think this is the text for the intrigue option. The previous was for the tool tip, this is now what is listed as the decision.

When the decision is clicked (Part 3), it activates the event (Part 1), which recalls and generates the artifact (Part 2), to put into your inventory. The text and descriptions for the choices and the artifact are located in this .csv file, (Part 4). This concludes Part 4.

#events below here
EVTDESC_LIO_200
EVTDESC_LIO_200_desc;Collect a plant.;;;;;;;;;;;;;x
EVTDESC_LIO_200;While on a walk you notice an unusual plant just beyond a powerful stream.;;;;;;;;;;;;;x
EVTOPTA_LIO_200;Risk life to collect the plant.;;;;;;;;;;;;;x
EVTOPTB_LIO_200;Too risky.;;;;;;;;;;;;;x
lio_collect_a_plant;Collect a rare plant.;;;;;;;;;;;;;x
lio_collect_a_plant_desc;Gather plant;;;;;;;;;;;;;x

#Artifacts below here
lio_plant;A rare plant;;;;;;;;;;;;;x

#decisions below here
collect_a_plant_desc;Collect a plant.;;;;;;;;;;;;;x

Part 5. We coded for the artifact, yet remember we had a picture image lio_plant that the artifact would show. We now add 2 to: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\gfx\interface\inventory\artifacts
These images were the images I show in the previous post of the venus flytrap as the lombardy crown. Read it for tips on how to make it. I just added those two file, one regular, and one small because artifacts have a small in the inventory, and a big image when you click them for closer examination~ Just dragged and dropped them into the folder. From the code, the code will then recall these images to be displayed in game. This concludes Part 5.

lio_plant.dds
lio_plant_small.dds

Part 6. A txt file was created and added as: ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\interface\lion.gfx. This is the sprite file. If you don't include this code, you may get a red X or grey X instead of your image. I know this has been a problem for others, and it was a problem for myself as well. But I did track down the file and was like what is this junk. I then learned more about it. This file has code that tells other codes where to go for the images. In my previous example the lombardy crown already was mapped and that is why my image appeared, so I got lucky. When I went to create this event and the new artifact with a different name, the code wasn't there to handle the different name. Yet when I tested with lombardy crown name, it worked. I renamed the lombardy crown and it gave the red (X) or grey (X) so I knew it wasn't an image format problem, there must have been code missing. Sure enough it was this sprite file, the pain and downfall of probably a many coders.

At this file location I created a .txt file named lion. I placed the follower code into it. the code is what it it, the name tells the name of the files and that is it an image to be recalled by code. The texturefile gives some location details to recall the image... I guess. Almost forgot, I changed the name of this text file from lion.txt to lion.gfx. BOOM, that converted it to the format the game could read. Coding is all magic anyway, am I right? This maps for coding purposes the image we created and added to the game, so that code knows how to recall the image later for use in the game. This concludes Part 6.

###Sprite files to make images work###
spriteTypes = {


############Items############
spriteType = {
name = "GFX_lio_plant"
texturefile = "gfx\\interface\\inventory\\artifacts\\lio_plant.dds"
}

spriteType = {
name = "GFX_lio_plant_small"
texturefile = "gfx\\interface\\inventory\\artifacts\\lio_plant_small.dds"
}
}

Conclusion:
When the decision is clicked (Part 3), it activates the event (Part 1), which recalls and generates the artifact (Part 2), to put into your inventory, with images (Part 5), images which are mapped out for the code (Part 6). The text and descriptions for the choices and the artifact are located in this .csv file, (Part 4).

This generated the first playable feature in the game. The members of The Botanical Society can now collect a plant and have a neat plant in their inventory. The plant does absolutely nothing beyond display. Perhaps vikings can steal it later. But at this time, does absolutely nothing. This also taught me my first event, how to make images and them to work, artifacts, and so forth which was one of the main concepts behind this society, plant collecting. I hope this instructional will help other wishing to create and obtain treasures in their mods in future CK2 games to come!

Thanks for looking. I hope I didn't forget anything, which I might have. Have any problems do let me know and I will try to fix or explain better.

Future projects:
Elaborate on the events and society so I can do more.
Maybe change this decision event to a random chance event or a society mission the boss Curators want.
Fix the image sizes.
Clean the code. I think all code could be its own file rather than me editing and adding code to the files that already exist. Probably good coding 101, but I grew up on the streets of coding and do it rogue, disobeying the laws of the coding world, I'm my own grandpa and I do my own stuff, I live my life and do what I want because I am the KING!- what was that Mom?! I'm busy coding for a game! I'll take out the trash later! What was that! I can't hear you! I'll do it later! I can't hear you! -o geez people, got to go do some chores, stay tuned for the next episode~
 
Last edited:
You had it right when you said say it was 118 and 59 for the artifacts pictures. The plant image you posted above is 143 per 139 pixels. This is why it doesn't fit.

Also, unless I misunderstand, you say you didn't find a plant picture for artifact (unless you did and simply didn't like the branch)? There is a picture of a plant (2 color variations, named "branch_of_the_cypress_of_keshmar" and "haoma_sapling")

And a last point, even if your society seem to be in working order, you may be interesting in this. I made this new society for the exact purpose of helping people learn what file to touch. It doesn't contain any of the "trading and flavor" of my trade league mod, only the basics to make it work with a lot of comments.
 
Thank you to the Master himself Maal for his reply and help!
You were correct about the image size, I knew the image size but saved incorrectly. I was able to make the fix. Your comment helped me ID the problem faster.
Thank you for the plant pictures for artifacts. I didn't search every picture and that cypress image is pretty good. I didn't know before, now I do.
Yes the tutorial society is great! I've finally gotten time to look around at it.

I am starting to try to move little by little my files into their own file rather than inserting them into previously made files. This was a noobie action and it took me time to understand why.

I have been trying to:
Make the society background. I don't know where to use the name = "GFX_society_main_background_lion" statement or where I can recall it to work in game. See below for details.
For the background:

I created the background by just editing Maal's tutorial society and saving that file. So I think it is the correct size. society_bg_lion.dds
I placed it into the ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\gfx\interface\societies folder, the image holding folder.
In the ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\interface I added to my lion.gfx file the following code, this file is the sprite file.
############Society############

spriteType = { #the background of the society menu
name = "GFX_society_main_background_lion"
texturefile = "gfx\\interface\\societies\\society_bg_lion.dds"
}
Now I am stuck and don't know what to do. I don't know where to use the name = "GFX_society_main_background_lion" statement or where I can recall it to work in game.
 
It should work automatically. Like you don't need to link traits to the GFX, the game will automatically search for GFXs with the name "GFX_society_main_background_"+society name and so on for the society GFX.

The only files in my trade mod that have the word "GFX" are the artifact one (you have to link them unlike traits), the events file for the borders/event pictures, the society_rank_gfx in the society file (and I used the generic one, not one that I made) and the GFX file itself of course.
 
Thank you Maal! Following the artifact example messed me up. The artifact requires a link for the images to work. The code for background and decision seem kind of built in. I was creating all sort of code variations. Once I read your post, I kept it simple and it worked. I want to say your work has helped me. A simple snag can stop me in my tracks, but I try to put in the effort to figure it out on my own first. I only ask for aid after hours of being stuck. Again I am no coder, just some noobie. But once I saw the tutorial society posted, I was excited!

Objectives:
1. Create a society background.
2. Image for the decision icon for the single thing that can be done within this society at this time
Through interest, the leader in custom societies posted a "tutorial" template. This was of great help. Thank you Maal!

#1. I created the background by just editing Maal's tutorial society and saving that file. Already the correct size. society_bg_lion.dds
I placed it into the ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\gfx\interface\societies folder, the image holding folder.
In the ...\Documents\Paradox Interactive\Crusader Kings II\mod\lion\interface I added to my lion.gfx file the following code, this file is the sprite file.
############Society############

sprite Type = { #the background of the society menu
name = "GFX_society_main_background_lion"
texturefile = "gfx\\interface\\societies\\society_bg_lion.dds"
}
Now I am stuck and don't know what to do. I don't know where to use the name = "GFX_society_main_background_lion" statement or where I can recall it to work in game. So I thought. This is the link. In the sprite file, the "texturefile" points out the location. The name points out the link "lion" as the tag identifier. "main_background" is already understood as the need for the background of the society. "society" identifies this is for the society. "GFX" identifies this is for an image. All together, the name says this image, for a society, for a society background, is for the society known as lion within the code.


#2. Again for the decision icon, it is performed similarly.
I used an already made game image for the hermetic society.
Within the lion.gfx file I placed the following code:
############Decisions############
spriteType = {
name = "GFX_lio_collect_a_plant"
texturefile = "gfx\\interface\\decision_icon_aquire_ingredients.dds"
}

The "link" for this code is already in the decision code, for my file, located at lion_decisions.txt:

#Collect a plant
lio_collect_a_plant = {
only_playable = yes
potential = {
society_member_of = lion
#society_rank >= 1 # Not needed because obviously you will be =>rank 1 when you join.
is_playable = yes
OR = {
is_feudal = yes
is_tribal = yes
is_nomadic = yes
}
prisoner = no

}
allow = {
war = no
prisoner = no
NOT = { is_inaccessible_trigger = yes }
custom_tooltip = {
text = is_not_busy_trigger_tooltip
hidden_tooltip = { NOT = { has_character_flag = do_not_disturb } }
}
}
effect = {
character_event = { id = LIO.200 }
}
revoke_allowed = {
always = no
}
ai_will_do = {
factor = 1

}
}

I made the link red between the two files.

The cursor doesn't show up, but I have it pointed at the "Collect a rare plant" so the tip pop-up says "Gather plant". The little rectangle icon to the left is what we accomplished. 6 hours for all that because I followed the artifact example. I was including and making up all sorts of code. Another Thank You to Maal for his help! Maal responded faster than many cable companies or government agencies I contact, and yeah I just posted not message him directly. The guy is on fire.
Today we accomplished putting an image in the decision of the intrigue tab for our event. We also added a society background. Through this we learned some images are linked sort of simpler than that of artifact files. I learned a lot about coding in the game, and a lot more about myself.

The society images for the background were taken from the Munich Golden Psalter available online. I guess, this psalter, is an "illuminated" work meaning it has images aka drawings or pictures. In this case gold leaf in some cases. Selected scenes from the Bible were used. The work has been dated between 1200 and 1225, well within CK2 time frame. Yes not the oldest, but I think acceptable.

Thank you for your interest and reading. Have a Great day!
 

Attachments

  • upload_2017-8-19_1-2-44.jpeg
    upload_2017-8-19_1-2-44.jpeg
    98,6 KB · Views: 6
And I noticed in your screenshot that I somehow deleted the localization for the society name... Whelp, time to update the mod.
 
The tutorial society mod has been useful. Thank you Maal for the help!

For this post I create a character. The character comes with an artifact.

Edited the decision.txt
Edited the events.txt
Edited the localization.csv

Edited the decision text file:
Code:
###Create Character###
lio_create_character = {            #this is the name of the decision. I must also edit the localization .csv for the descriptions.
       only_playable = yes
       potential = {
           society_member_of = lion   #this indicates you must be a member of the society to see this option.
           #society_rank >= 1 #  Not needed because obviously you will be =>rank 1 when you join.
           is_playable = yes
           OR = {
               is_feudal = yes
               is_tribal = yes
               is_nomadic = yes
           }
           prisoner = no
  
       }
       allow = {
           war = no
           prisoner = no
           NOT = { is_inaccessible_trigger = yes }
           custom_tooltip = {
               text = is_not_busy_trigger_tooltip
               hidden_tooltip = { NOT = { has_character_flag = do_not_disturb } }
           }
       }
       effect = {
           character_event = { id = LIO.900 }        # LIO.900 is the link to the event in the event text file that will play when this decision is selected.
       }
       revoke_allowed = {
           always = no
       }
       ai_will_do = {
           factor = 0
          
       }
   }
What this does is create an option in the intrigue tab. Once clicked, it runs the following event
Edited the event text file:
Code:
character_event = {
    id = LIO.900
   desc = EVTDESC_LIO_900
   picture = "GFX_lio_acquire_ingredients_decision"   #this is buggy and doesn't do anything or work.
  
   is_triggered_only = yes

   option = {
       name = EVTOPTA_LIO_900       #this will review an edit in the localization .csv for the description.
               create_random_priest = {   #I used the priest option, but there are others. This section defines some details of the character.
                   random_traits = yes
                   dynasty = none
                   female = yes
                   age = 28           #Can this be random or set with a min and max?
               }
               new_character = {       #I couldn't figure out a more straight forward way. So this new character gets saved as a target.
                   save_event_target_as = appeared_recruit
               }
              
       event_target:appeared_recruit = {               #The target is then given the artifact here. Is there an easier way?
               add_artifact = lio_plant               #lio_plant is the name of the artifact
               }
       ai_chance = {
           factor = 0                   #I chose 0 because I never want the ai to do this. Maybe thats how this works.
       }
   }
   option = {
       name = EVTOPTB_LIO_900       #This will review an edit in the localization .csv for the description.
       ai_chance = {               #I read somewhere always have an ai option even if you never want the ai to perform the action. This is to prevent bugs.
           factor = 2
           modifier = {
               factor = 10
               has_artifact = lio_plant
           }
       }
   }
}
This runs the event and you can chose to recruit or not. Once clicked to recruit, a character appears in the court. That new character has within their treasury the artifact, a rare plant.
This is the localization csv additions:
Code:
#create character
EVTDESC_LIO_900
EVTDESC_LIO_900_desc;Recruit a subject.;;;;;;;;;;;;;x
EVTDESC_LIO_900;Welcome to the team!;;;;;;;;;;;;;x
EVTOPTA_LIO_900;Find them!;;;;;;;;;;;;;x
EVTOPTB_LIO_900;Too risky.;;;;;;;;;;;;;x
lio_create_character;Recruit a subject.;;;;;;;;;;;;;x
lio_create_character_desc;Find them!;;;;;;;;;;;;;x
# Explained - this code gives the descriptions if you move your mouse over the item and a pop-up tip says something. It also puts the text for the message and the options you can click on.
What did we accomplish? Now when I join the society, I can click in the intrigue menu an option to recruit a character. That character comes equipped with a rare plant.

Future goal: I want to make an event that will give an artifact to a random member in the society. I tried with this code but it isn't working.
Code:
###Give a plant to a random character###
character_event = {
    id = LIO.201
   #desc = EVTDESC_LIO_201   #for the ai so probably not needed. #window hidden anyway so not needed.
   hide_window = yes
      
   is_triggered_only = yes
   any_character {               #here I am not sure if any_character is the way to go. I read this can overwork the computer and is inefficient.
       limit = { is_in_society = lion }
   }

   option = {
           add_artifact = lio_plant
       }
               ai_chance = {
           factor = 0
       }
   }
I'd like to make the event to give a single random member the artifact.
I'd also like to know how to make the event where I can give all society members the artifact.
Any help is appreciated!

Thanks for looking. Have a nice day!
 
Your event doesn't work because it is hidden, but it only do something if you press the button. And the any_character doesn't do anything alone like that inside of nothing with nothing inside of it but the limit.

For the event to give a random member an artifact, look at the mission tombala event in the tutorial society, there are lines to target a single random member early in it, which is much lighter than targeting everybody.

If you want to spoil yourself the answers:
For the random member
Code:
character_event = {
    id = XXX.123
    hide_window = yes
 
    is_triggered_only = yes

    trigger = {
        society_member_of = your_society
        other trigger you would like
    }

    immediate= {
        random_society_member = {
            add_artifact = item
        }
    }
}
For give to all members
Code:
character_event = {
    id = XXX.123
    hide_window = yes
 
    is_triggered_only = yes

    trigger = {
        society_member_of = your_society
        other trigger you would like
    }

    immediate= {
        any_society_member = {
            add_artifact = item
        }
    }
}
Do note that I have no tried these line myself, but they should work.
Just trigger these event with a decision, yearly on_action, event... Do add "AI = no" if you only want the player to do it in the pre-trigger. Also, add at the end a global or normal flag and "NOT = { has that flag }" like trigger if you want it to be one time only. If you simply want a cooldown add a hidden character modifier with a timer and a NOT = { has that modifier } in the trigger.
 
Thank You Maal! I saw your post and thought, I will try and do it myself again. I had already spent 4 hours on various tests. So I didn't look at the spoiler. I spent more time on it. 2 hours. Got tired and off to bed. Next morning, said lets do this now with a fresh mind. Another 2 hours. I said man forget this, I'm going to the cheat sheet. I THEN looked at the spoiler.

Before going to the spoiler, I tried all sorts of crazy codes. This was one of them:
NOTE THIS IS HORRID CODE DO NOT LOOK AT FOR ANY COMPARISON IT IS JUNK I TELL YOU ABSOLUTE JUNK
Code:
character_event = {
    id = LIO.201
    hide_window = yes

    is_triggered_only = yes
  
   is_in_society = yes

   trigger = {
       society_member_of = lion
       NOT = { has_character_modifier = quest_cooldown_timer } #to avoid spam and delay it for people who refused a quest.
       NOT = { is_inaccessible_trigger = yes }
       prisoner = no
       society = { #look for a close member to give you the quest
           any_society_member = {
               NOT = { character = ROOT }
               prisoner = no
               is_within_diplo_range = ROOT
               opinion = { who = ROOT value = 0 }
           }
       }
   }

    immediate = {
       #Picks out mission giver
               society = {
                   random_society_member = {
                       limit = {   
                           NOT = { character = ROOT }
                           prisoner = no
                           is_within_diplo_range = ROOT
                           opinion = { who = ROOT value = 0 }
                           same_realm = ROOT
                       }
                       save_event_target_as = qst_planted
                       event_target:qst_planted = {               #The target is then given the artifact here. Is there an easier way?
                           add_artifact = lio_plant               #lio_plant is the name of the artifact
                       }
                   }
               }
           }
       }
Yeah it didn't work. This wasn't the longest. I tried a version that picked a quest giver, then would go to ANOTHER event that would give the artifact out. It had problems and didn't work. That is what killed me. I said to myself an event to make another event is insanity. I went to Maal's spoiler who had the answers.

This is the code that worked. Thanks again to Maal who had all the stuff I needed.
Code:
###Give a plant to a random character###
character_event = {
    id = LIO.201
    hide_window = yes
    is_triggered_only = yes

    trigger = {
        society_member_of = lion
    }
    immediate= {
        random_society_member = {
           limit = {
               society_member_of = lion
           }
            add_artifact = lio_plant
        }
    }
}
"random_society_member" will pick a character in any society. So all sorts of societies were getting members that would get the artifact. I then worked with "limit = { }" and tried it a few different ways. After the random_society_member, then you put the limits. This is what I wanted and needed. Now this can be used for other stuff. So far I use intrigue decisions to click to start the events.

Why i think think code was cool. I could cause an event where a random society member discovers a plant. The quest then has me ask the member for a "division" or copy of the artifact. Or simpler, after I complete a quest to discover a plant, I then have to give a copy of the artifact to another society members. Every now and then a society member could discover a plant, then will give a plant to another member. So as we as a society find plants, we will start spreading these plants to each other. Sort of like what a real botanical society would do. Well a man can dream... if the dream is coded properly.

With that code, I can change the "limit to society_member_of = the_satanists" and click away and it gave plants to random devil worshipers. Then I could go into the search, search the artifact, and everyone with the artifact I know is a devil worshiper. If I wanted, I could create a new artifact, name it briars of the devil, that spawns on devil worshipers. Anyway, it was really neat to see how many around the realm were these evil people and how much corruption is going on. Something like this can be used for a daemon hunter society. You join the society. Quest to expose a random devil worshiper society member, then later you get a quest to drive a stake through their heart (naturally with a chance to fail), and then claim his decapitated head for your wall at your holy church or whatever have you. I hate devil worshipers. Also throw in master seducers as I hate those guys just as much as I do devil worshipers. Only thing the seducers have is the honor of not hiding. But having my cousin, who is a seducer, impregnating all my other cousins and relatives is just screwed up. The daemon hunters are needed to cleanse these people too. I do not need help on this, I was just mentioning the potential. Just some thoughts. It is neat code. Is there a forum post where people place examples of some neat code? If not maybe I will make one.


What we accomplished, an event that gives a random member of the society an artifact.