民族精神修改

本頁面所適用的版本可能已經過時,最後更新於1.5


快速檢查單

  • /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 }

圖標

格式

要記得文件格式需要是 TGA 或者 DDS. More details on Image file formats section

大小需求:

  • 國家精神 60 x 68
  • 設計商 64 x 64
  • 內閣 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會讓擁有它的國家獲得對應的效果,不論好壞。Modifiers要一行行列於modifier的括號內,以下案例是提高徵兵人口並降低工廠產出的modifier:

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

裝備加成

和modifier類似,裝備加成給特定的裝備加上或減去加成。比如說,如果你想讓潛艇攻擊力更高但是導致主力艦攻擊減少你可以:

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

用 instant=yes 後這些加成會立刻給予所有準備,而用"instant=no" (或者留白)裝備只能在獲得加成後研究才有這些加成。

研究加成

決定這個精神能不能給你的研究加成,如果我想讓陸軍學說研究時間減少,可以這樣:

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

你也可以通過負數讓研究時間更長。(-0.1 會讓它需要多10%研究時間)

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

決定了AI會不會選擇這個精神,數值越高越容易選擇,0值即AI永遠不會用它。

ai_will_do = {
     factor = 0
}

完整精神案例

一個儘可能用多功能的精神案例:

 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
      }
}

植入精神

精神可以通過不同方式加到一個國家裡,基於精神種類和加它的用意。部長和設計商會基於他們是"allowed"而被自動添加;國家精神可以通過國家歷史文件修改在開始遊戲時加上它,可以通過國策或者事件加上它。對國家政權來說可以通過各種方法加上或者移除精神。

Add Idea

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

add_ideas = example_idea

移除精神

你可以使用下面的代碼移除一個國家的精神:

remove_ideas = example_idea

替換精神

在有的時候,你會把某個精神替代為另一個精神,如果兩個精神本地化相同的話,遊戲會認為你在更改精神而不是用一個取代另一個。這是一個例子:

swap_ideas = {
     remove_idea = example_idea1
     add_idea = example_idea2
}