Jump to content

CK2 Modding Quick Question Thread


Recommended Posts

1 hour ago, Rascalov1337 said:

Is this correct usage of "if" statement?

Validator doesn't complain, but i still want to check if i understood it right.

 

Is this possible to compress these decisions in one or two by using similar structure, and if yes: Is it even worth it, or i can keep them separate without any problems (perfomance, etc.)?

 

Yes, mostly.

 

Yes.

Link to comment
12 minutes ago, Rascalov1337 said:

Oh, good. Is there any point in combining those decisions in one, or they are fine as is?

Less localisation you need to write? As long as you have the potentials correct, the others wont show up and clog up the decisions screen, so there's really no point unless you are OCD like me and want to keep things together.

Link to comment

I have created a new decision under the intrigue interface tab. It shows up with its picture and with the green check mark. However, when I click on the button nothing happens.

I have tested the narrative_event the decision should trigger in the console and get the following error message: "shape_size (9468) is less than 1". The event itself has no picture.

Anyone no what this means?

Link to comment
51 minutes ago, joemann said:

I have created a new decision under the intrigue interface tab. It shows up with its picture and with the green check mark. However, when I click on the button nothing happens.

I have tested the narrative_event the decision should trigger in the console and get the following error message: "shape_size (9468) is less than 1". The event itself has no picture.

Anyone no what this means?

That's not a whole lot to go on unless you provide the code to both the decision and event.

Link to comment

This is the decision;

 

Spoiler

rsl_visit_kennel = {
                            potential = {
                                        ai = no
                                        capital_scope = {
                                                    has_building = rsl_kennel
                                        }
                            }
                            allow = {
                                    is_adult = yes
                                    NOT = { trait = incapable }
                                    prisoner = no
                            }
                            effect = {
                                    narrative_event = { id = RSLB.100 }
                            }
                            revoke_allowed = {
                                        always = no
                            }
                            ai_will_do = {
                                    factor = 0 # ai should not be doing this
                            }
    }   

 

and this is the event:

Spoiler

narrative_event = {
    id = RSLB.100
    title = rsl_kennel    
    desc = RSLB100desc

    
    is_triggered_only = yes

    option = { #buy a fighting dog
        name = EVT_OPTA_RSLB100
        narrative_event = { id = RSLB.101 }
    }
    option = { #buy a pet dog
        name = EVT_OPTB_RSLB100
        narrative_event = { id = RSLB.102 }
    }
    option = { #buy a breeder
        name = EVT_OPTC_RSLB100
        narrative_event = { id = RSLB.103 }
    }
    option = { #changed my mind
        name = EVT_OPTD_RSLB100
    }
}

 

They are pretty basic,. Validator doesn't raise any issues either.

Link to comment

First time I try to create a new character. I have problems in adding custom traits and the static portrait.

 

The code is as follows:

 

Spoiler

narrative_event = {
    id = RSLBST.101
    title = fighting_dog
    is_triggered_only = yes
    picture = fighting_dog    
    desc = RSLBST101
        
    immediate = {
        host = {
             create_character = {
                name = "Wodan"
                age = 17
                culture = dog_culture
                race = dog
                religion = pagan
                attributes = {
                            martial = 8
                            diplomacy = 2
                            stewardship = 3
                            intrigue = 5
                            learning = 4
                }
                trait = regular_balls_dog
                trait = regular_knot
                trait = huge_dick_dog
                trait = regular_anus_dog
                trait = muscular_dog
                trait = shrewd
                trait = tough_soldier
                trait = gregarious
                trait = brave
                trait = cruel
                trait = wroth
                trait = stubborn
                female = no
                random_traits = no
                historical = no
                fertility = 3
                health = 1
                
                
                
                                
            }   
            new_character = {
                add_friend = root
                add_trait = portrait13
                set_character_flag = rsl_virginity_checked
                set_character_flag = balls
                set_character_flag = height
                set_character_flag = shape
                set_character_flag = butt
                set_character_flag = anus
                save_global_event_target_as = rsl_fighting_dog
                
                
                
            }
            
        }
    }
    
    option = { name = EVT_OPT_RSLBST101 }
    
}

 

Most of this works as planned but my custom traits do not appear, nor does the static portrait. I do get a vanilla dog portrait.

 

 

Link to comment

Did you code the trait in the /traits/ folder? Have you made an icon for the trait if it is not set to be hidden (filename HAS to be exactly the same as the trait name)? Have you assigned the trait an interface entry in /interface/traits/?

 

Trait:

blahblah = {
	customizer = yes/no # determines if it will appear in the Ruler Designer
	hidden = yes/no # determines if the trait is hidden from view
	random = yes/no # determines if created characters will get this trait randomly
}

Interface:

# Required for traits that are not hidden. Unecessary for traits that are.

spriteTypes = {
	spriteType = {
		name = "GFX_trait_blablah" # THIS PART IS NOT CUSTOMIZABLE! Traits MUST have GFX_trait_ at the start followed by the exact code name of the trait.
		texturefile = "gfx/traits/blahblah.tga" # Can be tga or dds
		noOfFrames = 1
		norefcount = yes
		effectFile = "gfx/FX/buttonstate.lua"
	}
}

Portrait interface:

 

	spriteType = {
		name = "GFX_portrait_blahblah" # Remember this name
		texturefile = "gfx/static_portraits/blahblahportraits.dds"
		noOfFrames = 27 # Number of 152x152 frames in the portrait file
		norefcount = yes
		can_be_lowres = yes
	}

    portraitType = {
        name = "PORTRAIT_blahblah_static" # Can be customized
		effectFile = "gfx/FX/portrait.lua" # REQUIRED
        weight = { # Determines when the portrait will be selected
            additive_modifier = {
                value = 100000   # Set to a high number if you always want the portrait to happen
                portrait_clothing = yes  # I have no fucking clue, but it's required.
				portrait_has_trait = blahblah # The portrait will only display if it has this trait
	 		}
        }

        layer = {  # Modifying the portrait layers so your portrait can be displayed properly
			"GFX_empty:p0"
			"GFX_empty:c0"
            "GFX_empty:c2"
            "GFX_empty:c3"
            "GFX_empty:c1"
            "GFX_empty:c4"
            "GFX_empty:p1:h:y"
            "GFX_portrait_blahblah:c5"  # Remember the name you set earlier? This is where it goes. c5 is the headgear frame. Remedy's portraits uses clothing frames to display portraits.
        }

        allow_property_values = {
            1 = {
				0  = { always = yes } # When you see this, it means it completely blocks the layer from ever triggering.
            }
            19 = {
				0  = { always = yes } # Safeguard from 3.0's new layers from hiding layer 5 (clothing, AKA the layer you're using)
            }
			33 = {
				0  = { always = yes }
            }
            34 = {
				0  = { always = yes }
            }
            35 = {
				0  = { always = yes }
            }
            36 = {
				0  = { always = yes }
            }
            5 = {
				0 = { always = no }  # Remember the number of frames in your portrait file? This is where those frames are individually set. It starts at 0 (i.e. if you have 14 frames, it goes from 0-13)
				1 = { always = no }
				2 = { always = no }
				3 = { always = no }
				4 = { always = no }
				5 = { always = no }
				6 = { always = no }
				7 = { always = no }
				8 = { always = no }
				9 = { always = no }
				10 = { always = no }
				11 = { always = no }
				12 = { portrait_has_trait = blahblah } # Where you set frame 14 of your portrait file
				13 = { always = no }
				14 = { always = no }
				15 = { always = no }
				16 = { always = no }
				17 = { always = no }
				18 = { always = no }
				19 = { always = no }
				20 = { always = no }
				21 = { always = no }
				22 = { always = no }
				23 = { always = no }
				24 = { always = no }
				25 = { always = no }
				26 = { always = no }
			}
		}
	}

 

Link to comment

Have been fiddling around with the static portrait  interface file and am a bit lost.

Spoiler

portraitType = {
        name = "PORTRAIT_static_fighting_dog"
        effectFile = "gfx/FX/portrait.lua"
        weight = {
            additive_modifier = {
                value = 1000000
                portrait_clothing = yes
                OR = {
                    portrait_has_trait = fighting_dog
                    portrait_has_trait = portrait313
                    portrait_has_trait = portrait314
                    portrait_has_trait = portrait315
                    portrait_has_trait = portrait316
                    portrait_has_trait = portrait317
                    portrait_has_trait = portrait318
                    portrait_has_trait = portrait319
                    portrait_has_trait = portrait320
                    portrait_has_trait = portrait321
                    portrait_has_trait = portrait322
                    portrait_has_trait = portrait323
                    portrait_has_trait = portrait324
                    portrait_has_trait = portrait325
                    portrait_has_trait = portrait326
                    portrait_has_trait = portrait327
                    portrait_has_trait = portrait328
                    portrait_has_trait = portrait329
                    portrait_has_trait = portrait330
                    portrait_has_trait = portrait331
                    portrait_has_trait = portrait332
                    portrait_has_trait = portrait333
                    portrait_has_trait = portrait334
                    portrait_has_trait = portrait335
                    portrait_has_trait = portrait336
                    portrait_has_trait = portrait337
                    portrait_has_trait = portrait338
                }
             }
        }

        layer = {
            "GFX_empty:c0"
            "GFX_empty:c2"
            "GFX_empty:c3"
            "GFX_empty:c1"
            "GFX_empty:c4"
            "GFX_empty:p1:h:y"
            "GFX_portrait_remedy_portrait_swapping:c5"
        }

        allow_property_values = {
            1 = {
                0 = { always = yes }
            }
            5 = {
                0 = { always = no }
                1 = { portrait_has_trait = portrait313 }
                2 = { portrait_has_trait = portrait314 }
                3 = { portrait_has_trait = portrait315 }
                4 = { portrait_has_trait = portrait316 }
                5 = { portrait_has_trait = portrait317 }
                6 = { portrait_has_trait = portrait318 }
                7 = { portrait_has_trait = portrait319 }
                8 = { portrait_has_trait = portrait320 }
                9 = { portrait_has_trait = portrait321 }
                10 = { portrait_has_trait = portrait322 }
                11 = { portrait_has_trait = portrait323 }
                12 = { portrait_has_trait = fighting_dog }
                13 = { portrait_has_trait = portrait = 325 }
                14 = { portrait_has_trait = portrait326 }
                15 = { portrait_has_trait = portrait327 }
                16 = { portrait_has_trait = portrait328 }
                17 = { portrait_has_trait = portrait329 }
                18 = { portrait_has_trait = portrait330 }
                19 = { portrait_has_trait = portrait331 }
                20 = { portrait_has_trait = portrait332 }
                21 = { portrait_has_trait = portrait333 }
                22 = { portrait_has_trait = portrait334 }
                23 = { portrait_has_trait = portrait335 }
                24 = { portrait_has_trait = portrait336 }
                25 = { portrait_has_trait = portrait337 }
                26 = { portrait_has_trait = portrait338 }
            }
        }
    }

 

Spoiler

narrative_event = {
    id = RSLBST.101
    title = fighting_dog
    is_triggered_only = yes
    picture = fighting_dog    
    desc = RSLBST101
        
    immediate = {
        host = {
             create_character = {
                name = "Wodan"
                age = 17
                culture = dog_culture
                race = dog
                religion = pagan
                attributes = {
                            martial = 8
                            diplomacy = 2
                            stewardship = 3
                            intrigue = 5
                            learning = 4
                }
                trait = regular_balls_dog
                trait = regular_knot_dog
                trait = huge_dick_dog
                trait = regular_anus_dog
                trait = muscular_dog
                trait = shrewd
                trait = tough_soldier
                trait = gregarious
                trait = brave
                trait = cruel
                trait = wroth
                trait = stubborn
                trait = portait12
                female = no
                random_traits = no
                historical = no
                fertility = 2
                health = 1
                
                
                
                                
            }   
            new_character = {
                add_friend = root
                set_character_flag = rsl_virginity_checked
                set_character_flag = balls
                set_character_flag = height
                set_character_flag = shape
                set_character_flag = butt
                set_character_flag = anus
                save_global_event_target_as = rsl_fighting_dog
                
                
                
            }
            
        }
    }
    
    option = { name = EVT_OPT_RSLBST101 }
    
}

 

 

I highlighted the stuff I changed but the portrait is still not showing.

 

 

Link to comment

Did that. Last question I hope: How do I get this picture

 

into this template

I have opened both files in GIMP and dragged the dog file into the template. It works in the sense that the dog file automatically fits into spot 13 but impossible to move it elsewhere. Adding another portrait only  replaces the first file, always in spot 13.

Link to comment
38 minutes ago, joemann said:

Did that. Last question I hope: How do I get this picture

 

  Reveal hidden contents

into this template

  Reveal hidden contents

I have opened both files in GIMP and dragged the dog file into the template. It works in the sense that the dog file automatically fits into spot 13 but impossible to move it elsewhere. Adding another portrait only  replaces the first file, always in spot 13.

Here, i've done it for you. Can't really help you with your GIMP problems, don't have much experience there, but from what i know, it kinda should add your picture to new layer and let you move it right away. At least it does that for me. Still, if you need more portraits in this template, i can put it together for you, i have some free time now

remedy_portrait_swapping.dds

Link to comment
6 minutes ago, joemann said:

Thanks for the fix and the offer, but I want to be able to do this myself. Did you use GIMP to do this? Did you have to convert my fighting dog file or was it "fit for purpose"?

I use paint.net since I haven't tinkered with GIMP.

It's basically Photoshop Lite, but works perfectly for DDS files.

Link to comment

Static portrait is still not showing:

 

I did the following:

 

Trait in traits/remedy_portrait_traits

 

Spoiler

fighting_dog = {   #or should this be portrait1?
    hidden = no
    random = no
    customizer = no
    opposites = {
        portrait2
        portrait3

etc

 

traits in interface/trait_icons  ( this is where the regular trait icon sprite_type go ) is this also required for the static portrait ?

 

Spoiler

spriteType = {
        name = "GFX_trait_fighting_dog"
        texturefile = "gfx/traits/fighting_dog.dds"
        noOfFrames = 1
        norefcount = yes
        effectFile = "gfx/FX/buttonstate.lua"
    }

 

Portrait interface in interface/portraits/static_portraits

 

Spoiler

spriteTypes = {
    spriteType = {
        name = "GFX_portrait_remedy_portrait_swapping"    # or should this be fighting_dog ?
        texturefile = "gfx/static_portraits/remedy_portrait_swapping.dds"
        noOfFrames = 27
        norefcount = yes
        can_be_lowres = yes
    }

}

 

portraitType = {
        name = "PORTRAIT_static_fighting_dog"
        effectFile = "gfx/FX/portrait.lua"               # this line was not includedin the ReMeDy portrait swapping mod
        weight = {
            additive_modifier = {
                value = 1000000
                portrait_clothing = yes
                OR = {
                    portrait_has_trait = fighting_dog
                }
             }
        }

        layer = {
            "GFX_empty:c0"
            "GFX_empty:c2"
            "GFX_empty:c3"
            "GFX_empty:c1"
            "GFX_empty:c4"
            "GFX_empty:p1:h:y"
            "GFX_portrait_remedy_portrait_swapping:c5"
        }

        allow_property_values = {
            1 = {
                0 = { always = yes }
            }
            5 = {
                0 = { always = no }
                1 = { portrait_has_trait = fighting_dog }
                2 = { portrait_has_trait = portrait314 }
                3 = { portrait_has_trait = portrait315 }
                4 = { p

 

Thanks to Rascalov the gfx file now seems ok.

The event works , the dog is created with the required traits except for the portrait. Instead I get default dog in armor .

 

Link to comment

(IMAGE HEAVY) Step-by-step instructions on using paint.net:

 

Open up the picture file you want to make a portrait from.

 

Spoiler

image.png.c0045479d0c57fbc4de1ba3f7e591073.png

 

 

Use Image>Canvas Size, Image>Resize, or just select and copy/paste a part of the picture you want to be a part of the portrait until it is perfectly square.

 

Spoiler

image.png.8c2774e5961eb3da7af1a8dbd44bee9d.png

 

 

Use Image>Resize and set the dimensions to 152x152, then Ctrl-A and then Ctrl-C to select all and copy.

 

Spoiler

image.png.7265af0e4e5e1c3f489fd31a8c666939.png

 

Save this file to your hard drive: portrait_template.dds

This will be the template you will use. Open it up in paint.net and click on Add New Layer.

 

Spoiler

image.png.1e737b07ea33da4c3d0494fc1611fd62.png

 

Select the new layer (should be selected by default) and Ctrl-V to paste your image

 

Spoiler

image.png.cd58f7506f97c7d9a132bdc11fca99b1.png

 

Uncheck that layer, then select the Background layer and click on the Magic Wand tool. Click and Ctrl-Click the outer corners. (alternatively, click on the circle and Ctrl-I to invert selection)

 

Spoiler

image.png.9b661fe1eb034bd3270362316181bf04.png

 

Click on the Layer 2 layer and recheck the check box. Hit the Delete key. Then click on the Merge Layer Down button.

 

Spoiler

image.png.3b604722b327e080b8fee2c600c552c0.png

image.png.36e7d528f4b89b4d28bfafb47def0961.png

image.png.e8689de62fea9236c1391438a05ecdc8.png

 

Save the image with whatever filename you want. Congratulations! You now have a single-frame portrait! If you want to use multiple frames in a single file, open up one of the remedy portrait files and zoom in until you can clearly see the difference in pixels.

 

Spoiler

image.png.4ba7a179a8780f456e03fab8e7515371.png

 

Go back to your new portrait, Ctrl-A and Ctrl-C to copy it. Go back to the remedy portrait file and Ctrl-V. Move the image around until is it aligned pixel perfect with the overlaying portrait.

 

Spoiler

image.png.60708fa6762a62c9bdff160732ee41fd.png

 

 

Save the file, and you now have your portrait!

Link to comment
29 minutes ago, joemann said:

 

Thanks to Rascalov the gfx file now seems ok.

The event works , the dog is created with the required traits except for the portrait. Instead I get default dog in armor .

 

Quote

 

spriteTypes = {
    spriteType = {
        name = "GFX_portrait_fighting_dog"    # This is important. You must choose a unique name
        texturefile = "gfx/static_portraits/remedy_portrait_swapping.dds"
        noOfFrames = 27
        norefcount = yes
        can_be_lowres = yes
    }

}

 

 

 

Quote

        layer = {
            "GFX_empty:c0"
            "GFX_empty:c2"
            "GFX_empty:c3"
            "GFX_empty:c1"
            "GFX_empty:c4"
            "GFX_empty:p1:h:y"
            "GFX_portrait_fighting_dog:c5" # Remember your customized name? This is where it goes.
        }

 

Quote

            1 = {
                0  = { always = yes }
            }
            19 = {
                0  = { always = yes }
            }
            33 = {
                0  = { always = yes }
            }
            34 = {
                0  = { always = yes }
            }
            35 = {
                0  = { always = yes }
            }
            36 = {
                0  = { always = yes }
            }
            6 = {
                0  = { always = yes }
            }

 

If you have a single frame portrait:

Quote

            5 = {
                0 = { portrait_has_trait = fighting_dog }

            }

If you use the default remedy portrait files:

 

Quote

            5 = {
                0 = { always = no } # Blank space in the remedy file
                1 = { portrait_has_trait = dwtw_others1 }
                2 = { portrait_has_trait = dwtw_others2 }
                3 = { portrait_has_trait = dwtw_others3 }
                4 = { portrait_has_trait = houseirae_others4 }
                5 = { portrait_has_trait = houseirae_others5 }

                6 = { portrait_has_trait = fighting_dog } # Frame 7 in the portrait picture file.

 

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