# Modding - Quick questions

#### Tintiam

##### Captain
I don't think you can put an OR scope in the pretriggers

And you cannot scope anywhere in the pretriggers anyway. So you can't scope to the mother or father in the pretrigger. Put it all in the regular trigger

• 2
• 1

#### jursamaj

##### General
Indeed it does! You can pass a numeric value to trigger_switch and it works fine, however, as you guessed it tests the usual greater-than-or-equal, and it breaks at the first case which returns true, so if you do use it with numeric values, you have to order your cases from largest number to smallest.

For example, assume you have 7 buildings in a holding:

trigger_switch = {
on_trigger = num_of_buildings
1 = { FROM = { wealth = 10 } } < --- breaks here because it's checking num_of_buildings >= 1
2 = { FROM = { wealth = 20 } }
3 = { FROM = { wealth = 30 } }
....

So, you need to reverse the order:

trigger_switch = {
on_trigger = num_of_buildings
10 = { FROM = { wealth = 100 } }
9 = { FROM = { wealth = 90 } }
8 = { FROM = { wealth = 80 } }
7 = { FROM = { wealth = 70 } } <---- correctly breaks here, because it's the first case which returns true, num_of_buildings >= 7
6 = { FROM = { wealth = 60 } }
5 = { FROM = { wealth = 50 } }
4 = { FROM = { wealth = 40 } }
3 = { FROM = { wealth = 30 } }
....

I've built a pretty cool Instant Pillage mod using this logic :-D
This is very useful info. There's a mod I use, and in a decision there's a bit that does about 200 'if' clauses testing opinion (from -100 to 100) and putting it into a variable. This method looks much better.

#### Tintiam

##### Captain
So I asked it earlier but no one knew how to solve it, maybe now someone does:

How do I make my CB ignore diplomatic distance? The Crusade CB ignores it, but I can't seem to find how it does that. I want my CB to ignore diplomatic distance. Currently if I right click on someone it says I do have a valid CB, but the declare war button remains greyed out because "X is not too distant to declare war"

The crusade CB doesn't have that condition

#### richvh

##### Preserver of the Light
Crusades are called by the Pope (non-playable), so aren't called from the normal diplomatic menu. Jihads and Great Holy Wars are callable by players (who happen to be Caliph or Fylkir) and use the same CB; are you certain they can be called by the player against targets outside diplomatic range? Because there's just no way to mod diplomatic options.

#### Tintiam

##### Captain
Crusades are called by the Pope (non-playable), so aren't called from the normal diplomatic menu. Jihads and Great Holy Wars are callable by players (who happen to be Caliph or Fylkir) and use the same CB; are you certain they can be called by the player against targets outside diplomatic range? Because there's just no way to mod diplomatic options.
Yes. It's very easy to test out as well. Start the 1066 start as fatimid (shia caliph). give_title c_jerusalem to some random non muslim. Wait a week and the jihads pop. Now you can target everywhere between Norway and India with a Jihad. Now play as your vassal and try to target the same people and the declare war button is greyed out

And yeah with crusade I just mean the crusade CB. Not specifically catholics

#### Marcus I of SWE

##### Sergeant
Does anyone know where to find the "desires_duchy/kingdom" malus in the game files?

#### richvh

##### Preserver of the Light
Pretty sure that's hard coded and not moddable.

#### mjohnson85

##### Keeper of Western Europe
Does anyone know where to find the "desires_duchy/kingdom" malus in the game files?

The assigning of it is hardcoded but the opinion value you can change (I nullify it my making it 0 in my mod because I deal with it other ways). IIRC it is
Code:
de_jure_liege = {
opinion = -25
}

If not it is probably the one below it.

• 1

#### Marcus I of SWE

##### Sergeant
It must be the one below, cause its -20 ingame, right?

#### jursamaj

##### General
Yes. It's very easy to test out as well. Start the 1066 start as fatimid (shia caliph). give_title c_jerusalem to some random non muslim. Wait a week and the jihads pop. Now you can target everywhere between Norway and India with a Jihad. Now play as your vassal and try to target the same people and the declare war button is greyed out

And yeah with crusade I just mean the crusade CB. Not specifically catholics
Best I can suggest is test all the CBs to see if any others ignore range. Then look at the flags at the top of the CB definitions, and see if there are any that are unique to all the range-ignoring CBs. If so, one of those may be the culprit. If not, it's probably hard-coded for the crusade CB.

#### jursamaj

##### General
For what it's worth: the pagan Subjugation & County Conquest CBs are limited by range, but Pagan Holy War & Great Holy War are not. The Prepare Invasion action *is* range-limited, so effectively the CB is.

#### locustgate

##### Colonel
How do you make new hair/eye colors? I have a muslim base skin(eyes,lips,nose,etc) and a western hair, but the hair color is still muslim, black/dark, it shows 7 variants as I have entered, but they are all the same color.

EDIT: This is in a new graphics culture and character file.

Last edited:

#### richvh

##### Preserver of the Light
Hair colors and eye colors are defined in the portraitType:
Code:
hair_color_index = 8
hair_color = { # dark, base, highlight
{ 36 35 29 } { 196 172 91 } { 255 255 255 }
{ 10 10 10 } {  50 50 50 } { 255 255 255 }
{ 15 8 0 } { 176 155 108 } { 255 255 255 }
{ 10 10 10 } { 125 85 56 } { 255 255 255 }
{ 30 22 18 } { 150 90 55 } { 255 255 255 }
{ 30 22 18 } { 178 80 41 } { 255 255 255 }
{ 20 12 8 } { 78 54 37 } { 255 255 255 }
}

eye_color_index = 9
eye_color = {
{ 58 109 193}
{ 120 74 46 }
{ 34 103 36 }
}
This was cut & pasted from the PORTRAIT_westerngfx_male portraitType.

#### locustgate

##### Colonel
Hair colors and eye colors are defined in the portraitType:
Code:
hair_color_index = 8
hair_color = { # dark, base, highlight
{ 36 35 29 } { 196 172 91 } { 255 255 255 }
{ 10 10 10 } {  50 50 50 } { 255 255 255 }
{ 15 8 0 } { 176 155 108 } { 255 255 255 }
{ 10 10 10 } { 125 85 56 } { 255 255 255 }
{ 30 22 18 } { 150 90 55 } { 255 255 255 }
{ 30 22 18 } { 178 80 41 } { 255 255 255 }
{ 20 12 8 } { 78 54 37 } { 255 255 255 }
}

eye_color_index = 9
eye_color = {
{ 58 109 193}
{ 120 74 46 }
{ 34 103 36 }
}
This was cut & pasted from the PORTRAIT_westerngfx_male portraitType.

Yes, and pasted into the new culture graphics, which everything is working but the coloring.

Code:
spriteTypes = {

portraitType = {
name = "PORTRAIT_gerudogfx_male"
effectFile = "gfx/FX/portrait.lua"
"GFX_character_background:p0"             #0
"GFX_muslim_male_clothes_behind:p3:c0"
"GFX_western_male_hair_behind:p1:y"
"GFX_muslim_male_beard_behind:p4:y"
"GFX_muslim_male_base:p2"               #5
"GFX_muslim_male_neck:d0"
"GFX_muslim_male_cheeks:d4"
"GFX_muslim_male_chin:d1"
"GFX_muslim_male_mouth:d2:o73x46"
"GFX_muslim_male_eyes:d6:o51x76"
"GFX_character_scars:p7:y"
"GFX_character_reddots:p8"
"GFX_character_boils:p9"
"GFX_character_blinded_eyes:p10"
"GFX_muslim_male_clothes:p3:c2"
"GFX_empty:p5:c3"                       #10
"GFX_muslim_male_beard:p4:y"
"GFX_muslim_male_nose:d3:o80x66"
"GFX_muslim_male_ear:d7:o24x48"               #15
"GFX_western_male_hair:p1:y"
"GFX_empty:p3:c4"                       #20
"GFX_character_imprisoned:p6"
"GFX_player_overlay:p11"
}

hair_color_index = 8
hair_color = { # dark, base, highlight
{ 134 31 27 } { 230 23 33 } { 255 255 255 }
{ 36 35 29 } { 196 172 91 } { 255 255 255 }
{ 10 10 10 } { 50 50 50 } { 255 255 255 }
{ 15 8 0 } { 176 155 108 } { 255 255 255 }
{ 10 10 10 } { 125 85 56 } { 255 255 255 }
{ 30 22 18 } { 150 90 55 } { 255 255 255 }
{ 30 22 18 } { 178 80 41 } { 255 255 255 }
{ 20 12 8 } { 78 54 37 } { 255 255 255 }
}

eye_color_index = 9
eye_color = {
{ 215 203 51}
}

}

EDIT: Eye color is working

Last edited:

#### Tintiam

##### Captain
not yet. I've still got number of other issues to do, so I am putting it up for now
I found out what causes it: externals in default.map

#### Nendur

##### Colonel
Yes, and pasted into the new culture graphics, which everything is working but the coloring.
EDIT: Eye color is working

To get the hair colouring you need to add a :h tag in the hair and beard layers.
For eyes the pupil layer eyes2 similar to the western portraits is missing.

#### locustgate

##### Colonel
To get the hair colouring you need to add a :h tag in the hair and beard layers.
For eyes the pupil layer eyes2 similar to the western portraits is missing.
That got it.

Muslims don't have a eye2.

#### DaVincix

##### Second Lieutenant
Theme: Spawned Units

Which file(s) are responsible for the number of the spawn, i mean the amount of men? (couldn't find it, searched in several possible files, please don't tell me, the numbers are unmoddable)

Specifially interested in the Lodbroek-England invasion and William the Bastard bookmarks, but the Mongols spawn would be of interest as well.

Anybody?

EDIT

Believe, i just found it out ... still have to getting sure.

EDIT AGAIN

Nope, or half nope.

Found for Mongols event and a few other the according codes, example:

troops =
{
horse_archers = { 2700 2700 }

that's fine and handy for modding.

Just not available for Old Gods, William etc. bookmarks.

Then there are the match_mult, match_max, match_min codes for unit spawn references - but changing the factors produces no change in-game for spawned units with the said bookmarks.

Can anybody help me?

Are those specific spawn codes with numbers like above (Mongols event) in the DLC zips?
If so, has anybody an idea, which ones of the many DLC zips contain Old Gods/867 and the William/1066 bookmarks unit spawns?

Last edited: