W1llz
Private
58 Badges
- Dec 9, 2015
- 15
- 0
- Jun 2, 2019
- Add bookmark
- #1
Hey fellas!
I'm working on a AGOT submod adding new artifacts (that I want to have change the portrait as some artifacts do [ex: Reformed Religious Head Crowns and Crusader King Helmet])
I looked everywhere on the CK2 modding wiki regarding artifacts and portrait modding but could not find the following;
WHAT exactly is the line of text that connects an artifact and its PORTRAIT (not inventory) graphic (which I already have I will post it below) together?
For example, I made the following suit of armors into graphics; (I know they are not perfect I will polish them once they work out)
Each of these are a seperate item (for example, "Dark Steel Plate Armor" which is the 5th in the row)
When a player equips this item I want their portrait to add this layer of clothing so that you get a more astethic and real effect of owning said artifact. (Idc if it is considered a hat in coding as long as it works on any culture and that is shows.)
I know this is possible without modifying culture group clothing like western_clothing.dds (btw this is a custom .dds strip that I named mod2_armors.dds)
What files do I have to modify and is it possible to add a custom .dds for new layers instead of modifying for example special_crowns.dds ?
THANKS
Kaunaz
Sergeant
1 Badges
- Jan 3, 2019
- 74
- 2
- Jun 2, 2019
- Add bookmark
- #2
You'll want to look in portrait_properties and the sprite type interface file (can't recall its exact name), as if you add to the existing artifact portrait layers and their corresponding image files you'll need to increase the number of frames there. If you rather have a new, custom dds file rather than modifying existing ones, you'll have to add it to portrait_properties and define its sprite type, and alter every culture's portrait file to add the additional layer.
Another possibility could be to fiddle with clothing overrides (similar to what e.g warrior lodges use) using hidden traits added by events, though I can't say how well this would work since I haven't tried it, but it might be more compatible and require less maintenance to keep working with updates.
W1llz
Private
58 Badges
- Dec 9, 2015
- 15
- 0
- Jun 3, 2019
- Add bookmark
- #3
Kaunaz said:
You'll want to look in portrait_properties and the sprite type interface file (can't recall its exact name), as if you add to the existing artifact portrait layers and their corresponding image files you'll need to increase the number of frames there. If you rather have a new, custom dds file rather than modifying existing ones, you'll have to add it to portrait_properties and define its sprite type, and alter every culture's portrait file to add the additional layer.
Another possibility could be to fiddle with clothing overrides (similar to what e.g warrior lodges use) using hidden traits added by events, though I can't say how well this would work since I haven't tried it, but it might be more compatible and require less maintenance to keep working with updates.
I'm trying to go the clothign overrides route here is what I have so far;
Code:
spriteTypes = { # Mod2 Armor spriteType = { name = "GFX_mod2_armor" textureFile = "gfx/characters/shared/mod2_armor.dds" noOfFrames = 7 } portraitType = { #Portraits - Male effectFile = "gfx/FX/portrait.lua" name = "PORTRAIT_mod2_armor" weight = { additive_modifier = { value = 10000 portrait_age > child has_artifact_flag = w1llz_armor has_artifact = leather_plate portrait_clothing = yes } } layer = { "GFX_leather_plate:p1:c2" "GFX_empty:c4" "GFX_empty:c0" } }}
Is this how it works? What defines WHAT frame # = what portrait
Nendur
Colonel
1 Badges
- Dec 16, 2013
- 884
- 206
- Jun 3, 2019
- Add bookmark
- #4
W1llz said:
I'm trying to go the clothign overrides route here is what I have so far;
Is this how it works? What defines WHAT frame # = what portrait
The clothing overrides have limited scripting support, so you can't detect the artifacts directly.
Traits are the only general purpose trigger to work with.
An alternative is to replace an existing layer, for AGOT the special_helmets are unused and could be taken.
W1llz
Private
58 Badges
- Dec 9, 2015
- 15
- 0
- Jun 3, 2019
- Add bookmark
- #5
Nendur said:
The clothing overrides have limited scripting support, so you can't detect the artifacts directly.
Traits are the only general purpose trigger to work with.An alternative is to replace an existing layer, for AGOT the special_helmets are unused and could be taken.
Hey there thanks for the reply; I decided to use special_scepters and special_helmets.
Quick question; When I edited portrait_properties/00_portrait_properties and portraits/portrait_sprites.gfx do I need to add only the lines which I am modifying/adding or do I need to add ALL portrait properties and sprites and modify?
I am having issues with many portraits dissapearing ingame and my artifacts appearing at random places even when not equiped.
Here is my code for the weapons replacing special_helmets in 00_portrait_properties (note that for now I have ALL portrait properties copy pasted from AGOT)Code:
# p34 Special Helmets34 = { 0 = { # blank factor = 100 modifier = { factor = 0 any_artifact = { has_artifact_flag = portrait_weapon # you can replace the flag with the flag your armour artifacts have is_artifact_equipped = yes } } modifier = { factor = 0 OR = { has_game_started = no is_alive = no } } } 1 = { # Axe factor = 1 modifier = { factor = 100 any_artifact = { OR = { artifact_type = steel_great_axe artifact_type = great_axe } is_artifact_equipped = yes } } } 2 = { #Morningstar factor = 1 modifier = { factor = 100 any_artifact = { artifact_type = beautiful_morningstar is_artifact_equipped = yes } } } 3 = { #Pole-Axe factor = 100 modifier = { factor = 0 NOT = { any_artifact = { artifact_type = beautiful_polearm is_artifact_equipped = yes } } } } 4 = { #Halberd factor = 100 modifier = { factor = 0 NOT = { any_artifact = { artifact_type = silver_halberd is_artifact_equipped = yes } } } } 5 = { #Greatsword factor = 100 modifier = { factor = 0 NOT = { any_artifact = { OR = { artifact_type = steel_great_axe artifact_type = great_axe } is_artifact_equipped = yes } } } } 6 = { #Pike factor = 100 modifier = { factor = 0 NOT = { any_artifact = { OR = { artifact_type = silver_pike artifact_type = pike } is_artifact_equipped = yes } } } } 7 = { #Blank factor = 100 modifier = { factor = 0 any_artifact = { has_artifact_flag = portrait_weapon # you can replace the flag with the flag your armour artifacts have is_artifact_equipped = yes } } modifier = { factor = 0 OR = { has_game_started = no is_alive = no } } } 8 = { #Leather Armor factor = 100 hide_layers = { 12 = { } } #Hide layer 12 (disfigured masks) when this frame is picked. hide_layers = { 5 = { } } #Hide layer 5 (headgear) when this frame is picked. hide_layers = { 1 = { } } #Hide Hair. hide_layers = { 18 = { } } #Hide layers with special crowns. hide_layers = { 19 = { } } #Hide layers with special crowns. hide_layers = { 31 = { } } #Veil overload. hide_layers = { 32 = { } } hide_layers = { 33 = { } } modifier = { factor = 0 NOT = { any_artifact = { artifact_type = leather_armour is_artifact_equipped = yes } } } modifier = { factor = 0 may_wear_martial_headgear_trigger = no } } 9 = { #Blank factor = 100 modifier = { factor = 0 any_artifact = { has_artifact_flag = portrait_weapon # you can replace the flag with the flag your armour artifacts have is_artifact_equipped = yes } } modifier = { factor = 0 OR = { has_game_started = no is_alive = no } } } 10 = { #Blank factor = 100 modifier = { factor = 0 any_artifact = { has_artifact_flag = portrait_weapon # you can replace the flag with the flag your armour artifacts have is_artifact_equipped = yes } } modifier = { factor = 0 OR = { has_game_started = no is_alive = no } }}
this is the code for special_scepters (two armor sets) in 00_portrait properties
Code:
# p36 Special Scepters36 = { 0 = { # blank factor = 100 modifier = { factor = 0 any_artifact = { has_artifact_flag = portrait_armour # you can replace the flag with the flag your armour artifacts have is_artifact_equipped = yes } } modifier = { factor = 0 OR = { has_game_started = no is_alive = no } } } 1 = { # Plate Armor factor = 1 hide_layers = { 12 = { } } #Hide layer 12 (disfigured masks) when this frame is picked. hide_layers = { 5 = { } } #Hide layer 5 (headgear) when this frame is picked. hide_layers = { 1 = { } } #Hide Hair. hide_layers = { 3 = { } } #Hide Clothes. hide_layers = { 18 = { } } #Hide layers with special crowns. hide_layers = { 19 = { } } #Hide layers with special crowns. hide_layers = { 31 = { } } #Veil overload. hide_layers = { 32 = { } } hide_layers = { 33 = { } } modifier = { factor = 100 any_artifact = { artifact_type = plate_armor is_artifact_equipped = yes } } } 2 = { # Decorated Plate Armour factor = 1 hide_layers = { 12 = { } } #Hide layer 12 (disfigured masks) when this frame is picked. hide_layers = { 5 = { } } #Hide layer 5 (headgear) when this frame is picked. hide_layers = { 1 = { } } #Hide Hair. hide_layers = { 3 = { } } #Hide Clothes. hide_layers = { 18 = { } } #Hide layers with special crowns. hide_layers = { 19 = { } } #Hide layers with special crowns. hide_layers = { 31 = { } } #Veil overload. hide_layers = { 32 = { } } hide_layers = { 33 = { } } modifier = { factor = 100 any_artifact = { artifact_type = decorated_armor is_artifact_equipped = yes } } }}
Here are screenshots of the problem ingame; (Invisible portraits for many cultures, artifact appearing for no reason)
W1llz
Private
58 Badges
- Dec 9, 2015
- 15
- 0
- Jun 3, 2019
- Add bookmark
- #6
*** UPDATE ***
Figured out why the portraits were invisible etc. it was a bug with a mod I forgot to disable.
Now my problems are (still with the same code);
- Artifact appear on character creation on random characters(?)
- My weapons(special helmets) equip fine but not my armor (special_scepters)
Nendur
Colonel
1 Badges
- Dec 16, 2013
- 884
- 206
- Jun 4, 2019
- Add bookmark
- #7
You can override property sections and sprite types from new files in a later alphabetical order.
The has_game_started = no / is_alive = no modifier on blank slots makes no sense and is what blocks the blank slot on the start screen.
Show hidden low quality content
You must log in or register to reply here.