今天小編為大家?guī)淼氖俏拿?魔法兵種創(chuàng)建方法一覽,教你創(chuàng)建一個會閃電術(shù)的魔法兵種!感興趣的小伙伴們快來看看吧!
魔法兵種創(chuàng)建方法一覽
我感覺大家都猜到了,什么嘛,不就是用宗教單位的模型做個兵種嘛,很簡單的嘛。是的,大家都知道文明6新加入的宗教戰(zhàn)斗還是挺炫酷的,電閃雷鳴什么,這里就是準備教大家用宗教單位的模型創(chuàng)建一個新的兵種。
至于截圖我就不放了,和大家游戲里宗教單位戰(zhàn)斗的效果一毛一樣,不過這次魔法師們則是和普通遠程戰(zhàn)斗單位一樣可以攻擊普通單位了。
首先打開Sid Meier's Civilization VI\Base\Assets\Gameplay\Data下的Units.xml
下面所有紅字部分都是我們需要添加的代碼,就不再一一指明了。
首先我們再
搜索<Types>
<Types>
<Row Type="UNIT_WIZARD" Kind="KIND_UNIT"/>
<!-- Civilian-->
<Row Type="UNIT_SETTLER" Kind="KIND_UNIT"/>
<Row Type="UNIT_BUILDER" Kind="KIND_UNIT"/>
<Row Type="UNIT_TRADER" Kind="KIND_UNIT"/>
<Row Type="UNIT_MISSIONARY" Kind="KIND_UNIT"/>
<Row Type="UNIT_APOSTLE" Kind="KIND_UNIT"/>
然后寫入AI
搜索<UnitAiInfos>
<UnitAiInfos>
<Row UnitType="UNIT_WIZARD" AiType="UNITAI_COMBAT"/>
<Row UnitType="UNIT_WIZARD" AiType="UNITTYPE_RANGED"/>
<Row UnitType="UNIT_WIZARD" AiType="UNITTYPE_LAND_COMBAT"/>
<!-- Civilian-->
<Row UnitType="UNIT_SETTLER" AiType="UNITAI_SETTLE"/>
<Row UnitType="UNIT_SETTLER" AiType="UNITTYPE_CIVILIAN"/>
<Row UnitType="UNIT_BUILDER" AiType="UNITAI_BUILD"/>
<Row UnitType="UNIT_BUILDER" AiType="UNITTYPE_CIVILIAN"/>
<Row UnitType="UNIT_TRADER" AiType="UNITTYPE_CIVILIAN"/>
然后選擇替代兵種
搜索<UnitReplaces>
<UnitReplaces>
<Row CivUniqueUnitType="UNIT_GREEK_HOPLITE" ReplacesUnitType="UNIT_SPEARMAN"/>
<Row CivUniqueUnitType="UNIT_EGYPTIAN_CHARIOT_ARCHER" ReplacesUnitType="UNIT_HEAVY_CHARIOT"/>
<Row CivUniqueUnitType="UNIT_SPANISH_CONQUISTADOR" ReplacesUnitType="UNIT_MUSKETMAN"/>
<Row CivUniqueUnitType="UNIT_ROMAN_LEGION" ReplacesUnitType="UNIT_SWORDSMAN"/>
添加單位類型
搜索<TypeTags>
<TypeTags>
<Row Type="UNIT_WIZARD" Tag="CLASS_RANGED"/>
<Row Type="UNIT_BARBARIAN_HORSEMAN" Tag="CLASS_LIGHT_CAVALRY"/>
<Row Type="UNIT_BARBARIAN_HORSE_ARCHER" Tag="CLASS_RANGED_CAVALRY"/>
<Row Type="UNIT_SCOUT" Tag="CLASS_RECON"/>
<Row Type="UNIT_SCOUT" Tag="CLASS_REVEAL_STEALTH"/>
<Row Type="UNIT_RANGER" Tag="CLASS_RECON"/>
<Row Type="UNIT_WARRIOR" Tag="CLASS_MELEE"/>
<Row Type="UNIT_SWORDSMAN" Tag="CLASS_MELEE"/>
<Row Type="UNIT_MUSKETMAN" Tag="CLASS_MELEE"/>
然后就是添加具體的單位數(shù)據(jù)了,搜索<Units>
<Units>
<Row UnitType="UNIT_WIZARD" BaseMoves="2" Cost="50" AdvisorType="ADVISOR_CONQUEST" BaseSightRange="2" ZoneOfControl="false" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_LAND_COMBAT" Name="LOC_UNIT_WIZARD_NAME" Description="LOC_UNIT_WIZARD_DESCRIPTION" PurchaseYield="YIELD_GOLD" PromotionClass="ROMOTION_CLASS_RANGED" Maintenance="1" Combat="15" RangedCombat="25" Range="2" PrereqTech="TECH_ARCHERY" MandatoryObsoleteTech="TECH_BALLISTICS"/>
<Row UnitType="UNIT_SETTLER" BaseMoves="2" Cost="80" AdvisorType="ADVISOR_GENERIC" BaseSightRange="3" ZoneOfControl="false" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_CIVILIAN" FoundCity="true" PopulationCost="1" PrereqPopulation="2" Name="LOC_UNIT_SETTLER_NAME" Description="LOC_UNIT_SETTLER_DESCRIPTION" CanCapture="False" CostProgressionModel="COST_PROGRESSION_PREVIOUS_COPIES" CostProgressionParam1="20" PurchaseYield="YIELD_GOLD" PseudoYieldType="SEUDOYIELD_UNIT_SETTLER"/>
<Row UnitType="UNIT_BUILDER" BaseMoves="2" Cost="50" AdvisorType="ADVISOR_GENERIC" BaseSightRange="2" ZoneOfControl="false" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_CIVILIAN" Name="LOC_UNIT_BUILDER_NAME" Description="LOC_UNIT_BUILDER_DESCRIPTION" CanCapture="False" CostProgressionModel="COST_PROGRESSION_PREVIOUS_COPIES" CostProgressionParam1="4" PurchaseYield="YIELD_GOLD" BuildCharges="3"/>
<Row UnitType="UNIT_TRADER" BaseMoves="2" IgnoreMoves="true" Cost="40" AdvisorType="ADVISOR_GENERIC" BaseSightRange="2" ZoneOfControl="false" Domain="DOMAIN_LAND" FormationClass="FORMATION_CLASS_CIVILIAN" Name="LOC_UNIT_TRADER_NAME" Description="LOC_UNIT_TRADER_DESCRIPTION" CanCapture="False" CostProgressionModel="COST_PROGRESSION_GAME_PROGRESS" CostProgressionParam1="400" PurchaseYield="YIELD_GOLD" PseudoYieldType="SEUDOYIELD_UNIT_TRADE" MakeTradeRoute="true" PrereqCivic="CIVIC_FOREIGN_TRADE"/>
這里的數(shù)據(jù)比較多,來一一說明一下。
UnitType="UNIT_WIZARD"這里不用多說,這行代碼是哪個單位就靠它來識別了
BaseMoves="2"移動力為2
Cost="50"生產(chǎn)消耗的錘子為50
AdvisorType="ADVISOR_CONQUEST"這里應(yīng)該影響的是顧問建議的類型,沒啥用
BaseSightRange="2"視野范圍為2
ZoneOfControl="false"是否有ZOC,也就是游戲里走到近戰(zhàn)單位邊上會不能繼續(xù)移動,遠程單位一般沒有ZOC功能。如果需要帶有ZOC則把"false"改成“ture”
Domain="DOMAIN_LAND"表示這是一個陸地單位
FormationClass="FORMATION_CLASS_LAND_COMBAT"表示這是一個陸軍戰(zhàn)斗單位
Name="LOC_UNIT_WIZARD_NAME" 單位名稱,可以在對應(yīng)的語言翻譯文件里關(guān)聯(lián),比如漢化就是需要對應(yīng)這個名稱
Description="LOC_UNIT_WIZARD_DESCRIPTION" 單位簡介,作用同上,建造列表上面的說明。
PurchaseYield="YIELD_GOLD"可以用金錢購買的意思,需要需要改成用信仰購買的話把"YIELD_GOLD"改成"YIELD_FAITH"
PromotionClass="ROMOTION_CLASS_RANGED"單位晉升類型,就是單位升級后可以選擇的那個列表,這里是遠程單位和弓箭手一樣的類型。
Maintenance="1"維護費為1
Combat="15" 單位的戰(zhàn)斗力為15,對于遠程單位來講就是防御力,近戰(zhàn)單位進攻防御都靠他
RangedCombat="25"遠程攻擊力位25
Range="2" 射程2,一般來講只有遠程單位需要它
PrereqTech="TECH_ARCHERY"前提科技弓箭,為啥?因為這段文字完全是從弓箭手那里復制過來的。。。不需要的可以直接刪除前提科技則開局即可建造
MandatoryObsoleteTech="TECH_BALLISTICS"過時科技,同上
如需要添加為某個文明的特色單位,則需要在加上TraitType="XXXXX",這里的XXXX指的是對應(yīng)文明的或者領(lǐng)袖的特性,不是讓你寫5個X,當然你也可以完全寫個新的特性然后加到某個文明、城邦甚至小野都可以。
如需要添加需求的資源類型,則需要在里面機上StrategicResource="XXXXX"同上這里不是讓你寫5個X,而是某種資源的代碼。。。不寫則表示不需要戰(zhàn)略資源。
接著添加單位升級信息,搜索<UnitUpgrades>
<UnitUpgrades>
<Row Unit="UNIT_WIZARD" UpgradeUnit="UNIT_CROSSBOWMAN"/>
<!--Recon-->
<Row Unit="UNIT_SCOUT" UpgradeUnit="UNIT_RANGER"/>
<!--Melee-->
<Row Unit="UNIT_WARRIOR" UpgradeUnit="UNIT_SWORDSMAN"/>
<Row Unit="UNIT_SWORDSMAN" UpgradeUnit="UNIT_MUSKETMAN"/>
<Row Unit="UNIT_MUSKETMAN" UpgradeUnit="UNIT_INFANTRY"/>
<Row Unit="UNIT_SPEARMAN" UpgradeUnit="UNIT_PIKEMAN"/>
<Row Unit="UNIT_PIKEMAN" UpgradeUnit="UNIT_AT_CREW"/>
如果需要添加建筑信息,比如需要寺廟才能建造,搜索<Unit_BuildingPrereqs>
<Unit_BuildingPrereqs>
<Row Unit="UNIT_WIZARD" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Unit="UNIT_MISSIONARY" PrereqBuilding="BUILDING_SHRINE"/>
<Row Unit="UNIT_APOSTLE" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Unit="UNIT_APOSTLE" PrereqBuilding="BUILDING_STAVE_CHURCH"/>
<Row Unit="UNIT_INQUISITOR" PrereqBuilding="BUILDING_TEMPLE"/>
<Row Unit="UNIT_INQUISITOR" PrereqBuilding="BUILDING_STAVE_CHURCH"/>
<Row Unit="UNIT_MILITARY_ENGINEER" PrereqBuilding="BUILDING_ARMORY"/>
<Row Unit="UNIT_ARCHAEOLOGIST" PrereqBuilding="BUILDING_MUSEUM_ARTIFACT" NumSupported="1"/>
</Unit_BuildingPrereqs>
到這里units.xml就修改完了,這個時候這個單位已經(jīng)存在于你的游戲里了,只是還沒有制定模型、圖標、對應(yīng)的漢化單位名稱。所以我們繼續(xù)。
下面是找到D:\Sid Meier's Civilization VI\Base\Assets\Text\Translations,如果你需要改簡體中文的,打開Vanilla_zh_Hans_CN.xml,其他語言請打開對應(yīng)文件。
<GameData>
<LocalizedText>
<Replace Tag="LOC_UNIT_WIZARD_NAME" Language="zh_Hans_CN">
<Text>魔法師</Text>
</Replace>
<Replace Tag="LOC_UNIT_WIZARD_DESCRIPTION" Language="zh_Hans_CN">
<Text>用魔法戰(zhàn)斗的遠程單位</Text>
</Replace>
<Replace Tag="LOC_BUILDING_TLACHTLI_NAME" Language="zh_Hans_CN">
<Text>蹴球場</Text>
</Replace>
<Replace Tag="LOC_BUILDING_HUEY_TEOCALLI_NAME" Language="zh_Hans_CN">
<Text>休伊神廟</Text>
</Replace>
想改成什么名字可以自行替換。
接下來的重點就是單位模型,畢竟模型對了才叫魔法兵種嘛。
打開Sid Meier's Civilization VI\Base\ArtDefs下的UNIT.ARTDEF
搜索UNIT_APOSTLE,這是使徒的模型代碼:
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="Scattered"/>
<m_RootCollectionName text="UnitFormationTypes"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>false</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Formation"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitCombat"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>false</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="UnitCombat"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitFormationTypes"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="EscortFormation"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="UNIT_ANCIENTEMBARK"/>
<m_RootCollectionName text="Units"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text="Units"/>
<m_ParamName text="EmbarkedUnit"/>
</Element>
<Element class="AssetObjects::BoolValue">
<m_bValue>false</m_bValue>
<m_ParamName text="DoNotDisplayCharges"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitCulture"/>
<m_ArtDefPath text="Cultures.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Culture"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="Era"/>
<m_ArtDefPath text="Eras.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Era"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="Units"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="roxyUnit"/>
</Element>
<Element class="AssetObjects::BoolValue">
<m_bValue>false</m_bValue>
<m_ParamName text="layDeathOnDestroy"/>
</Element>
<Element class="AssetObjects::IntValue">
<m_nValue>-500</m_nValue>
<m_ParamName text="DisplayLevel"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Members"/>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::FloatValue">
<m_fValue>1.000000</m_fValue>
<m_ParamName text="Scale"/>
</Element>
<Element class="AssetObjects::IntValue">
<m_nValue>4</m_nValue>
<m_ParamName text="Count"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="Apostle"/>
<m_RootCollectionName text="UnitMemberTypes"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text="Units"/>
<m_ParamName text="Type"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Members1"/>
</Element>
</Element>
<Element>
<m_CollectionName text="Audio"/>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text=""/>
<m_ParamName text="XrefName"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Entry"/>
</Element>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text="Apostle"/>
<m_ParamName text="XrefName"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="MISSIONARY"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="UNIT_APOSTLE"/>
</Element>
直接把上面一大段代碼全部復制下來,在下面粘貼。
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="Scattered"/>
<m_RootCollectionName text="UnitFormationTypes"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>false</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Formation"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitCombat"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>false</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="UnitCombat"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitFormationTypes"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="EscortFormation"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="UNIT_ANCIENTEMBARK"/>
<m_RootCollectionName text="Units"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text="Units"/>
<m_ParamName text="EmbarkedUnit"/>
</Element>
<Element class="AssetObjects::BoolValue">
<m_bValue>false</m_bValue>
<m_ParamName text="DoNotDisplayCharges"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="UnitCulture"/>
<m_ArtDefPath text="Cultures.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Culture"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="Era"/>
<m_ArtDefPath text="Eras.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="Era"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text=""/>
<m_RootCollectionName text="Units"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text=""/>
<m_ParamName text="roxyUnit"/>
</Element>
<Element class="AssetObjects::BoolValue">
<m_bValue>false</m_bValue>
<m_ParamName text="layDeathOnDestroy"/>
</Element>
<Element class="AssetObjects::IntValue">
<m_nValue>-500</m_nValue>
<m_ParamName text="DisplayLevel"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Members"/>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::FloatValue">
<m_fValue>1.000000</m_fValue>
<m_ParamName text="Scale"/>
</Element>
<Element class="AssetObjects::IntValue">
<m_nValue>4</m_nValue>
<m_ParamName text="Count"/>
</Element>
<Element class="AssetObjects::ArtDefReferenceValue">
<m_ElementName text="Apostle"/>
<m_RootCollectionName text="UnitMemberTypes"/>
<m_ArtDefPath text="Units.artdef"/>
<m_CollectionIsLocked>true</m_CollectionIsLocked>
<m_TemplateName text="Units"/>
<m_ParamName text="Type"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Members1"/>
</Element>
</Element>
<Element>
<m_CollectionName text="Audio"/>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text=""/>
<m_ParamName text="XrefName"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="Entry"/>
</Element>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects::StringValue">
<m_Value text="Apostle"/>
<m_ParamName text="XrefName"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="MISSIONARY"/>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="UNIT_WIZARD"/>
</Element>
重點是紫色部分的單位代碼要改成我們創(chuàng)建的自定義單位的代碼也就是UNIT_WIZARD,其他部分原封不動即可。
最后需要制定單位的圖標,單位的圖標修改是在Sid Meier's Civilization VI\Base\Assets\UI\Icons下的Icons_UnitFlags.xml、Icons_UnitPortraits.xml、Icons_Units.xml,似乎版子里已經(jīng)有大神講過怎么修改了,這里就不贅述了。其實修改代碼很簡單,無非是直接模仿原來的格式復制下來再改個名字有需要的話微調(diào)一下數(shù)值什么的。
到此為止我們就大功告成了,進入游戲里你就會發(fā)現(xiàn)一個新的單位魔法師,可以用閃電劈人。