91游戏 · 游戏攻略

《王权2:幻想王国》mod技术初探

2014-03-29 01:58:55 作者:webadmin

王权2:典藏版
王权2:典藏版

策略战棋

查看

一、先将游戏目录下⁄resource⁄resource.pak内文件全部解压缩到当前目录,并将文件resource.pak更名
以下分号后为注释,请请注意本人并未针对以下每项进行测试,具体效果请自己测试

二、⁄resource⁄entity⁄
数据和定义主要都存放在*.def文件中

以⁄resource⁄entity⁄buildings⁄castle⁄castle.def为例


;#line 18:         (include "extenders/upgrades.inc")
;#line 18: /entity/buildings/castle/extenders/upgrades.inc BEGIN
{"Upgrades"        ;升级部分
        {available
                {;1升第一级
                        {money 75}
                        {health 1000}                                ;升级增加的生命
                        {building_value 1}
                        {cost                                        ;升级消耗的金币
                        "money" 2000
                        }
                }
                {;2?囡沭彘?
                        {money 150}
                        {health 1500} ;念徉怆弪 蹊蝻铊眚钼       
                        {building_value 1}
                        {cost                                        ;羊铊祛耱?囡疸彘溧
                        "money" 5000
                        }
                }
        }
}


;#line 22:         (include "extenders/guard_point.inc")
;#line 22: /entity/buildings/castle/extenders/guard_point.inc BEGIN
{"guard_point"        ;守卫活动范围
        {ZoneRadius 15.0}
        {GuardRadius 20.0}
}
;#line 22: /entity/buildings/castle/extenders/guard_point.inc END


;#line 23:         (include "extenders/treasures_generator.inc")
;#line 23: /entity/buildings/castle/extenders/treasures_generator.inc BEGIN
{"TreasuresGenerator"
        {PerDay
                "money" 50        ;每日提供的税金
        }
}
;#line 23: /entity/buildings/castle/extenders/treasures_generator.inc END


;#line 26:         (include "extenders/spawner_extender.inc")
;#line 26: /entity/buildings/castle/extenders/spawner_extender.inc BEGIN
{"spawner_extender"        ;自动产生的建筑和单位
        {global_spawn_progs "peasant_house_spawner1 peasant_house_spawner2 peasant_house2_spawner3 peasant_house_spawner4 peasant_house2_spawner5 peasant_mill_spawner6 peasant_mill_spawner7 grave_yard sewers_spawner1 sewers_spawner2 sewers_spawner3 sewers_spawner4 sewers_spawner5 sewers_spawner6 taxer_spawner1 taxer_spawner2 taxer_spawner3 guard_spawner1 guard_spawner2 guard_spawner3 peasant_spawner"}
}


;#line 26: /entity/buildings/castle/extenders/spawner_extender.inc END

        {"FogVisor" {radius 50}}        ;建筑的视野
       

 


三、⁄resource⁄gameData
数据部分二

1.  ⁄resource⁄gameData⁄inventions⁄inventions.graphml
定义各个建筑内可升级的项目
以市场上的血瓶为例

Building=market;         ;建筑
Time = 15;         ;升级时间
Building Level=1;</y:AttributeLabel>
            <y:MethodLabel/>
          </y:UML>
        </y:UMLClassNode>
      </data>
      <data key="d1"/>
    </node>
    <node id="n10">                ;估计为项目代码
      <data key="d0">
        <y:UMLClassNode>
          <y:Geometry height="146.0" width="177.0" x="2560.13279564611" y="116.22777022776273"/>
          <y:Fill color="#008000" transparent="false"/>
          <y:BorderStyle color="#000000" type="line" width="1.0"/>
          <y:NodeLabel alignment="center" autoSizePolicy="content" f f f hasBackgroundColor="false" hasLineColor="false" height="19.92626953125" modelName="internal" modelPosition="t" textColor="#000000" visible="true" width="89.0" x="44.0" y="3.0">Health potion</y:NodeLabel>
          <y:UML clipC c omitDetails="false" stereotype="" use3DEffect="true">
            <y:AttributeLabel>Cost money=150;         ;升级花费

 

2.  ⁄resource⁄gameData⁄magic⁄spells.xml
定义国家法术的基本属性
以治疗法术为例

                <spell name="magic_heal" cost_money="250" ;花费

相关文章