Jump to content

CK2 Modding Quick Question Thread


Recommended Posts

I figure the way to encourage more folks to try their hand at modding is to make it as easy as possible for their questions to get answers. I don't have all the answers, but there is always someone who does, or knows where they are.

 

So let this be the place where we do that! #HopeThisIsntOverzealous

Link to comment

The "Portrait Builder" is a neat tool.  It lets you design DNA and Properties for new characters without having to jump in and out of the game to see how a character will end up looking.  Saves time, and time saved equals code completed.

 

http://www.ckiiwiki.com/Portrait_Builder

 

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

 

Another fantastic tool is "The Validator."

This one will go through your code and show you the errors that you've made.  I always make a few no matter how careful I am, but this catches them before I release/playtest and I can correct them rather than having some eagle eyed person point them out to me and then feeling like a dunce.  =)

 

https://forum.paradoxplaza.com/forum/index.php?threads/the-validator-find-errors-quickly-and-with-minimal-pain.597480/

 

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

 

Static Portraits

 

ReMeDy "the Great and Powerful" created a static portrait template that can be used by those who have the notion to include static portraits in their mods..  With the request being that credit be given.  (I just found this so I'm digging into it right now.)

http://www.loverslab.com/topic/52211-ck2-static-portrait-replacer-ver-301-ckii-261-263-compatible-now-supports-unlimited-portraits/

 

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

Link to comment

I tried. Really tried to do simple event quest.

Failed miserably. To be honest... I absolutely don't understand scripting.

 

On the other hand... I observed some lack of trait icons. They are quite needed... And if modders wants icon, he has to make it himself. Or borrow icons from other mods.

 

May I ask... do any of you know links for trait icon modding, tools or guides how and what to do?

 

And if it's possible to create icons from phone (sometimes my laptop is messing up, so my phone is more reliable).

Link to comment

Oh, cool!

Whatever... You say?

 

I think... first I'll try to do recolors of all vanilla traits and after that custom traits.

But first I have to visit Google store for possible apps.

I guess it's going to be hell to work it out on the phone.... but in end it's worth it.

Anyways, thank You!

 

EDIT: Is this correct and usable as trait icon? If you guys can test it out ingame. Because if yes... I will start doing some traits ^^

s_heart_icon.zip

Link to comment

Traits are kind of hard for those who like me can't into pixel art.

 

As for tools for scripting,sometimes instead of writing repetitive code I write a script to write it form me. For example, to link a trait definition to a trait icon you need a definition in a .gfx file in the interface folder, and the same with evemt pixtures and basically almost every graphic asset. So I write a very basic and possibly unpythonic python script to look for the ixon names and generate the gfx definitions. Nothing fancy. But there is nothing that'll write non-trivial code for you.

 

For learning script, the best advice I can give is start small, modifying already existing evsnts. Validator is your friend, have it accessible. And have a text editor like notepad++ or sublime that does bracket matching. 80% of mewcomers errors are mismatched brackets. Other than that check the ckiiwiki for scripting, nd from there go where you need.

 

Hell, post your failed event here and maybe we can make it work!

Link to comment

Traits are kind of hard for those who like me can't into pixel art.

 

As for tools for scripting,sometimes instead of writing repetitive code I write a script to write it form me. For example, to link a trait definition to a trait icon you need a definition in a .gfx file in the interface folder, and the same with evemt pixtures and basically almost every graphic asset. So I write a very basic and possibly unpythonic python script to look for the ixon names and generate the gfx definitions. Nothing fancy. But there is nothing that'll write non-trivial code for you.

 

For learning script, the best advice I can give is start small, modifying already existing evsnts. Validator is your friend, have it accessible. And have a text editor like notepad++ or sublime that does bracket matching. 80% of mewcomers errors are mismatched brackets. Other than that check the ckiiwiki for scripting, nd from there go where you need.

 

Hell, post your failed event here and maybe we can make it work!

It isn't all about failed events, you know. Modder should also like, what is he doing.

I tried scripting and writing down for several hours. And... imagine to do this for hours and hours isn terrifying. It's not just my cup of coffee. Plus, I already (honestly from rage), deleted that event "mod".

 

Hmmmm, about traits. Well, without pixel art knowledge it's hard to do, but people are lazy... Or curious. Or creative. Thanks to some websites, it's possible to pixelize pictures and symbols. Quite amazing

But first I have to know, if my first created icon is working..

From there I can start to create mod icons, at least.

So far, I was just suggesting ideas. I still do.

Link to comment

Just my 2 cents:

 

modding in CK2 is really simple, if you have basic knowledge of coding of course.

All the mod logic goes into simple plain .txt files (usen ANSI encding, UTF-8 can't be handled by the CK2 engine very good, there you see how told the game is XD )

localisation is also simple text (yeah, I know, its a .csv file, but it just contains text)

Art is something different. Here you actually might need some advances tools, like photoshop or paint.net. Note, that even if the orginal artwork is in .dds format, .png and .tga should also work, but might slow down the game.

The wiki on CK2 modding is also relativly good for a modding wiki, explaining all the necessary stuff and contains lists of all usable flags and Keywords you can use. It also contains a few overall tipps for performance and some simple examples.

They also tell you how to structure your mod, and the overall folder structure which is needed to make your mod work.

Link to comment
  • 3 weeks later...

A very quick way of doing samesex marriage would be to create a targeted decision. Something like this, which will force a marriage between yourself and your lover. This is more like a cheat decision or something since it lacks any kind of flavour or choice on the part of the target, I personally would expand on it with additional events and so on but that's all up to you.

 

I'm not entirely sure but I seem to recall something in CK2's dev notes about samesex couples no longer producing offspring, so that's a bonus; no need for a trait or modifier to zap fertility in samesex couples anymore.

 

 

I didn't test that decision, just wrote it off the top of my head.

Link to comment

Is there a way to get homosexual marriages? I remember a mod a while ago that could force it, but don't remember what it was, or how it did it.

 

Just realize there is an issue with this where the game gets 'confused' as to which dynasty to place the child when there are two mothers.  So you may have to use the corresponding 'correct dynasty' decision more often then not to drop it back under your ruler if playing a female character.  I haven't seen it tested nor have I tried it but I've wondered if setting up a Matralineal marriage decision would fix it with the situation of two females.

Link to comment

Localisation isn't working because the folder isn't named correctly.  It's misspelled as Lolalisation.  Correct that and you're Localisation tags should start working.

 

In your localisation code you have... 

##CODE;ENGLISH;FRENCH;GERMAN;;SPANISH;;;;;;;;;x
#CODE;ENGLISH;;;;;;;;;;x
#Event Titles
pervmod_spending_time_with_target;Spending time with your lover;;;;;;;;;;x
#Event Descriptions
pervmod10A;I cum inside.;;;;;;;;;;x
pervmod10B;I cum outside.;;;;;;;;;;x

Another issue is that your decision name is "pervmod_spend_time_with" NOT "pervmod_spend_time_with_target"  so while localisation for your event title is present, nothing is present for localisation of the actual decision.  To add that information we do this...  ((NOTE: The event will work just fine without having localisation for the decision, or with a description, but I just wanted to show you what options you have.))

##CODE;ENGLISH;FRENCH;GERMAN;;SPANISH;;;;;;;;;x
#CODE;ENGLISH;;;;;;;;;;x
#Decision Names & Descriptions
pervmod_spending_time_with;Spend time with your lover;;;;;;;;;;x
pervmod_spending_time_with_desc;INSERT A DESCRIPTION THAT POPS UP WHEN YOU HOVER OVER THIS TARGETED DECISION!;;;;;;;;;;x
#Event Titles
pervmod_spending_time_with_target;Spending time with your lover;;;;;;;;;;x
#Event Descriptions
pervmod10A;I cum inside.;;;;;;;;;;x
pervmod10B;I cum outside.;;;;;;;;;;x

That should take care of your localisation issues.  

 

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

 

In the rest of your code I notice you're using a "tab" rather than a single space between everything.  See your decision secion "Potential" below... 

		potentional	=	{ # Who it is used on.
			OR	=	{ # Should be wife, concubine or lover.
				any_spouse	=	{
					character	=	FROM
				}
				any_consort	=	{
					character	=	FROM
				}
				is_lover	=	FROM
			}
		}

I don't know if this will cause an issue or not but if you remove those tabs and instead replace it with spaces it might fix issues.  The main problem here is that "POTENTIAL" is mis-spelled and is written as "potentional."

Link to comment

I'm using TAB's instead of spaces since that is the official paradox indentation style, and I feel slightly stupid that it was just misspellings...

 

("Indent properly to easily spot unclosed curly braced. Vanilla uses 1 tab for indentation rather than spaces." from modding guidelines)

 

Thanks so much for the detailed breakdowns! Sorry for wasting your time with some simple misspellings, I even proofread them, I'm going to blame me being ill for making mistakes l like these.

 

Link to comment

I'm using TAB's instead of spaces since that is the official paradox indentation style, and I feel slightly stupid that it was just misspellings...

 

("Indent properly to easily spot unclosed curly braced. Vanilla uses 1 tab for indentation rather than spaces." from modding guidelines)

 

Thanks so much for the detailed breakdowns! Sorry for wasting your time with some simple misspellings, I even proofread them, I'm going to blame me being ill for making mistakes l like these.

 

I made far more silly mistakes when i started. Embarrassing enough that I wont elaborate further on them!  Don't feel bad at all, and don't give up.  We need more mods and more mod authors!  

 

There is absolutely a place for whatever you have to offer, even if you make it and keep it all to yourself.

Link to comment

I added some more events for MM, FM, FF, these all worked.
 
Then I tried to add a 30 day cooldown, but here it goes wrong. I can no longer use the "spend time with" decision, it has 3 empty conditions that are checked with a red X.
 
I'm not sure what I'm doing wrong, could you take a look? Thanks so much in advance, and for helping me in the past.
 
Also, how would I add a minimum age for the "Seduce" right click decision to 14? adding "min_age = 14" under the "#is_marriage_adult = yes" seems to disable the decision entirely.
 
What I have now (in 'way_of_life_decisions.txt'):

        seduce_decision = {
                only_playable = yes

                ai_target_filter = self # Disable AI using seduction.

                from_potential = {
                        is_playable = yes
                        is_marriage_adult = yes
                        #has_focus = focus_seduction
                        NOT = { trait = incapable }
                        prisoner = no
                        NOT = { has_any_opinion_modifier = opinion_seducing }
                        OR = {
                                ai = no
                                AND = {
                                        OR = {
                                                is_female = no
                                                AND = {
                                                        trait = homosexual
                                                        OR = {
                                                                is_married = yes
                                                                is_consort = yes
                                                        }
                                                }
                                                trait = lustful
                                                any_spouse = {
                                                        trait = homosexual
                                                }
                                                any_consort = {
                                                        trait = homosexual
                                                }
                                        }
                                        is_ill = no
                                        NOT = { trait = eunuch }
                                        NOT = { trait = infirm }
                                        NOT = { trait = inbred }
                                        NOT = { trait = imbecile }
                                        NOT = { trait = chaste }
                                        NOT = { trait = shy }
                                }
                        }
                }

                potential = {
                        #is_marriage_adult = yes
                        NOT = { character = FROM }
                        NOT = { trait = incapable }
                        prisoner = no
                        NOT = { is_lover = FROM }
                        NOT = { is_former_lover = FROM }

                        NOT = { is_consort = FROM }
                        NOT = { any_spouse = { character = FROM } }

                        #OR = {
                        #       AND = {
                        #               NOT = { is_child_of = FROM }
                        #               NOT = { mother_even_if_dead = { is_child_of = FROM } }
                        #               NOT = { father_even_if_dead = { is_child_of = FROM } }
                        #               FROM = {
                        #                       NOT = { is_child_of = ROOT }
                        #                       NOT = { mother_even_if_dead = { is_child_of = ROOT } }
                        #                       NOT = { father_even_if_dead = { is_child_of = ROOT } }
                        #               }
                        #       }
                        #       AND = {
                        #               religion_group = zoroastrian_group
                        #               FROM = { religion_group = zoroastrian_group }
                        #       }
                        #       AND = {
                        #               religion = messalian
                        #               FROM = { religion = messalian }
                        #       }
                        #}

                        OR = {
                                AND = {
                                        FROM = { NOT = { trait = homosexual } }
                                        NOT = { trait = homosexual }
                                        NOT = { same_sex = FROM }
                                }
                                AND = {
                                        FROM = { trait = homosexual }
                                        trait = homosexual
                                        same_sex = FROM
                                }
                        }
                }

                allow = {
                        NOR = {
                                has_opinion_modifier = { who = FROM modifier = opinion_seduced_refused }
                                has_character_modifier = dismissed_proposal
                        }
                        NOT = { trait = celibate }
                        NOT = { FROM = { trait = celibate } }
                        OR = {
                                religion_group = FROM
                                is_liege_or_above = FROM
                        }
                        is_within_diplo_range = FROM
                }

firstmod.zip

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use