群星
ParaWikis
Notice
: Undefined index: HTTP_ACCEPT_LANGUAGE in
/data/wwwroot/www.parawikis.com/skins/Liberty/LibertyTemplate.php
on line
185
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
阅读
编辑
编辑源代码
查看历史
讨论
编辑“
Technology modding
”
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
{{version|3.1}} The technology game data can be found in these files/folders: * '''{{path|common/technology}}''' It is possible to mod in new technologies, or "erase" old ones. == Technology File Overview == <syntaxhighlight lang="ruby"> # These are simply constants that can be used to assign technologies to right cost for each tier easily. You can add your own as well. @example_cost = 1000 @tier1cost1 = 500 @tier1weight1 = 100 technology_name = { # Code name of the technology. This is referred to in other files that unlock things via technology, such as 00_spaceport_modules.txt. cost = @tier1cost1 # This sets the cost of the technology in research points. # Parameters: constant, integer area = society # The area of technology this belongs to. # Parameters: physics, society, engineering tier = 1 # Each technology is split into tiers. # You need to have researched 5 technologies within one tier to see any technologies of the next tier above. There are five tiers. # Parameters: 0, 1, 2, 3, 4, 5, found in 00_tiers.txt category = { biology } # The category of technology. Scientists with modifiers for this category will research this technology quicker/slower. # Parameters: category_name found in 00_category.txt levels = -1 # Controls the number of levels this technology has. -1 means it is repeatable. # Parameters: integer, -1 cost_per_level = @repeatableTechLevelCost # Controls the cost per level of this technology. # Parameters: constant, integer prerequisites = { "prerequisite_technology" } # This technology requires "tech_eco_simulation" to have been researched before it will appear as an option # Parameters: technology_name weight = @tier1weight1 # This is the initial weighting of the technology used to determine whether or not the technology should appear as an option. # Parameters: constant, integer gateway = biological # a flavor-text-only entry that shows what kind of technology is behind this tech. ai_update_type = military # controls AI auto-updating, ai_update_type will make the AI to update existing military ship designs and starbases, # and if update type is all, civilian ships and stations will also be updated. # Parameters: military, all start_tech = yes/no # Defines this technology as a starting technology modifier = { } # Contains any modifiers this technology directly changes. feature_flags = { my_tech_flag } # flavor-text-only entries that tells the player what does this tech do. # the localisation key "my_tech_flag" is used for this and "my_tech_flag_desc" is used for the tooltip. # All feature_flags are hardcoded, you cannot create new ones. prereqfor_desc = { ship = { title = "EXAMPLE_TECH_TITLE" desc = "EXAMPLE_TECH_DESC" } } # This is used to add localisation telling the player that this technology is a prerequisite for another important technology potential = { } # If this block is evaluated false, this tech can't be drawn as an option. # DLC exclusive techs are hidden this way. weight_modifier = { modifier = { factor = 1.5 has_ethic = ethic_pacifist } } # These are the weighting modifier used to determine how likely this technology is drawn as an option. # If weight is multiplied by 0, this tech can't be drawn as an option, but can still be given by scripts and console commands. ai_weight = { factor = 1.5 modifier = { factor = 2 has_ethic = ethic_pacifist } } # These are the ai weighting modifiers used to by the AI to determine how likely it will research this technology. weight_groups = { repeatable } # This is a weight group to be used later mod_weight_if_group_picked = { repeatable = 0.01 } # Weight of this technology is multiplied by each value if another technology from respective weight group have already been drawn as an option # In this case, if there is already a repeatable tech drawn as an option, this tech is 0.01 times likely to be drawn. } </syntaxhighlight> == Adding Techs == If you are new to modding Stellaris, the best way to understand how to create new technologies is to use the vanilla techs as examples. <pre> tech_nutrient_replication = { cost = @tier3cost3 area = society tier = 3 category = { biology } prerequisites = { "tech_nano_vitality_crops" } weight = @tier3weight3 potential = { } modifier = { planet_jobs_food_produces_mult = 0.15 } weight_modifier = { modifier = { factor = 1.25 has_ethic = ethic_pacifist } modifier = { factor = 1.5 has_ethic = ethic_fanatic_pacifist } modifier = { factor = 1.25 research_leader = { area = society has_trait = "leader_trait_expertise_biology" } } } ai_weight = { modifier = { factor = 1.25 has_ethic = ethic_pacifist } modifier = { factor = 1.5 has_ethic = ethic_fanatic_pacifist } modifier = { factor = 1.25 research_leader = { area = society has_trait = "leader_trait_expertise_biology" } } } } </pre> === ID Name === The first line, <code>tech_nutrient_replication = {</code> declares the ID Name for the technology. This is not the name that will display in-game, rather, the unique ID that other files, including language files, will reference the tech as. It is best to name it similarly to the technology's planned name, so a tech named "Better Farms" would be <code>tech_better_farms</code>. Of course, this is not required. ID Names do not support spaces, and should be replaced with underscore ( _ ) === Cost === Here is a list of the variables Stellaris uses for most of its technologies. The cost determines how long it will take to research the technology.<ref name=var>If not defined in the file itself there are from: {{path|common/scripted_variables/00_scripted_variables.txt}}</ref> <pre> @tier1cost1 = 2000 @tier1cost2 = 2500 @tier1cost3 = 3000 @tier2cost1 = 4000 @tier2cost2 = 5000 @tier2cost3 = 6000 @tier3cost1 = 8000 @tier3cost2 = 10000 @tier3cost3 = 12000 @tier4cost1 = 16000 @tier4cost2 = 20000 @tier4cost3 = 24000 @tier5cost1 = 32000 @tier5cost2 = 40000 @tier5cost3 = 48000 </pre> Cost can be set to any number within the 32bit integer limit. <pre> # Using a preset weight weight = @tier1cost3 # 3000 # Using a custom weight weight = 9000 </pre> === Weight === Weight controls how likely a tech is to be "drawn", the higher the number, the higher the likelihood of it appearing compared to other techs. Here is a list of the weights Stellaris uses for most of its techs.<ref name=var /> <pre> @tier1weight1 = 100 @tier1weight2 = 95 @tier1weight3 = 90 @tier2weight1 = 85 @tier2weight2 = 75 @tier2weight3 = 70 @tier3weight1 = 65 @tier3weight2 = 60 @tier3weight3 = 50 @tier4weight1 = 45 @tier4weight2 = 40 @tier4weight3 = 35 @tier5weight1 = 30 @tier5weight2 = 25 @tier5weight3 = 20 </pre> The syntax and usage of a tech's weight is the same as tech cost. A tech with low weight (i.e. 5) will have a much lower chance to be "drawn" than other techs. These are not definitive values however, and are compared to every other valid tech in the game. <pre> # Using a preset weight weight = @tier1weight3 # 90 # Using a custom weight weight = 15 </pre> === Tier === The '<kbd>tier</kbd>' of a technology, while not shown ingame,<ref>If you do not use mods, like "Tech Tiers Revealed".</ref> does determine how many techs of a previous tier have to be researched for the next tier to become unlocked. I.e. a Tier 3 technology cannot be "drawn" until the country owns at least six Tier 2 technologies. These are also easily moddable via its file, see ''[[#Tiers]]''. Tier 0 is used for starting technologies. Tier 1 – 3 are typically unlocked near the earlygame to the midgame Tier 4 – 5 typically near to after endgame. === Area === This determines the technology's research area, as seen in the research panel. <pre> area = society # Supports: physics, society, engineering </pre> === Category === This determines the category of a technology, used with the Expertise scientist traits to increase speed in a specific area of research. <pre> # Note the Curly brackets / Braces {} category = { biology } </pre> Despite the curly brackets, this is not an array; as there can only be one category for each tech. <pre> # Physics field_manipulation, particles, computing # Society psionics, new_worlds, statecraft, biology, military_theory # Engineering materials, rocketry, voidcraft, industry </pre> For adding new categories, see ''[[#Categories]]''. === Potential === "Potential" determines whether the specific country is allowed to "draw" the technology. <pre> potential = { has_authority = auth_democratic } </pre> A tech with this potential is accessible only to Democratic countries. More logic explanation in the weight section. === AI Update Type === <pre> ai_update_type = military # supports: military, all # Remove if not used </pre> Techs with this variable set will update ship designs upon researching. If this field is all, civilian ships will be upgraded. Used for component-unlocking technologies. === Prerequisites === Prerequisites (careful on the spelling) determine required technologies for the tech. <pre> prerequisites = { "tech_droid_workers" } </pre> A technology with this prerequisite will require researching Droid Workers first. In this case, prerequisites works as an "array", or a list of items, and can have multiple or many required techs. <pre> prerequisites = { "tech_droid_workers" "tech_colonial_centralization" } </pre> This will make the tech require "Droids" and "Colonial Centralisation" in order to research. === Tech tags === There are a few other tags: * <code>is_reverse_engineerable = yes/no</code> – Reverse engineerable tech, allows to reverse engineer from debris – only supports ship component technologies, such as Dark Matter Power or Railguns (etc.), as the game checks against the requirements for said components. * <code>start_tech = yes/no</code> – Starting tech, given at the start of the game – determines whether valid empires start with the technology. Valid empires are determined by a tech's Potential. * <code>is_rare = yes/no</code> – Rare tech, marks as purple – see ''[[#Tech_tags_2|Advanced Tech Modding]]'' for more. * <code>is_dangerous = yes/no</code> – Dangerous Tech, marks as red – see ''[[#Tech_tags_2|Advanced Tech Modding]]'' for more. === Weight Modifiers === Now we enter logic gate territory with Weight Modifiers and add/factor. These change how likely the tech is to appear in any given tech "card draw", after each completed research. An example: <pre> weight_modifier = { factor = 4 # weight × 4 modifier = { factor = 0.75 # weight × 0.75 NOR = { has_ethic = ethic_pacifist has_ethic = ethic_fanatic_pacifist } # Is not pacifist } modifier = { add = 2 # +2 to original weight amount OR = { has_ethic = ethic_militarist has_ethic = ethic_fanatic_militarist } # Is militarist } } </pre> This would reduce the weight of a technology if the researcher does not have either pacifist ethics, and increase it if militarist. ==== Weight Modifier ==== This will contain all of the modifiers that would affect the technology's chance to draw. <pre> weight_modifier = { … } </pre> Remember to count your braces. ==== Add & Factor ==== This is how the condition affects the likelihood of the tech appearing. "Factor" means multiply in this case. <pre> modifier = { factor = 0.75 has_ethic = ethic_fanatic_pacifist } </pre> This will multiply the base weight by 0.75 for countries that are fanatic pacifist. <pre> modifier = { add = 3 has_ethic = ethic_fanatic_militarist } </pre> This will increase the base weight by 3 for countries that are fanatic militarist. ==== Logic Gates ==== {{Main|Conditions}} Paradox text files use several [[wikipedia:Logic gate|logic gates]] that are found in traditional computer programming: AND (all values must be true), OR (any value must be true), NOT (all values must be false, reverses output), and NOR (no values can be true). <pre> factor = 0.01 OR = { has_ethic = ethic_pacifist has_ethic = ethic_fanatic_pacifist } </pre> In an OR logic gate at least one value within must return true, else the OR returns false. For this example, empires that are not pacifist are far less likely to draw this technology. <pre> factor = 1.5 AND = { has_authority = "auth_imperial" has_civic = "civic_imperial_cult" } </pre> In the AND gate, all values within must return true, else the AND returns false. This example will increase a tech's weight by 50% if the country has the Imperial authority AND has the Imperial Cult civic. <pre> factor = 0.01 NOT = { has_ethic = "ethic_spiritualist" } </pre> <pre> factor = 0.01 NOR = { has_ethic = "ethic_spiritualist" has_ethic = "ethic_fanatic_spiritualist" } </pre> NOT is a reversed logic gate. If the values within a "NOT" return true, then the NOT returns false. It should be noted that "NOT" and "NOR" have similar use. Logic gates can only be nested limited times; <pre> factor = 0 OR = { NOT = { is_country_type = default } AND = { has_civic = civic_fanatic_purifiers has_ethic = ethic_spiritualist } AND = { has_civic = civic_death_cult has_ethic = ethic_fanatic_militarist } } NOR = { has_ethic = ethic_xenophile has_ethic = ethic_fanatic_xenophile } </pre> :<small>(Note: This block of code does not appear anywhere in Stellaris.)</small> ==== Research Leader ==== The weight can be affected by who's in charge of research, and here's how to do it. First, open with <code>research_leader = {</code>. Now, here is where you make your decision. First, area, meaning which department your scientist is in. It really is just a coding convention, since it will only appear in that category anyways. (So I think it's supposed to increase the chance is there is a leader.) Next is "has_trait", which is self-explanatory. It is used to increase or decrease the likelihood of a tech appearing if a certain trait exists or is missing. Here is a list of all traits that can be used with it (for scientists): <syntaxhighlight lang="ruby"> # Adaptable (+25% XP Gain) "leader_trait_adaptable" # Stubborn (-25% XP Gain) "leader_trait_stubborn" # Resiliant (+25 More Years of Life) "leader_trait_resilient" # Substance Abuser (-20 Years of Life) "leader_trait_substance_abuser" # Eager (-33% Recruitment Cost) "leader_trait_eager" # Arrested Development (No XP Gain) "leader_trait_arrested_development" # Careful (-10% Anomaly Fail Risk ) "leader_trait_careful" # Meticulous (+10% Anomaly Generation Chance) "leader_trait_meticulous" # Spark of Genius (+10% Research Speed (All Techs)) "leader_trait_spark_of_genius" # Carefree (+35% Anomaly Research Speed) "leader_trait_carefree" # Roamer (+25% Survey Speed) "leader_trait_roamer" # Archaeologist (+50% Precursor Anomaly Research Speed, -25% Precursor Anomaly Fail Chance) "leader_trait_archaeologist" # Paranoid (-5% Research Speed (All Techs), -10% Anomaly Research Speed) "leader_trait_paranoid" # Maniacal (+5% Research Speed (All Techs)) "leader_trait_maniacal" # Custom AI Assistant (+5% Research Speed (All Techs), +10% Survey Speed, +15% Anomaly Research Speed) "leader_trait_custom_AI_assistant" # Sentient AI Assistant (+10% Research Speed (All Techs), +20% Survey Speed, +30% Anomaly Research Speed) "leader_trait_sentient_AI_assistant" # Expertise: Materials (+15% Research Speed (Materials)) "leader_trait_expertise_materials" # Expertise: Rocketry (+15% Research Speed (Rocketry)) "leader_trait_expertise_rocketry" # Expertise: Voidcraft (+15% Research Speed (Voidcraft)) "leader_trait_expertise_voidcraft" # Expertise: Industry (+15% Research Speed (Industry)) "leader_trait_expertise_industry" # Expertise: Field Manipulation (+15% Research Speed (Field Manipulation)) "leader_trait_expertise_field_manipulation" # Expertise: Particles (+15% Research Speed (Particles)) "leader_trait_expertise_particles" # Expertise: Computing (+15% Research Speed (Computing)) "leader_trait_expertise_computing" # Expertise: Psionics (+15% Research Speed (Psionics)) "leader_trait_expertise_psionics" # Expertise: New Worlds (+15% Research Speed (New Worlds)) "leader_trait_expertise_new_worlds" # Expertise: Statecraft (+15% Research Speed (Statecraft)) "leader_trait_expertise_statecraft" # Expertise: Biology (+15% Research Speed (Biology)) "leader_trait_expertise_biology" # Expertise: Military Theory (+15% Military Theory) "leader_trait_expertise_military_theory" </syntaxhighlight> Please note, this only includes base game, no DLCs are included. ==== Has Level ==== This tag, "<kbd>has_level</kbd>", uses inequality signs (< and >), to boost or lower the chance based on the level. Currently, it goes up to level 5, and here is an example of its usage in game: <pre> modifier = { factor = 1.25 research_leader = { area = physics has_trait = "leader_trait_expertise_voidcraft" has_level > 2 } } modifier = { factor = 1.50 research_leader = { area = physics has_trait = "leader_trait_expertise_voidcraft" has_level > 3 } } </pre> Here, the "<kbd>has_level</kbd>" tag is used to check is the leading scientist is higher than level 3, and if so, increase the likelihood of the tech by *1.5. ==== Years Passed ==== Self-Explanatory. Increases the chance if the years past since the start of the game is greater than or less than a certain year. Like this: <pre> years_passed < 20 # '<' Can be replaced by '>', '>=', '<=', or '=' </pre> ==== Scopes and Triggers ==== The most important part of weight modifiers. [[Scopes]] are used to determine what the following statements apply to. Please note, only a few scopes matter, such as '<kbd>research_leader</kbd>'. [[Triggers]] are the most important part of the entire weight modifier section. Triggers create the main thing that allows for specific cases where certain factors can affect the chance either positively or negatively. ===== Example #1: Locking to certain ethics ===== Using triggers, you can create a tech that can only be used by egalitarians or xenophiles, and it is more likely to appear if you are an egalitarian, and less likely to appear if you only have one of the two. It is even less likely to appear if the fanatic one is xenophile. <pre> weight_modifier = { factor = 0.5 # Sets the base chance of the tech appearing modifier = { factor = 0 # Sets chance to 0 if the empire does not have any of the following ethics. NOR = { has_ethic = ethic_egalitarian has_ethic = ethic_fanatic_egalitarian has_ethic = ethic_xenophile has_ethic = ethic_fanatic_xenophile } } modifier = { factor = 1.5 # Increases the chance if the empire has both egalitarian and xenophile ethics. AND = { OR = { has_ethic = ethic_egalitarian has_ethic = ethic_fanatic_egalitarian } OR = { has_ethic = ethic_xenophile has_ethic = ethic_fanatic_xenophile } } } modifier = { factor = 1.5 # Increases the chance if the empire is fanatic egalitarian. has_ethic = ethic_fanatic_egalitarian } modifier = { factor = 1.25 # Slightly increases the chance if the empire is fanatic xenophile. has_ethic = ethic_fanatic_xenophile } } </pre> ===== Example #2: Traits ===== In this example, the triggers will use the traits of the leader in research and the ruler of the empire. Namely: * If the leader is maniacal, then the chance should be increased. * If the leader has an expertise, the chance should be reduced. * If the leader is spark of genius, increase the chances even more. * If the leader has a modifier that affects the age of the leader, then decrease the chance. Decrease the chance even more if the age went down. * If the leader has arrested development, but no expertise, then increase the chance. == Advanced Tech Modding == '''NOTE: All of these can crash your game on launch!''' === Tiers === It is possible to add and modify tiers in the game, the game requires them to be in order (you cannot go from 5 to 7, etc.) meaning that they are semi-hardcoded and require careful handling. If you load a game with a missing tier; your game will crash on load. From: {{path|common/technology/tier/00_tiers.txt}} <pre> 0 = { # Tier 0 } 1 = { # Tier 1 previously_unlocked = 0 } 2 = { # Tier 2 previously_unlocked = 6 # Must have researched atleast 6 Tier 1 technologies } 3 = { # Tier 3 previously_unlocked = 6 } 4 = { # Tier 4 previously_unlocked = 6 } 5 = { # Tier 5 previously_unlocked = 6 } </pre> === Categories === It is possible to modify categories in the game, however as of now it is impossible to add new ones, meaning that only their icon can be edited. From: {{path|common/technology/category/00_category.txt}} <pre> materials = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_materials.dds" } propulsion = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_propulsion.dds" } voidcraft = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_voidcraft.dds" } industry = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_industry.dds" } field_manipulation = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_field_manipulation.dds" } particles = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_particles.dds" } computing = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_computing.dds" } psionics = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_psionics.dds" } new_worlds = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_new_worlds.dds" } statecraft = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_statecraft.dds" } biology = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_biology.dds" } military_theory = { icon = "gfx/interface/icons/traits/leader_traits/leader_trait_expertise_military_theory.dds" } </pre> === Tech tags === As already mentioned above tech tags <code>is_rare</code> and <code>is_dangerous</code> are only cosmetic and do not effect the game. "<kbd>is_rare</kbd>" (changing the tech's graphics to purple) does not inherently reduce the chance of rolling it, nor does "<kbd>is_dangerous</kbd>" (changing the tech's graphics to red) create danger on its own. ==== Rare Technologies ==== To make a rare technology "rare", you will need to add the following lines of code to the weight_modifier. <pre> modifier = { factor = @ap_technological_ascendancy_rare_tech has_ascension_perk = ap_technological_ascendancy } </pre> ==== Dangerous Technologies ==== Dangerous technologies are more complicated and require event modding to work. For more see [[Event modding]] or alternatively direct at {{path|events/crisis_trigger_events.txt}}. == References == <references /> {{ModdingNavbox}} [[Category:模组制作]]
摘要:
请注意您对群星百科的所有贡献都被认为是在知识共享署名-非商业性使用-相同方式共享下发布,请查看在
群星百科:版权
的细节。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源。
未经许可,请勿提交受版权保护的作品!
为防止机器编辑,请完成下方验证
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
Template:Clear
(
编辑
)
Template:Hatnote
(
编辑
)
Template:Main
(
编辑
)
Template:ModdingNavbox
(
编辑
)
Template:Navbox
(
编辑
)
Template:Navboxgroup
(
编辑
)
Template:Path
(
编辑
)
Template:Version
(
编辑
)
×
登录
密码
记住登录
加入群星百科
忘记密码?
其他方式登录