Artifact Modding

For specific technical issues and questions.

Artifact Modding

PostPosted by athenalras » Sun Jul 16, 2017 05:14

Hi guys. Short preface: wiki tutorials on modding artifacts is barebones and generally sucks for beginner modders.

a) quality. What is quality? I get that it goes from 1 to 5 but the wiki says nothing in the description about what it does or what it affects. Does it affect chance of acquisition? Does it change the item frame? What?

b) flags. For the life of me, I cannot find where a list of artifact flags are and what they do. The wiki description of "Flags that can be checked with has_artifact_flag condition." is about as useful as saying that a person can create a explosives using dish soap and detergent. Its useless tautology that gives no explanation of what flags do, where one can find "has_artifact_flag" or the different flags there are.

I get that some flags are like "combat_weapon", "religious", "rare", "very rare", etc. But there is no definition of what these do. Yeah, I understand that items with the "combat_weapon" flag are used for weapons but what is the definition of its use? The same goes for distinguishing "rare" and "very rare". What do these flags do? Does it somehow affect spawning chance?

Because that doesn't seem to be intuitive since items such as the "Sword_of_Mohammad" is listed explicitly in the 00_artifact_spawns where its spawn_chance is specific in its chance of generation.

Simply saying that a flag is a flag that can be checked by a flag checker is simply, unimaginably, stupid and frustrating.

While I'm on the subject of flags, I also noticed that there are flag differences between AGOT and vanilla weapons.
Using the lances as an example, in vanilla we see two flags for lances: "combat_weapon" and "lance".
In AGOT, we see three flags: ""combat_weapon", "lance" and "combat_tier_1".

Nowhere have I seen "combat_tier_x" used in vanilla files.

c) gfx
Okay, this one is something I am not frustrated by the wiki but more confused by what I gloss over in the vanilla and what I have seen in the AGOT mod.

For an example, I will do a comparison of the spears/lances used in vanilla and the ones in AGOT.
In vanilla, a tier 1 and a tier 2 lance uses "picture = GFX_spear".
In AGOT, a tier 1 lance uses "picture = GFX_lance" and a tier 2 lance uses "picture = GFX_twohanded_lance"

From what I understand, the "GFX_" is a prefix and what comes after is the file name of the corresponding artwork, not the name of the artifact as the wiki (wrongfully) states. Obviously I have never tested this out in the game but theoretically, there should be an error concerning spawning these weapons in AGOT simply because there are no corresponding artwork named "lance.dds" or "twohanded_lance.dds".

I apologize in advance for my abrasive writing.
athenalras
 
Posts: 28
Joined: Wed Aug 24, 2016 04:36

Re: Artifact Modding

PostPosted by Payuset » Sun Jul 16, 2017 09:11

a) IIRC it is just the frame

b) flags are ways to check things, to see what each flag does you would have to look at the events that call for them.
by themselves flags do nothing, they are just ways to limit/modify what you are doing, and that is by creating conditions in the events that call for them.

for example you cold make an event so you steal a weapon of someone on a won duel, you would use has_artifact_flag= combat_weapon so it only picks a weapon and not the skull of his enemy.

c) GFX_ is a naming standard so you can find things faster when reading the code, in this case it means that it is an image (it is an abreviation of graphics)

and the name you need is the name of the archive in "gfx\interface\inventory\artifacts"

again what the wiki says is not a lie, it is a standard so other people can read and understand your code, and IN VANILLA it is followed.
And sometimes people make typos when writing code (or writing at all) you know, and in the case of moding for CK2 it is a tad easier for them to go unnoticed due to the fact that you don't need to compile things.

i hope i made myself clear.
Payuset
 
Posts: 63
Joined: Sun May 01, 2016 16:02

Re: Artifact Modding

PostPosted by athenalras » Sun Jul 16, 2017 18:25

So I got the hang of the other stuff for modding artifacts.

One problem I encountered, however, was that the picture for my custom artifacts were not showing up when I spawned them in for testing.

Is there a specific format needed for the artifact picture? All the wiki says is "118x118 pixels" and another one for small. And there is no mistake in this because I used the arti_bg.dds and arti_bg_small.dds as a base.

In my 01_artifacts.txt, I had the line "picture = "GFX_yi_ti_armor_T2"
In my gfx/interface/inventory/artifacts folder, I had the file "yi_ti_armor_T2".

Yet, what appears in game is a working artifact with a big red "X".

EDIT:
Here is the coding for a piece of armor that is functional but doesn't appear correctly

armor_tier_1_guard_armor = {
#learning = 1
combat_rating = 0.5
command_modifier = {
heavy_infantry = 0.05
random = 0.03
}
monthly_character_prestige = 0.01
quality = 1
active = {
is_adult = yes
}
flags = { armour armour_tier_1}
picture = "GFX_guard_armor"
stacking = no
slot = torso
}

I also have two images in the gfx\interface\inventory\artifacts named:
guard_armor.dds
guard_armor_small.dds

I have tested in Paint.net, saving the image as:
X8R8G8B8 - 73kb
A8R8G8B8 - 73kb
DXT5 - 20kb
R8G8B8 - 54kb
(the above are sizes for the normal picture only)

I have also downloaded and browsed through other steam mods that have added artifacts. Example: Historical and Fantastical Artifacts.

This mod has pictures around the size 73kb as well, yet it works fine and has the same similar coding in its artfacts.txt

How do I get the pictures to show?
athenalras
 
Posts: 28
Joined: Wed Aug 24, 2016 04:36

Re: Artifact Modding

PostPosted by Lord_Verkos » Sun Jul 16, 2017 23:08

To have the pictures show up you have to go under the interface folder (Documents\Paradox Interactive\Crusader Kings II\mod\A Game of Thrones\interface) and add in the sprite info like
spriteTypes = {
spriteType = {
name = "GFX_gift_zorse"
texturefile = "gfx\\interface\\inventory\\artifacts\\gift_zorse.dds"
}
If you are adding straight to the main mod then you just need to add a repeat of the second, third, and fourth lines at the end of the sprite info. Hope that helps.
Lord_Verkos
 
Posts: 46
Joined: Tue Jan 31, 2017 04:21

Re: Artifact Modding

PostPosted by athenalras » Mon Jul 17, 2017 00:58

Thank you so much! That did the trick.
athenalras
 
Posts: 28
Joined: Wed Aug 24, 2016 04:36


Return to Technical Discussion

Who is online

Users browsing this forum: No registered users and 0 guests