Modding Artifacts into Portraits (Question) (2024)

W1llz

Private

58 Badges

Dec 9, 2015
15
0
  • Modding Artifacts into Portraits (Question) (2)
  • Modding Artifacts into Portraits (Question) (3)
  • Modding Artifacts into Portraits (Question) (4)
  • Modding Artifacts into Portraits (Question) (5)
  • Modding Artifacts into Portraits (Question) (6)
  • Modding Artifacts into Portraits (Question) (7)
  • Modding Artifacts into Portraits (Question) (8)
  • Modding Artifacts into Portraits (Question) (9)
  • Modding Artifacts into Portraits (Question) (10)
  • Modding Artifacts into Portraits (Question) (11)
  • Modding Artifacts into Portraits (Question) (12)
  • Modding Artifacts into Portraits (Question) (13)
  • Modding Artifacts into Portraits (Question) (14)
  • Modding Artifacts into Portraits (Question) (15)
  • Modding Artifacts into Portraits (Question) (16)
  • Modding Artifacts into Portraits (Question) (17)
  • Modding Artifacts into Portraits (Question) (18)
  • Modding Artifacts into Portraits (Question) (19)
  • Modding Artifacts into Portraits (Question) (20)
  • Modding Artifacts into Portraits (Question) (21)
  • Modding Artifacts into Portraits (Question) (22)
  • Modding Artifacts into Portraits (Question) (23)
  • Modding Artifacts into Portraits (Question) (24)
  • Modding Artifacts into Portraits (Question) (25)
  • Modding Artifacts into Portraits (Question) (26)
  • Modding Artifacts into Portraits (Question) (27)
  • Modding Artifacts into Portraits (Question) (28)
  • Modding Artifacts into Portraits (Question) (29)
  • Modding Artifacts into Portraits (Question) (30)
  • Modding Artifacts into Portraits (Question) (31)
  • Modding Artifacts into Portraits (Question) (32)
  • Modding Artifacts into Portraits (Question) (33)
  • Modding Artifacts into Portraits (Question) (34)
  • Modding Artifacts into Portraits (Question) (35)
  • Modding Artifacts into Portraits (Question) (36)
  • Modding Artifacts into Portraits (Question) (37)
  • Modding Artifacts into Portraits (Question) (38)
  • Modding Artifacts into Portraits (Question) (39)
  • Modding Artifacts into Portraits (Question) (40)
  • Modding Artifacts into Portraits (Question) (41)
  • Modding Artifacts into Portraits (Question) (42)
  • Modding Artifacts into Portraits (Question) (43)
  • Modding Artifacts into Portraits (Question) (44)
  • Modding Artifacts into Portraits (Question) (45)
  • Modding Artifacts into Portraits (Question) (46)
  • Modding Artifacts into Portraits (Question) (47)
  • Modding Artifacts into Portraits (Question) (48)
  • Modding Artifacts into Portraits (Question) (49)
  • Modding Artifacts into Portraits (Question) (50)
  • Modding Artifacts into Portraits (Question) (51)
  • 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)

Modding Artifacts into Portraits (Question) (52)

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
  • Modding Artifacts into Portraits (Question) (54)
  • 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
  • Modding Artifacts into Portraits (Question) (56)
  • Modding Artifacts into Portraits (Question) (57)
  • Modding Artifacts into Portraits (Question) (58)
  • Modding Artifacts into Portraits (Question) (59)
  • Modding Artifacts into Portraits (Question) (60)
  • Modding Artifacts into Portraits (Question) (61)
  • Modding Artifacts into Portraits (Question) (62)
  • Modding Artifacts into Portraits (Question) (63)
  • Modding Artifacts into Portraits (Question) (64)
  • Modding Artifacts into Portraits (Question) (65)
  • Modding Artifacts into Portraits (Question) (66)
  • Modding Artifacts into Portraits (Question) (67)
  • Modding Artifacts into Portraits (Question) (68)
  • Modding Artifacts into Portraits (Question) (69)
  • Modding Artifacts into Portraits (Question) (70)
  • Modding Artifacts into Portraits (Question) (71)
  • Modding Artifacts into Portraits (Question) (72)
  • Modding Artifacts into Portraits (Question) (73)
  • Modding Artifacts into Portraits (Question) (74)
  • Modding Artifacts into Portraits (Question) (75)
  • Modding Artifacts into Portraits (Question) (76)
  • Modding Artifacts into Portraits (Question) (77)
  • Modding Artifacts into Portraits (Question) (78)
  • Modding Artifacts into Portraits (Question) (79)
  • Modding Artifacts into Portraits (Question) (80)
  • Modding Artifacts into Portraits (Question) (81)
  • Modding Artifacts into Portraits (Question) (82)
  • Modding Artifacts into Portraits (Question) (83)
  • Modding Artifacts into Portraits (Question) (84)
  • Modding Artifacts into Portraits (Question) (85)
  • Modding Artifacts into Portraits (Question) (86)
  • Modding Artifacts into Portraits (Question) (87)
  • Modding Artifacts into Portraits (Question) (88)
  • Modding Artifacts into Portraits (Question) (89)
  • Modding Artifacts into Portraits (Question) (90)
  • Modding Artifacts into Portraits (Question) (91)
  • Modding Artifacts into Portraits (Question) (92)
  • Modding Artifacts into Portraits (Question) (93)
  • Modding Artifacts into Portraits (Question) (94)
  • Modding Artifacts into Portraits (Question) (95)
  • Modding Artifacts into Portraits (Question) (96)
  • Modding Artifacts into Portraits (Question) (97)
  • Modding Artifacts into Portraits (Question) (98)
  • Modding Artifacts into Portraits (Question) (99)
  • Modding Artifacts into Portraits (Question) (100)
  • Modding Artifacts into Portraits (Question) (101)
  • Modding Artifacts into Portraits (Question) (102)
  • Modding Artifacts into Portraits (Question) (103)
  • Modding Artifacts into Portraits (Question) (104)
  • Modding Artifacts into Portraits (Question) (105)
  • 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
  • Modding Artifacts into Portraits (Question) (107)
  • 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
  • Modding Artifacts into Portraits (Question) (109)
  • Modding Artifacts into Portraits (Question) (110)
  • Modding Artifacts into Portraits (Question) (111)
  • Modding Artifacts into Portraits (Question) (112)
  • Modding Artifacts into Portraits (Question) (113)
  • Modding Artifacts into Portraits (Question) (114)
  • Modding Artifacts into Portraits (Question) (115)
  • Modding Artifacts into Portraits (Question) (116)
  • Modding Artifacts into Portraits (Question) (117)
  • Modding Artifacts into Portraits (Question) (118)
  • Modding Artifacts into Portraits (Question) (119)
  • Modding Artifacts into Portraits (Question) (120)
  • Modding Artifacts into Portraits (Question) (121)
  • Modding Artifacts into Portraits (Question) (122)
  • Modding Artifacts into Portraits (Question) (123)
  • Modding Artifacts into Portraits (Question) (124)
  • Modding Artifacts into Portraits (Question) (125)
  • Modding Artifacts into Portraits (Question) (126)
  • Modding Artifacts into Portraits (Question) (127)
  • Modding Artifacts into Portraits (Question) (128)
  • Modding Artifacts into Portraits (Question) (129)
  • Modding Artifacts into Portraits (Question) (130)
  • Modding Artifacts into Portraits (Question) (131)
  • Modding Artifacts into Portraits (Question) (132)
  • Modding Artifacts into Portraits (Question) (133)
  • Modding Artifacts into Portraits (Question) (134)
  • Modding Artifacts into Portraits (Question) (135)
  • Modding Artifacts into Portraits (Question) (136)
  • Modding Artifacts into Portraits (Question) (137)
  • Modding Artifacts into Portraits (Question) (138)
  • Modding Artifacts into Portraits (Question) (139)
  • Modding Artifacts into Portraits (Question) (140)
  • Modding Artifacts into Portraits (Question) (141)
  • Modding Artifacts into Portraits (Question) (142)
  • Modding Artifacts into Portraits (Question) (143)
  • Modding Artifacts into Portraits (Question) (144)
  • Modding Artifacts into Portraits (Question) (145)
  • Modding Artifacts into Portraits (Question) (146)
  • Modding Artifacts into Portraits (Question) (147)
  • Modding Artifacts into Portraits (Question) (148)
  • Modding Artifacts into Portraits (Question) (149)
  • Modding Artifacts into Portraits (Question) (150)
  • Modding Artifacts into Portraits (Question) (151)
  • Modding Artifacts into Portraits (Question) (152)
  • Modding Artifacts into Portraits (Question) (153)
  • Modding Artifacts into Portraits (Question) (154)
  • Modding Artifacts into Portraits (Question) (155)
  • Modding Artifacts into Portraits (Question) (156)
  • Modding Artifacts into Portraits (Question) (157)
  • Modding Artifacts into Portraits (Question) (158)
  • 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)

Modding Artifacts into Portraits (Question) (159)

Modding Artifacts into Portraits (Question) (160)

Modding Artifacts into Portraits (Question) (161)

W1llz

Private

58 Badges

Dec 9, 2015
15
0
  • Modding Artifacts into Portraits (Question) (163)
  • Modding Artifacts into Portraits (Question) (164)
  • Modding Artifacts into Portraits (Question) (165)
  • Modding Artifacts into Portraits (Question) (166)
  • Modding Artifacts into Portraits (Question) (167)
  • Modding Artifacts into Portraits (Question) (168)
  • Modding Artifacts into Portraits (Question) (169)
  • Modding Artifacts into Portraits (Question) (170)
  • Modding Artifacts into Portraits (Question) (171)
  • Modding Artifacts into Portraits (Question) (172)
  • Modding Artifacts into Portraits (Question) (173)
  • Modding Artifacts into Portraits (Question) (174)
  • Modding Artifacts into Portraits (Question) (175)
  • Modding Artifacts into Portraits (Question) (176)
  • Modding Artifacts into Portraits (Question) (177)
  • Modding Artifacts into Portraits (Question) (178)
  • Modding Artifacts into Portraits (Question) (179)
  • Modding Artifacts into Portraits (Question) (180)
  • Modding Artifacts into Portraits (Question) (181)
  • Modding Artifacts into Portraits (Question) (182)
  • Modding Artifacts into Portraits (Question) (183)
  • Modding Artifacts into Portraits (Question) (184)
  • Modding Artifacts into Portraits (Question) (185)
  • Modding Artifacts into Portraits (Question) (186)
  • Modding Artifacts into Portraits (Question) (187)
  • Modding Artifacts into Portraits (Question) (188)
  • Modding Artifacts into Portraits (Question) (189)
  • Modding Artifacts into Portraits (Question) (190)
  • Modding Artifacts into Portraits (Question) (191)
  • Modding Artifacts into Portraits (Question) (192)
  • Modding Artifacts into Portraits (Question) (193)
  • Modding Artifacts into Portraits (Question) (194)
  • Modding Artifacts into Portraits (Question) (195)
  • Modding Artifacts into Portraits (Question) (196)
  • Modding Artifacts into Portraits (Question) (197)
  • Modding Artifacts into Portraits (Question) (198)
  • Modding Artifacts into Portraits (Question) (199)
  • Modding Artifacts into Portraits (Question) (200)
  • Modding Artifacts into Portraits (Question) (201)
  • Modding Artifacts into Portraits (Question) (202)
  • Modding Artifacts into Portraits (Question) (203)
  • Modding Artifacts into Portraits (Question) (204)
  • Modding Artifacts into Portraits (Question) (205)
  • Modding Artifacts into Portraits (Question) (206)
  • Modding Artifacts into Portraits (Question) (207)
  • Modding Artifacts into Portraits (Question) (208)
  • Modding Artifacts into Portraits (Question) (209)
  • Modding Artifacts into Portraits (Question) (210)
  • Modding Artifacts into Portraits (Question) (211)
  • Modding Artifacts into Portraits (Question) (212)
  • 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
  • Modding Artifacts into Portraits (Question) (214)
  • 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.

Modding Artifacts into Portraits (Question) (2024)
Top Articles
Latest Posts
Article information

Author: Stevie Stamm

Last Updated:

Views: 6054

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Stevie Stamm

Birthday: 1996-06-22

Address: Apt. 419 4200 Sipes Estate, East Delmerview, WY 05617

Phone: +342332224300

Job: Future Advertising Analyst

Hobby: Leather crafting, Puzzles, Leather crafting, scrapbook, Urban exploration, Cabaret, Skateboarding

Introduction: My name is Stevie Stamm, I am a colorful, sparkling, splendid, vast, open, hilarious, tender person who loves writing and wants to share my knowledge and understanding with you.