Idea修改:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.5
第7行: 第7行:


==类别Categories==
==类别Categories==
 创意可以分为三 类,即民族精神、设计产商和部长,每一类通常都扮演着不同的角色。
 创意可以分为三 个主要 ,即民族精神、设计产商和部长,每一类 通常都扮演着不同的角色。


 您也可以通过在您的mod的common/idea_tags文件夹中添加一个自定义文件来添加你自己的“类别”(创意类别)。
 您也可以通过在您的mod的common/idea_tags文件夹中添加一个自定义文件来添加你自己的“类别”(创意类别)。

2021年9月27日 (一) 01:53的版本


快速检查单

  • /Hearts of Iron IV/common/ideas创建一个文件
  • 添加本地化

类别Categories

创意可以分为三个主要类别,即民族精神、设计产商和部长,每一类别通常都扮演着不同的角色。

您也可以通过在您的mod的common/idea_tags文件夹中添加一个自定义文件来添加你自己的“类别”(创意类别)。

所有类别将包含在“idea_categories”顶部元素(文件夹)中,并将包含:

  • 最多6个插槽;每个插槽将包含一个创意(内阁)
  • 把创意(内阁)装配到插槽时将支付的费用(通常是PP)
  • 从插槽中销去已装配的创意时将支付的移除费用

实例如下

idea_categories = {
    $category {
        slot = $slot
        cost = 30
        removal_cost = 10
    }
}

然后,创意将会通过插槽(若该插槽允许把创意映射到类别)调用类别

ideas = {

  $slot= { 
      $idea = {
         picture = $picture
         traits = { $trait }
      }
  }

}

小结,在UI(用户界面)中:

  • 类别将在政治窗口中产生新的一行
  • 插槽将成为新的类别之元素内的一个元素
  • 创意将可作为可选项中的一个项装配到这个插槽上

隐式创意Hidden Ideas

隐式创意是一种特殊的民族精神,如果你想给一个国家一个隐藏的修饰,可以使用它。

例如,如果您希望由于不可预见的后果而秘密减少某个国家的可招募pop,您可以这样做(在country={}括号下):

hidden_ideas = {
      XXX_hidden_problem = {
           modifier = {
                conscription = -0.01 # Reduces recruitable manpower by 1%
           }
      }
 }

绑定Allowed

“绑定”决定了一个国家是否有这种想法。对于部长和设计产商来说尤其重要,因为不放置绑定标签将意味着游戏中的每个国家都可以访问该设计产商或部长。

对于大多数部长和设计产商来说,original_tag=XXX通常就足够了,因为一般只希望一个国家(以及可能的内战)能够访问该部长或设计产商。

allowed = { original_tag = DEN }

内战绑定Allowed Civil War

绑定的一种变体,用于确定在内战期间是否可以将一个创意转移到叛乱国家。

这主要有助于确保如果一个民主国家发生了共产主义叛乱,那么民主的那一半人不会保留任何给这个国家带来共产主义的思想:

allowed_civil_war = { has_government = communism }

可用Available

可用性表示一个国家是否可以选择它。如果某个国家不符合“可用”下详述的要求,则您将无法选择该国家(如果是部长/设计产商),或者该创意将被取消(国家精神)。

例如,若您想要一个创意,您只能在和平的时候选择:

available = { has_war = no }

可见Visible

例如,民主政府要看到这个创意:

visible = { has_government = democratic }

取消Cancel

取消确定在满足某些条件时是否取消某个创意。

若您不希望您的国家在获得自由后继续有“添加自治”的创意,这是为您准备的:

cancel = { has_autonomy_level = free }

Picture

Format

Remember that file format needs to be either TGA or DDS. More details on Image file formats section

About sizes:

  • National Spirits should be 60 x 68
  • Designers should be 64 x 64
  • Ministers should be 65 x 67

Declaration

The 'picture' attribute is used to identify a SpriteType to use. Each spriteType must be declared inside the spriteTypes top element in a .gfx file contained in your mod in the inferface/ root folder.

For this declaration :

  • name will be referenced in ideas for usage
  • texturefile points to the dds file in your mod
spriteTypes = {	
    spriteType = {
        name = "GFX_idea_$pictureName"
        texturefile = "gfx/interface/ideas/$fileName.dds"
    }
}

Note that : pictureName and fileName may be different

Usage

Once declared correctly, you may reference, with the 'picture' attribute, within your idea.

Important note : The GFX_idea prefix is used internally by the game engine. So your reference must be on $pictureName only. For the previous case, that would be '$pictureName' and not 'GFX_idea_$pictureName'

An exemple below

$ideaName = {
    picture = $pictureName
    traits = { communist_revolutionary }
    ai_will_do = {
        factor = 0
    }
}

Ledger

This is only needed for theorists and high command ideas so that they appear under the correlating intel ledgers. Options include: army, navy, and air.

ledger = army

Modifiers

Modifiers add modifier's to the country that has them, they can be positive or negative. Modifiers are listed one after another in a modifier's bracket. Here's an example of an idea that would increase a country's Recruitable Population as well as lowering its factory output:

modifier = {
     conscription = 0.1 #Adds 10% recruitable pop
     industrial_capacity_factory = -0.05 #Reduces factory output by 5%
}

Equipment Bonus

Similar to a modifier, equipment bonuses add or subtract values related to specific equipment. For example, if you wanted to make your subs have more attack at the expense of your capital ships you could do this:

equipment_bonus = {
      capital_ship = {
           attack = -0.1 # Reduces capital ship attack by 10%
      }
      submarine = {
           attack = 0.25 # Increases submarine attack by 25% instant = yes
      }
}

With instant=yes the bonus is applied to all equipment immediately, and with "instant=no" (or without this option) only equipments researched after this effect will get the bonus

Research Bonus

Determines if the idea gives you any research bonuses. If I wanted to give land doctrine research time reduction, I could do so like this:

research_bonus = { land_doctrine = 0.1 } #Gives a 10% reduction to land doctrine research time

You can also make it take longer to research something instead by making the number negative instead. (-0.1 would make it take 10% longer instead)

Traits

Generally used for designers and ministers, traits determines what name appears under the minister/designer, (e.g Fast Tank Manufacturer or Fascist Demagogue) and can also give modifiers/equipment bonuses to a country. To check what trait gives, look at the 00_traits file located in common/country_leader, again, make sure to create your own file if you wish to create your own traits. Ideas can have multiple traits, but the names may not fit correctly due to how they are formatted. If I wanted to create a communist revolutionary I would do so like this:

traits = { communist_revolutionary }

On Add

Sometimes you want an effect to occur the instant that you pick an idea. To do this, you use on_add followed by what you want to happen. Be warned, this effect will happen every time that you pick the idea, so if you don't want something to happen each time you pick an idea, be sure to build in a flag, variable or some-such countermeasure to ensure that a player cannot infinitely cause the effect to occur. Below is an example of how an idea can add rubber to synthetic factories when it is picked:

 on_add = {
   if = {
     limit = { NOT = { has_country_flag = chosen_idea } }
     modify_building_resources = {
       building = synthetic_refinery
       resource = rubber
       amount = 2
     }
     set_country_flag = chosen_idea
   }
 }

Cost

Determines how much an idea costs, default is 150pp. An idea that you can get for free looks like this:

cost = 0

Removal Cost

A rarely used stat that determines how much political power it costs to remove an idea.

removal_cost = 150

Designer

Unlike other ideas, designers need to be designated as such.

XXX_generic_designer = {
     designer = yes
}

AI Will Do

Determines if an AI will pick an idea, the higher the value the more likely they are to do so. A value of 0 means that they will never pick an idea.

ai_will_do = {
     factor = 0
}

Full Idea Example

An example of an idea that uses as many things as possible:

 XXX_example_idea = {
      designer = no			
      
      picture = generic_coastal_navy
      
      cost = 200
      removal_cost = 1000
      
      available = {
           has_government = fascism
      }
      
      allowed = {
           has_war = yes
      }
      		
      allowed_civil_war = {
           always = yes
      }
      		
      on_add = {
 	    if = {
		limit = { NOT = { has_country_flag = chosen_idea } }
		modify_building_resources = {
		building = synthetic_refinery
			resource = rubber
			amount = 2
		}
		set_country_flag = chosen_idea
	    }
     }
      
      modifier = {
           license_armor_purchase_cost = -0.5
      }
      
      research_bonus = {
           land_doctrine = -0.05
      }
      		
      equipment_bonus = {
           capital_ship = {
                attack = 0.1
           }
           screen_ship = {
                sub_detection = 0.1 build_cost_ic = -0.1
           }
           submarine = {
                sub_visibility = -0.1
           }
      }
      
      traits = { fascist_demagogue }
      
      ai_will_do = {
           factor = 1
      }
}

Implementing An Idea

Ideas can be added to a country in different ways, depending on the type of idea and the intent behind adding it. Ministers and designers will be added automatically based upon their "allowed" area. National spirits can be added in the country's history file, which will add it upon loading, through a national focus, or through an event. There are a couple of ways to add or remove ideas from a nation.

Add Idea

You can add an idea to a country by using the following line:

add_ideas = example_idea

Remove Idea

You can remove an idea from a country by using the following line:

remove_ideas = example_idea

Swap Ideas

Sometimes you want to switch out one idea for another. If the swapped ideas have the same localization name, the game will assume that you are modifying that idea rather than replacing one with another. Here's an example of how to swap ideas:

swap_ideas = {
     remove_idea = example_idea1
     add_idea = example_idea2
}