骑马与砍杀中文站论坛

 找回密码
 注册(Register!)

QQ登录

只需一步,快速开始

搜索
购买霸主CDKEY 购买战帆CDKEY
查看: 31906|回复: 35

[MOD相关] 【原创】骑砍2添加城市教程

[复制链接]

13

主题

211

回帖

122

积分

见习骑士

Rank: 3

UID
756679
第纳尔
1462
精华
0
互助
5
荣誉
3
贡献
0
魅力
1
注册时间
2012-4-19

汉匈决战正版勋章元老骑士勋章

鲜花(14) 鸡蛋(0)
发表于 2020-5-16 00:07:09 | 显示全部楼层 |阅读模式
本帖最后由 菊小隐 于 2020-5-16 00:11 编辑

20200515211637_1.jpg 20200514232317_1.jpg
首先需要控制台DeveloperConsole。进入游戏,开启控制台,移动人物到你想添加城市的位置,输入campaign.get_main_party_position,获取当前XY坐标。同时寻找你想复制的城市/城堡/村庄的名字,记下来。
1、建立文件夹,名称X(新添加城市的名字)。在文件夹内建立SubModule XML文件,创建ModuleData文件夹,创建SceneObj文件夹
2、打开游戏Modules—SandBox—ModuleData文件夹,复制settlements XML文件到你创建的ModuleData文件夹中,重命名为Xsettlements。打开游戏Modules—SandBox—SceneObj文件夹,复制Main_map文件夹到你创建的SceneObj文件夹中。
3、编辑SubModule
<?xml version="1.0" encoding="utf-8"?>
<Module>
        <Name value="X"/>
        <Id value="X"/>
        <Version value="v1.0.0"/>
        <SingleplayerModule value="true"/>
        <MultiplayerModule value="false"/>
        <DependedModules>
                <DependedModule Id="Native"/>
                <DependedModule Id="SandBoxCore"/>
                <DependedModule Id="Sandbox"/>
                <DependedModule Id="CustomBattle"/>
                <DependedModule Id="StoryMode" />               
        </DependedModules>
        <SubModules>
        </SubModules>
        <Xmls>
          <XmlNode>
                <XmlName id="Settlements" path="Xsettlements"/>
                  <IncludedGameTypes>
                        <GameType value = "Campaign"/>
                        <GameType value = "CampaignStoryMode"/>
                  </IncludedGameTypes>
                </XmlNode>
        </Xmls>
</Module>
4、打开游戏Modules—SandBox—ModuleData—Languages—CNs—std_settlements_xml-zho-CN,输入你记下的城市名字,复制ID。
然后打开游戏Modules—SandBox—ModuleData—settlements,查找ID,复制ID信息。例如(我的例子是一个阿塞莱城堡)
<Settlement id="castle_A1" name="{=Settlements.Settlement.name.castle_A1}Tubilis Castle" owner="Faction.clan_aserai_1" posX="274.181" posY="272.167" culture="Culture.aserai" prosperity="930" gate_posX="275.4893" gate_posY="271.7934">
    <Components>
      <Town id="castle_comp_A1" is_castle="true" level="2" background_crop_position="0.0" background_mesh="menu_aserai_3" wait_mesh="wait_aserai_town" gate_rotation="0.908" />
    </Components>
    <Locations complex_template="LocationComplexTemplate.castle_complex">
      <Location id="center" scene_name="aserai_castle_002" scene_name_1="aserai_castle_002" scene_name_2="aserai_castle_002" scene_name_3="aserai_castle_002" />
      <Location id="lordshall" scene_name_1="aserai_castle_keep_a_l1_interior" scene_name_2="aserai_castle_keep_a_l2_interior" scene_name_3="aserai_castle_keep_a_l3_interior" />
      <Location id="prison" scene_name="aserai_dungeon_a" />
    </Locations>
  </Settlement>
下面则是城堡附加村庄的代码(只举一个例子,一般来说城镇附加3个村庄,城堡2个村庄)
<Settlement id="castle_village_A1_1" name="{=Settlements.Settlement.name.castle_village_A1_1}Tubilis" posX="251.632" posY="263.255" culture="Culture.aserai" text="{=Settlements.Settlement.text.castle_village_A1_1}Tubilis is a fishing village where the river that the Aserai call the Gabsa reaches the sea. Villagers sail out onto the calm waters of the gulf to seek tuna, sardines, and shark.">
    <Components>
      <Village id="castle_village_comp_A1_1" village_type="VillageType.fisherman" hearth="148" trade_bound="Settlement.castle_A1" bound="Settlement.castle_A1" background_crop_position="0.214" background_mesh="menu_aserai_village_1" wait_mesh="wait_aserai_village" castle_background_mesh="gui_bg_castle_aserai" />
    </Components>
    <Locations complex_template="LocationComplexTemplate.village_complex">
      <Location id="village_center" scene_name="aserai_village_i" />
    </Locations>
    <CommonAreas>
      <Area type="Pasture" name="{=fOUsLdZR}Pasture" />
      <Area type="Thicket" name="{=66Mzk0NZ}Thicket" />
      <Area type="Bog" name="{=iXA5SttU}Bog" />
    </CommonAreas>
  </Settlement>
将它们复制到你自己创建的Xsettlements中,放在<Settlements>下面。然后修改这段(这步可以直接在你Xsettlements里面复制,但是如果你怕出错就从游戏本体的文件复制到你的文件里)。例如
<Settlement id="X_A1" name="{=*}城市名字" owner="Faction.你想给的家族" posX="横坐标" posY="纵坐标" culture="Culture.国家" prosperity="繁荣度" gate_posX="入口横坐标" gate_posY="入口纵坐标">(用入口原坐标对照城市原坐标,记下坐标差,通过城市新坐标得出入口新坐标)
    <Components>
      <Town id="X_comp_A1" is_castle="true" level="2" background_crop_position="0.0" background_mesh="menu_aserai_3" wait_mesh="wait_aserai_town" gate_rotation="0.908" />
    </Components>(下面的不要动)
    <Locations complex_template="LocationComplexTemplate.castle_complex">
      <Location id="center" scene_name="aserai_castle_002" scene_name_1="aserai_castle_002" scene_name_2="aserai_castle_002" scene_name_3="aserai_castle_002" />
      <Location id="lordshall" scene_name_1="aserai_castle_keep_a_l1_interior" scene_name_2="aserai_castle_keep_a_l2_interior" scene_name_3="aserai_castle_keep_a_l3_interior" />
      <Location id="prison" scene_name="aserai_dungeon_a" />
    </Locations>
  </Settlement>
附加的村庄代码则为
<Settlement id="X_village_A1_1" name="{=*}村庄名字" posX="横坐标" posY="纵坐标" culture="Culture.国家" text="介绍村庄。">
    <Components>
      <Village id="X_village_comp_A1_1" village_type="VillageType.fisherman(这是村庄特产,可以修改)" hearth="148" trade_bound="Settlement.X_A1" bound="Settlement.X_A1" background_crop_position="0.214" background_mesh="menu_aserai_village_1" wait_mesh="wait_aserai_village" castle_background_mesh="gui_bg_castle_aserai" />
    </Components>
    <Locations complex_template="LocationComplexTemplate.village_complex">
      <Location id="village_center" scene_name="aserai_village_i" />
    </Locations>
    <CommonAreas>
      <Area type="Pasture" name="{=fOUsLdZR}Pasture" />
      <Area type="Thicket" name="{=66Mzk0NZ}Thicket" />
      <Area type="Bog" name="{=iXA5SttU}Bog" />
    </CommonAreas>
  </Settlement>
5、打开游戏Modules—SandBox—SceneObj—Main_map—scene.xscene,C++打开比较慢(代码太多了),稍等一会,用VS的话快一些。查找步骤4里面你记下的城市/城堡/村庄ID,复制整个ID下面的代码。一个城市大概有3000多行代码,这个比较麻烦,需要你盯着看(这一步同样可以在你自己的scene.xscene复制,不用开启2个scene.xscene,但是单一scene.xscene复制起来很容易出错)。复制以后,打开你自己建立的SceneObj—Main_map—scene.xscene,找到第27673行</game_entity>(这一行是一个分界,比较明显,要不然一个一个看太麻烦),回车。然后将代码粘贴到27674行。修改game_entity name="X_A1"(村庄同理,一定要填ID)。修改<transform position="横坐标, 纵坐标, Z轴坐标(这个是最麻烦的,现在无法在游戏里面直接看Z轴,只修改XY轴就是把模型平移了,但是由于地图有地形起伏,必须一遍一遍进游戏调整)" rotation_euler="0.000, 0.000, 1.185"/>(这3个数据是用来旋转的,比如城市模型入口朝左,可以通过修改这个让入口朝右)
6、保存并在启动界面开启mod。

最后放一个雪漫城视频






评分

参与人数 1荣誉 +1 第纳尔 +10 收起 理由
Aomine Daiki + 1 + 10 感谢您对骑砍中文站的支持!

查看全部评分

鲜花鸡蛋

方骑骑士  在2022-9-29 05:46  送朵鲜花  并说:我非常同意你的观点,送朵鲜花鼓励一下
Notealot  在2020-5-22 16:50  送朵鲜花  并说:我非常同意你的观点,送朵鲜花鼓励一下
rainyboy27  在2020-5-18 04:14  送朵鲜花  并说:我非常同意你的观点,送朵鲜花鼓励一下
temple910518  在2020-5-16 10:29  送朵鲜花  并说:感谢分享!

13

主题

211

回帖

122

积分

见习骑士

Rank: 3

UID
756679
第纳尔
1462
精华
0
互助
5
荣誉
3
贡献
0
魅力
1
注册时间
2012-4-19

汉匈决战正版勋章元老骑士勋章

鲜花(14) 鸡蛋(0)
 楼主| 发表于 2020-5-16 10:57:00 | 显示全部楼层
temple910518 发表于 2020-5-16 10:29
感谢,正研究增加新阵营新城镇,楼主的教程太及时了。

期待新阵营

13

主题

211

回帖

122

积分

见习骑士

Rank: 3

UID
756679
第纳尔
1462
精华
0
互助
5
荣誉
3
贡献
0
魅力
1
注册时间
2012-4-19

汉匈决战正版勋章元老骑士勋章

鲜花(14) 鸡蛋(0)
 楼主| 发表于 2020-5-20 21:30:08 | 显示全部楼层
1584776265 发表于 2020-5-20 20:37
那个坐标差是怎么算出来的?直接减?

对,先把原来的坐标差算出来,再用新的坐标算。

13

主题

211

回帖

122

积分

见习骑士

Rank: 3

UID
756679
第纳尔
1462
精华
0
互助
5
荣誉
3
贡献
0
魅力
1
注册时间
2012-4-19

汉匈决战正版勋章元老骑士勋章

鲜花(14) 鸡蛋(0)
 楼主| 发表于 2020-5-22 18:36:32 | 显示全部楼层
1584776265 发表于 2020-5-22 15:51
迷茫 麻烦楼主说的更详细一点!!!剩下的都会了

就是已知城市原坐标X1,Y1,城市原入口坐标GX1,GY1,现在知道了城市新坐标X2,Y2,求入口新坐标GX2,GY2。计算方法就是X1-GX1=a(a正负数都有可能),X2+a=GX2。那么同理GY2也是。

13

主题

211

回帖

122

积分

见习骑士

Rank: 3

UID
756679
第纳尔
1462
精华
0
互助
5
荣誉
3
贡献
0
魅力
1
注册时间
2012-4-19

汉匈决战正版勋章元老骑士勋章

鲜花(14) 鸡蛋(0)
 楼主| 发表于 2020-5-24 06:53:49 | 显示全部楼层
rendaoqirenju 发表于 2020-5-23 18:50
滚5骨灰级老玩家,跪求楼主发一个链接。。万分感谢。

稍等一等,我把亚马逊做完。这个兵种树还没有添加

13

主题

211

回帖

122

积分

见习骑士

Rank: 3

UID
756679
第纳尔
1462
精华
0
互助
5
荣誉
3
贡献
0
魅力
1
注册时间
2012-4-19

汉匈决战正版勋章元老骑士勋章

鲜花(14) 鸡蛋(0)
 楼主| 发表于 2020-5-30 14:13:31 | 显示全部楼层
liuting814 发表于 2020-5-29 19:56
大佬,按照您的方法,我平移了一个村庄,略微修改了一下坐标Z,村庄倒是紧贴地面了,可是村庄旁边的特产独 ...

修改<game_entity name="map_icons_production_X"的transform position

13

主题

211

回帖

122

积分

见习骑士

Rank: 3

UID
756679
第纳尔
1462
精华
0
互助
5
荣誉
3
贡献
0
魅力
1
注册时间
2012-4-19

汉匈决战正版勋章元老骑士勋章

鲜花(14) 鸡蛋(0)
 楼主| 发表于 2020-5-30 14:15:08 | 显示全部楼层
liuting814 发表于 2020-5-29 19:56
大佬,按照您的方法,我平移了一个村庄,略微修改了一下坐标Z,村庄倒是紧贴地面了,可是村庄旁边的特产独 ...

一般村庄特产都是分abc三个小模型组成,每个前面都带有<game_entity name="map_icons_production_X",修改这个下面的transform position

13

主题

211

回帖

122

积分

见习骑士

Rank: 3

UID
756679
第纳尔
1462
精华
0
互助
5
荣誉
3
贡献
0
魅力
1
注册时间
2012-4-19

汉匈决战正版勋章元老骑士勋章

鲜花(14) 鸡蛋(0)
 楼主| 发表于 2020-6-1 17:47:14 | 显示全部楼层
1584776265 发表于 2020-6-1 16:26
城市新坐标是怎么算出来的?(X2  Y2)

这个是用控制台MOD输入代码得到的,我帖子开头就说了的首先需要控制台DeveloperConsole。进入游戏,开启控制台,移动人物到你想添加城市的位置,输入campaign.get_main_party_position,获取当前XY坐标。

13

主题

211

回帖

122

积分

见习骑士

Rank: 3

UID
756679
第纳尔
1462
精华
0
互助
5
荣誉
3
贡献
0
魅力
1
注册时间
2012-4-19

汉匈决战正版勋章元老骑士勋章

鲜花(14) 鸡蛋(0)
 楼主| 发表于 2020-6-1 19:56:19 | 显示全部楼层
liwxing1224 发表于 2020-6-1 19:11
你们都能看懂吗?我看的眼花 看来我这40的大哥哥是不行了

就是反复复制粘贴比较麻烦就是了
您需要登录后才可以回帖 登录 | 注册(Register!)

本版积分规则

Archiver|手机版|小黑屋|骑马与砍杀中文站

GMT+8, 2025-12-22 08:23 , Processed in 0.125668 second(s), 21 queries , Gzip On, MemCached On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表