• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Wobpig

Second Lieutenant
10 Badges
Sep 5, 2017
177
0
  • Europa Universalis IV
  • Cities: Skylines
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Age of Wonders III
  • Cities: Skylines - Parklife
  • Prison Architect
  • Crusader Kings II
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
After looking at the files in-game for the weapons (common/component_templates), I could not find where the game stores the damage values for each weapon, or in the case of missiles, travel time. Does anyone know where these values can be found so I can add new weapons?

Also, in the file, there are a few tags I can't understand, they are:
Code:
type = missile   # Used by missile launchers
type = instant   # Used in Mass Drivers and Lasers
type = point_defence   # Used in Point Defence

Does anyone know what these do?
 
Most of the damage values are stored in: common/component_templates/weapon_components.csv and common/component_templates/weapon_components.ods. But i also saw some damage included in other files, like f.e. damage of strike craft is included in common/component_templates/00_strike_craft.txt

If you add new weapons i am pretty sure you dont have to include the damage in those vanilla files though. I would recommand downloading another new weapon mod from the workshop and look how the author did it.
 
As Ajey said - weapon stats are in "common/component_templates/weapon_components.csv". There is also a file of the same name, only with ".ods" extension but according to the official information, the game reads data from the .csv file.

If you want to make a new weapon you can place the weapon stats directly into the weapon file in "common/component_templates" but it seems to be more reliable to place the stats into the .csv file as placing them to the weapon file can lead to some issues, as described here.

Code:
type = missile   # Used by missile launchers
type = instant   # Used in Mass Drivers and Lasers
type = point_defence   # Used in Point Defence
Does anyone know what these do?
This tells to the game how the weapon works. From what I can tell:
- "missile" weapon type fires a projectile which has some travel speed, HP, evasion etc. and the projectile can be destroyed by point defense weapons before it reaches its target.
- "instant" weapon type is basically everything else (lasers, kinetics, disruptors) - these find a target, fire and instantly hit (if the game rolls a hit) the target (so they have no travel speed); these weapons however cannot target missiles and strike craft.
- "point_defece" weapon type is also "instant" but this weapon type CAN target missiles and strikecraft and actually prioritizes these targets over any other target types in range.
 
How does the cost in the .csv relate to the resources in the .txt?
(.csv)
Code:
10.00   # Labeled as "cost" at the top of the file.

(.txt)
Code:
resources = {
    category = ship_components
    cost = {
        alloys = @s_t1_cost
    }    
    upkeep = {
        energy = @s_t1_upkeep_energy
        alloys = @s_t1_upkeep_alloys
    }
}
Where are the values for each of these @s_t1_... stored?

On a side note, does anyone know what the windup values do, as well as the cooldown? The number shown doesn't match the in-game number.
 
Last edited:
What program do I use to open it?
I use Open Office - it can open the .ods files, you can then make changes and save them as the .csv file that the game then reads. When you do that, you will be asked what should be used as "separators" (not sure if that is the word in English, I have localized Open Office) - it is preset to "," (comma) but make sure that you change it to ";" (semicolon) otherwise the game will not be able to read the csv file and stats of all weapons in the game will be messed up.

Also, how does the cost in the .csv relate to the resources in the .txt?
I would say this value is ignored. After a quick check the file says that the cost of Kinnetic Artillery is "120" but in the game it is about 88 alloys and some rare resource. I would guess that the values from csv were used back in times when everything cost minerals. The costs are now defined in the txt files.

Where are the values for each of these @s_t1_... stored?
I've wondered that myself many times...
 
Where are the values for each of these @s_t1_... stored?
I've wondered that myself many times...

Usually they are stored in the same file at the top. If you open for example _planetary_entities.asset you can find this at the top:
Code:
@astroid_scale = 30

I assume you know how it works but otherwise it's just a way to collectivize values to change many in the same file at the same time, so you can change it to a float value if you want. :)
 
Usually they are stored in the same file at the top. If you open for example _planetary_entities.asset you can find this at the top:
Yes, they often are there but sometimes are not. E.g. in technology files you have
Code:
cost = @tier3cost1
but at the top of the file there is nothing like "tier3cost1 = 1000". So I figured that there are some local and global variables and I was wondering about where these global variables are stored.