• 登录 注册账号
  • 给RTW 1.5增加全新建筑

    [复制链接]
    发表于 2015-2-28 23:21:43 | 显示全部楼层 |阅读模式

    马上注册,结交更多好友,享用更多功能,让你轻松玩转汉魂游戏工坊!

    您需要 登录 才可以下载或查看,没有帐号?注册账号

    x
    freefen 翻译                                         



                                               ADDING GAME BUILDINGS TO RTW

                                               adding game buildings - preparation



    PREPARATION:
    First thing, BACKUP all the files involved. I suggest to backup a copy of the folders, so to be sure you can get back to start if things goes wrong.

    Here is the list of files involved in the process:

    Data\export_descr_buildings.txt
    This file lists all the buildings that can be built during the game, specifying which cultures can build them, the costs and times, features, bonuses and recruitments capabilities.

    Data\text\export_buildings.txt
    here all buildings are given a text description which will appears in game.

    Data\text\building_battle.txt
    here all buildings are given a text description which will NOT appears in game. Its needed to the game.

    Data\settlement_plans\descr_settlement_plan.txt
    Here are listed the primary buildings, and you’ll have to add your new ones there. Are also set the city plans, and all the slots that can be called from the single settlement plan files.

    Data\settlement_plans\[culturetype_settlementtype].txt
    where " settlementtype " stands for each type of settlement in the game, forts and camps included. There you define all building models to be shown in each kind of settlement. You can specify coords and type for all kinda objects, including walls. It can list only models already listed in descr_settlement_plan, so if you want to customize settlements a lot you will have to work on descr_settlement_plan too.

    Data\descr_items.txt
    This file enlist all buildings the game will manage. You need to add here all the new buildings you want to appear in the game. You can also include subfiles there, to keep them separated for culture, for example.

    Data\descr_items.db
    This file is generated by the game when you start it. If there is already a descr_items.db the game will not generate a new one.

    Data\descr_settlement_plan
    this one defines the single elements to be used in every city shown ingame. There are set association with every culture settlement single plans, groups of various building models to be shown in settlements and culture variations.

    Data\descr_building_battle\dbb.*.txt
    Those files enlist all 3d building models to the game. Here are specified the health stats, the different cas models to refer to and some other things.

    PROCESS

    a) ADDING A NEW BUILDING TO THE GAME
    adding a new Game Building
    Lets say you want to add a new building named “MONOLITH”, buildable by Romans and Britons, with two levels named monolith1 and monolith2, which gives a some happiness to settlement population.

    1. Open export_descr-building.txt, scroll to the end of it and add the new building tree. It will look like that:

    Code:
    building monolith
    {
        levels monolith1 monolith2
        {
            monolith1 requires factions { romans, britons }
            {
                capability
                {
                    happiness_bonus bonus 1
                }
                construction 1
                cost 400
                settlement_min town
                upgrades
                {
                    monolith2
                }
            }
            monolith2 requires factions { romans, britons }
            {
                capability
                {
                    happiness_bonus bonus 2
                }
                construction 3
                cost 800
                settlement_min large_town
                upgrades
                {
                }
            }
        }
        plugins
        {
        }
    }



    2. Open export_buildings.txt and add the description lines for the levels of your new building:

    Code:
    {monolith1} The wonderful lunar Monolith!
    {monolith1_desc} The lunar Monolith helps people read at night, so they love it. People is very happy to have it in the settlement.
    {monolith1 _desc_short} The lunar Monolith makes people happy.
    {monolith2} The Unbearable solar Monolith!
    {monolith2_desc} The solar Monolith gives all people a nice tan and makes all them say “Wohooo!”. People is very happy to have it in the settlement and they will love you for building it.
    {monolith2 _desc_short} The solar Monolith makes people happy.
    Add also a line to the name string at the end of the file:
    Code:
    {monolith_name} Wonderful Big Stones – Makes people happy
    3. Add some nice pictures to be seen in your building queue ingame.
    To do so you need to be able to use a graphic editor, like GIMP or Photoshop or something else. Find a nice picture you like and save it as your Building Card Picture with the name
    #roman_monolith1_constructed.tga
    In
    data\ui\roman\buildings
    Then resize to 78x62 pixels. If you are good with graphics add the alpha channel, if you dunno what is it, just forget it. Save that picture as
    #roman_monolith1.tga
    in
    data\ui\roman\buildings
    then make a copy, resize it to 64x51 pixels and save it with the same name in data\ui\roman\buildings\construction

    Do the same in barbarian building folders (as Britons are barbarian) and of course, name them
    #barbarian_etc etc

    At this point you can start the game and if you play as romans or as Britons you’ll find your new building available to be built in your settlements. You can play and benefit all the features of the monolith, but if you enter the settlement in tactical view, you will not see anything like a monolith. To have the monolith around in your battles, you’ll need to create and then add the 3d model to the models db, and that’s what I’m gonna explain now.

    b) ADDING THE 3D MODEL OF THE NEW BUILDING
    If adding a new building to the game was pretty easy, adding a 3d model is all BUT easy. There are two ways I know to go for it, one is complicated, the other is utterly complicated.

    b.1) – Using existing models

    Using existing models
    The complicated way is to use an existing building of the game, which means you will somehow rename an existing building. To do so first thing you have to pick the existing building you want to be your monolith. Lets say you chose the barbarian bardic circle.

    1. Open descr_settlement_plan.txt and first of all add monolith1 and monolith2 to the primary building list.
    Then chose a slot to settle your new building. Slots are prefixed areas in the settlement plans where specific buildings may be built. Given you want the monolith to be buildable in roman and (barbarian) britons settlements, you must pick a slot that is present in both those culture settlements files. You also have to pick slots with adequate dimensions, which means you have to open in 3dmax the bardic_circle and see the dimensions it occupies, or at least check it in descr_settlement_plan.txt. Remember that if you use a slot for that building, you will not be able to build another building in that slot – so if you decide to use lets say the slot_160x128_missiles slot, then you will not be able to build the missile building if you build your monolith.

    Best way is to create a brand new slot for your new building, something like a slot_monolith with the right dimensions. But you’ll have then to find the correct coordinates in romans and barbarian settlements to set your new slot. If you put it on a road, soldiers will run against it and get stuck there.
    So if you go to create your own slot, then you’ll have to add it to all the settlement files you want the monolith to be buildable in.

    2. Once found the right slot for your monolith, add a variant line to it. It will look like that:


    variant
    {
            cultures
            {
                    roman
            barbarian
            }
            buildings
            {
                Monolith monolith1
        }
        bardic_circle_barbarian,                 0,         0,         0,         0               
    }
    variant
    {
            cultures
            {
                    roman
            barbarian
            }
            buildings
            {
                monolith monolith2
            }
        bardic_circle_barbarian,                 0,         0,         0,         0               
    }
    Consider that this way the 3d models shown ingame will be the bardic circle for both levels of your monolith, and for both romans and Britons. Of course you can use different models for cultures and levels if you want, but pay attention to dimensions of the models: if you use a model bigger then the slot you put it in, it may collide with other buildings or block roads.

    In descr_settlement_plan.txt file you can also set the models for the building time of your monolith, or what to show if its not at all built. Here I try to stay at the basics.

    3. Once you added your monolith to a slot and the slot is available in the settlement plans, you have to declare it in data/text/ building_battle.txt
    Easy step here: just add a line like:

    Code:
    {monolith1} My Monolith{monolith2} Again my Monolith
    Those lines never appears in game, ir at least I never saw them. But they are needed to have the building working.

    4. Now you have to include your new building to the models db of the game. To do so, first thing open
    descr_building_battle.txt
    and add the monolith entry like that:


    Code:
    monolith1
    {
        stat_cat large_stone
        localised_name monolith1
        level
        {
            min_health 1
            battle_stats
            item bardic_circle_barbarian
            physical_info        bardic_circle_barbarian_info.CAS
        }
        transition default_large_stone
        level
        {
            min_health 0
            battle_stats
            item                roman_rubble_112x64
            physical_info        info_roman_rubble_112x64.cas
        }
    }

    monolith2
    {
        stat_cat large_stone
        localised_name monolith2
        level
        {
            min_health 1
            battle_stats
            item bardic_circle_barbarian
            physical_info        bardic_circle_barbarian_info.CAS
        }
        transition default_large_stone
        level
        {
            min_health 0
            battle_stats
            item                roman_rubble_112x64
            physical_info        info_roman_rubble_112x64.cas
        }
    }
    At this point, given you used an existing model, there is nothing else you have to do with files. But you have to delete the existing descr_items.db (which you have already backupped, haven’t you?) and then run the game.
    You’ll have some errors, just ctrl-atl-canc and stop the program. If you have made no mistakes, the program creates the new descr_items.db including your monolith.
    Restart the game, and this time there should be no errors. If you play as romans or Britons you’ll be able not just to build the monolith but also to go and see it in your cities in tactical view. O well, you’ll see the bardic_circle, of course, but the cursor will say “Monolith” and you will be happy like the people in your settlement are.

    Ok this was the complicated way, which is not that much because, as I just outlined, you’ll see the same old models in your game. So lets go to see how to add a completely new model to your new building. And, well, it will be not that easy.
    Did I already say that?
    b.2) – Using brand new models

    Using brand new models

    1. To add a brand new model for your monolith, first thing you have to do is to create that model. You can do so by importing an original item form the game that have similar dimensions to the one you want to create and this also keep its own collision INFO file – or go on and create your new model with its own INFO file.

    If you keep and existent INFO file as reference for your new building, just import in 3dsMax the vanilla model and then start to create your own building keeping it within the dimensions of the original item. Once you created your new model, remove the original item and all its textures, add your own textures and finally export it as
    monolith1_high.cas
    Put it in
    Data\MODELS_BUILDING
    And put your textures in
    Data\MODELS_BUILDING\TEXTURES

    If you want to make a new building with its own INFO file, after you create the .cas for your new building you have to create the INFO file for it.
    To know how to do so, lets first explain what are INFO files and how they work. INFO files tell the game some functionalities of the model they refer to. Including their walkable/non walkable areas, if and where the camera will go around them or get through them, and some more complicated features like tunnels, platforms, siege points and the like.
    Here I will explain just the two basic ones needed to create functional INFO files for simple buildings, which are “collision” and “collision_3d” issues.
    - Collisions are simple squares, made on ONE SINGLE element (even better one single polygon) with no holes inside. They define the areas where troops or peasants will NOT be able to walk. If the building is just a cube, the basic collision file is a square a little bigger then the cube base. The units will walk into it and stop. If you don’t put working collision files in the INFO file, units will walk up on your buildings. If you need to add more then one collision area, you have to name them “collision_01”, “collision_02”, etc.
    - collision_3d is the general shape of your building in 3d. It mainly have two functions: telling the game that the camera will have to go around the building and not through it and blocking projectiles. Given so, it may be used to create fake roofs to some areas where the camera will be able to pass into, or invisible fences to protect troops from arrow attacks. Staying at the basics, the collision_3d is just a shape of the same size of your building, and that’s all. A good modeler will usually simplify it a lot, to make easier the job of the game engine.
    If you’re lazy, you can do it in the easy way by just keeping the model as it is, collapsing all its part in one object and naming it “collision_3d” then exporting it as
    monolith1_INFO.cas
    and
    monolith2_INFO.cas
    Put it in
    Data\MODELS_BUILDING\INFO
    Given the game engine will have to deal with all the polys of all the objects around, its strongly advised you simplify the object in the INFO file.

    2. follow the point 1. of the complicated way about descr_settlement_plan.txt
    I strongly suggest you to create your own slot for your own building.

    3. Add your monolith to your slot, this time with no references to bardic_circle.
    4. Once found the right slot for your monolith, add a variant line to it. It will look like that:
    Code:



            variant
        {
            cultures
                    {
                        roman
                barbarian
            }
                    buildings
                    {
                        monolith monolith1
            }
            monolith1,                 0,         0,         0,         0               
        }
            variant
            {
                cultures
            {
                        roman
                barbarian
                    }
                    buildings
                    {
                        monolith monolith2
            }
            monolith2,                 0,         0,         0,         0               
        }
    5. Follow step 3. of complicated way:
    Code:
    data/text/ building_battle.txt{monolith1} My Monolith{monolith2} Again my Monolith
    6. Just like complicated way, add your entry to
    descr_building_battle.txt
    but no need to use the item “bardic_circle_barbarian” because you’re gonna use your brand new item “monolith1” and “monolith2”.
    Here it is:

    Code:
    monolith1
    {
        stat_cat large_stone
        localised_name monolith1
        level
            {
            min_health 1
            battle_stats
            item monolith1
            physical_info        monolith1_INFO.cas
            }
        transition default_large_stone
        level
        {
            min_health 0
            battle_stats
            item                roman_rubble_112x64
            physical_info        info_roman_rubble_112x64.cas
        }
    }

    monolith2
    {
        stat_cat large_stone
        localised_name monolith2
        level
        {
            min_health 1
            battle_stats
            item monolith2
            physical_info        monolith2_INFO.cas
        }
        transition default_large_stone
        level
        {
            min_health 0
            battle_stats
            item                roman_rubble_112x64
            physical_info        info_roman_rubble_112x64.cas
        }
    }
    Note that you keep using roman_rubble_112x64 as default transition item. If you are good, you’ll probably create some more ambient objects to fit the building stage / destroyed stage of your own building. Either, try to use some default item which have similar dimensions.

    7. Now you need to have the game creating the monolith items. To do so, you’ll need one more step then the complicated way. Open data\descr_items.txt and add your monolith entry as:
    Code:
    type                monolith1lodmax_distance        4000.0model_rigid        monolith1_high.cas type                monolith2lodmax_distance        4000.0model_rigid        monolith2_high.cas
    This is the simplified version. You should actually have two or three cas files, high, med and low, to be used at different distances. That means you have to create three or more .cas files for each new building you create.
    But well, for now lets work with just the high one.

    8. Now again you have to get rid of the descr_items.db (backup, backup!) and start the game. Game shows errors, ctrl-alt-canc, kill it, restart it. You should have your buildings in the game.

    Now, there are about 1 million chances you’ll get errors. Trying to write a troubleshooting on this process is simply ridiculous, but let me share a few recurring problems:

    a) Game just does not load, no error messages – something is wrong in descr_settlement_plan.txt usually a not closed bracket or something similar.
    Game loads, you enter the campaign, no traces of your buildings in game – something wrong written in descr_items.txt or in descr_building_battle.txt
    Check if the game created the monolith1 and 2 items in data\items\ folder.
    b) Game loads, but when you go in tactical view, loading freezes – you missed adding the textures.
    c) All works, but your buildings are missing sides or show weird colors – 50% chances that the exporting procedure did not worked very well. It happens, export them again – no need to rebuild the db. The other 50% chances are – let me be rude – that you are a poor modeler.

    译文:
    adding game buildings - preparation
    增加游戏建筑—准备工作

    PREPARATION:
    First thing, BACKUP all the files involved. I suggest to backup a copy of the folders, so to be sure you can get back to start if things goes wrong.
    准备工作:
    第一件事,备份所有相关文件。我建议给文件夹备份一个副本,如此能保证当出现错误时,你们能重新开始。
    Here is the list of files involved in the process:
    这里是过程中相关文件的目录

    Data\export_descr_buildings.txt
    This file lists all the buildings that can be built during the game, specifying which cultures can build them, the costs and times, features, bonuses and recruitments capabilities.
    这个文件“Data\export_descr_buildings.txt”,是所有可以在游戏当中建造的建筑目录,规定说明哪种文化可以建造,以及价格,回合数,特征,技能,招募能力。

    Data\text\export_buildings.txt
    here all buildings are given a text description which will appears in game.
    这个文件“Data\text\export_buildings.txt”给出现在游戏里的建筑一个文字描述。

    Data\text\building_battle.txt
    here all buildings are given a text description which will NOT appears in game. Its needed to the game.
    这个文件“Data\text\building_battle.txt”给游戏需要但不出现在游戏里的建筑一个文中描述。

    Data\settlement_plans\descr_settlement_plan.txt
    Here are listed the primary buildings, and you’ll have to add your new ones there. Are also set the city plans, and all the slots that can be called from the single settlement plan files.
    这个文件“Data\settlement_plans\descr_settlement_plan.txt”是主要建筑的目录,你必须在这里增加你的新建筑。它也包括了设置城市计划和从单个协议计划文件中调用所有插槽(这里插槽是编程一个术语)

    Data\settlement_plans\[culturetype_settlementtype].txt
    where " settlementtype " stands for each type of settlement in the game, forts and camps included. There you define all building models to be shown in each kind of settlement. You can specify coords and type for all kinda objects, including walls. It can list only models already listed in descr_settlement_plan, so if you want to customize settlements a lot you will have to work on descr_settlement_plan too.
    这个文件“Data\settlement_plans\[culturetype_settlementtype].txt”里的“settlementtype”,它代表在游戏里每一个协议类型,也包括了要塞和军营。你确定所有的建筑模型都被每一类型的协议所显示。你可以规定所有类型物体的坐标和种类,也包括城墙。它只列出了在“descr_settlement_plan”里列出的模型,因此你想自定义协议,你必须在“descr_settlement_plan”也做一些工作。

    Data\descr_items.txt
    This file enlist all buildings the game will manage. You need to add here all the new buildings you want to appear in the game. You can also include subfiles there, to keep them separated for culture, for example.
    这个文件“Data\descr_items.txt”帮助管理所有游戏建筑。你需要在这里增加你想让在游戏里出现的所有新建筑。
    举个例子,你也可以在那里列入子文件以区别分离文化。

    Data\descr_items.db
    This file is generated by the game when you start it. If there is already a descr_items.db the game will not generate a new one.
    这个文件“Data\descr_items.db”是在你开始游戏时生成的。假如那里已经有了一个“descr_items”文件,游戏将不会产生一个新的文件。

    Data\descr_settlement_plan
    this one defines the single elements to be used in every city shown ingame. There are set association with every culture settlement single plans, groups of various building models to be shown in settlements and culture variations.
    这个文件“Data\descr_settlement_plan”确定了在游戏里出现的每个城市的单独原理。它设置了关于每种计划文化协议的关联。不同群组的建筑模型被显示在协议和文化信仰。

    Data\descr_building_battle\dbb.*.txt
    Those files enlist all 3d building models to the game. Here are specified the health stats, the different cas models to refer to and some other things.
    这些文件“Data\descr_building_battle\dbb.*.txt”帮助所有3D建筑模型出现在游戏。这里明确健全状态模型和不同情况下的模型,或一些其他情况的模型。

    PROCESS
    a) ADDING A NEW BUILDING TO THE GAME
    adding a new Game Building
    过程:
    a)增加一个新的建筑到游戏

    Lets say you want to add a new building named “MONOLITH”, buildable by Romans and Britons, with two levels named monolith1 and monolith2, which gives a some happiness to settlement population.
    比如你想给“Romans”和“Britons”两个势力添加一个名叫“MONOLITH”新建筑,取两个名字“monolith1”和“monolith1”,并且适合协议群。


    1. Open export_descr-building.txt, scroll to the end of it and add the new building tree. It will look like that:
    Code:
    building monolith
    {
        levels monolith1 monolith2
        {
            monolith1 requires factions { romans, britons }
            {
                capability
                {
                    happiness_bonus bonus 1
                }
                construction 1
                cost 400
                settlement_min town
                upgrades
                {
                    monolith2
                }
            }
            monolith2 requires factions { romans, britons }
            {
                capability
                {
                    happiness_bonus bonus 2
                }
                construction 3
                cost 800
                settlement_min large_town
                upgrades
                {
                }
            }
        }
        plugins
        {
        }
    }
    1、代开文件 export_descr-building.txt,翻到最后并增加新的建筑树。看到像那样一段码:如上~~~


    2. Open export_buildings.txt and add the description lines for the levels of your new building:
    Code:
    {monolith1} The wonderful lunar Monolith!
    {monolith1_desc} The lunar Monolith helps people read at night, so they love it. People is very happy to have it in the settlement.
    {monolith1 _desc_short} The lunar Monolith makes people happy.
    {monolith2} The Unbearable solar Monolith!
    {monolith2_desc} The solar Monolith gives all people a nice tan and makes all them say “Wohooo!”. People is very happy to have it in the settlement and they will love you for building it.
    {monolith2 _desc_short} The solar Monolith makes people happy.
    Add also a line to the name string at the end of the file:
    Code:
    {monolith_name} Wonderful Big Stones – Makes people happy
    2、打开文件export_buildings.txt,给你的新建筑的等级增加一行描述。
    信息码:如上~~~


    3. Add some nice pictures to be seen in your building queue ingame.
    To do so you need to be able to use a graphic editor, like GIMP or Photoshop or something else. Find a nice picture you like and save it as your Building Card Picture with the name
    #roman_monolith1_constructed.tga
    In data\ui\roman\buildings
    3、给游戏中建筑队列增加好看的图片。
    你需要用一些图像编辑器,比如GIMP、Photoshop或其它。
    找到一个你认为好的图片并保存,把它名字起为“#roman_monolith1_constructed.tga”并保存在data\ui\roman\buildings底下作为你的建筑图片。


    Then resize to 78x62 pixels. If you are good with graphics add the alpha channel, if you dunno what is it, just forget it. Save that picture as
    #roman_monolith1.tga
    in data\ui\roman\buildings
    然后调整为78x62像素。假如做好了把图片增加到最初通道,假如你不知道它是什么,只需忘记它。保存“#roman_monolith1.tga”图片在data\ui\roman\buildings 底下。

    then make a copy, resize it to 64x51 pixels and save it with the same name in data\ui\roman\buildings\construction
    复制一下,把它调整为64x51像素,并用同样的名字保存在data\ui\roman\buildings\construction底下


    Do the same in barbarian building folders (as Britons are barbarian) and of course, name them
    #barbarian_etc etc
    同样的,也可以弄个野蛮种族建筑文件夹(像Britons就是野蛮种族),当然,名字变为“#barbarian_etc etc ”


    At this point you can start the game and if you play as romans or as Britons you’ll find your new building available to be built in your settlements. You can play and benefit all the features of the monolith, but if you enter the settlement in tactical view, you will not see anything like a monolith. To have the monolith around in your battles, you’ll need to create and then add the 3d model to the models db, and that’s what I’m gonna explain now.
    到这里你可以开始游戏,假如你玩“romans”或者“ Britons”势力,你就能发现在游戏设置里你的新建筑可以建造了。你可以玩而且享受到“monolith”特性的好处,但是假如你用战役地图协议,你将看不任何关于“monolith”东西。为让“monolith”在你战斗中起到作用,你需要创建并将3D模型增加到db模型,那就是现在我要解释的。


    b) ADDING THE 3D MODEL OF THE NEW BUILDING
    If adding a new building to the game was pretty easy, adding a 3d model is all BUT easy. There are two ways I know to go for it, one is complicated, the other is utterly complicated.
    b)给新建筑增加3D模型
    假如给游戏增加一个新建筑是很容易的,那么增加一个3D模型也会很容易。我知道有两种方法可以实现它,一种是麻烦的,另外一种是非常麻烦的。

    b.1) – Using existing models
    Using existing models
    用现成模型

    The complicated way is to use an existing building of the game, which means you will somehow rename an existing building. To do so first thing you have to pick the existing building you want to be your monolith. Lets say you chose the barbarian bardic circle.
    复杂方法就是用游戏里现成的建筑,它意思是给一个现成建筑重新起个名字。首先你不得不选择一个现成建筑变为你的“monolith”。比如你选择野蛮种族吟游诗人体系。

    1. Open descr_settlement_plan.txt and first of all add monolith1 and monolith2 to the primary building list.
    1、打开文件“escr_settlement_plan.txt”,首先增加“monolith1”和“monolith2”到主要建筑目录。

    Then chose a slot to settle your new building. Slots are prefixed areas in the settlement plans where specific buildings may be built. Given you want the monolith to be buildable in roman and (barbarian) britons settlements, you must pick a slot that is present in both those culture settlements files. You also have to pick slots with adequate dimensions, which means you have to open in 3dmax the bardic_circle and see the dimensions it occupies, or at least check it in descr_settlement_plan.txt. Remember that if you use a slot for that building, you will not be able to build another building in that slot – so if you decide to use lets say the slot_160x128_missiles slot, then you will not be able to build the missile building if you build your monolith.
    选择一个插槽去设置你的新建筑。插槽放在确定建筑可以建造协议计划区域的前面。想让“monolith”在“roman”和“britons”协议里可以被建造,你必须选择一个插槽出现在这两种文化协议文件里。你也不得不选择合适规格的插槽,它意思是你不得不打开“bardic_circle”3dmax并看它占据的规格,或者至少在文件“descr_settlement_plan.txt”中核对一下。记住,假如你用了那个建筑的插槽,你不能再用到另一个建筑。假如你把插槽“160x128_missiles slot”用到你的“monolith”建筑,它就能用于建造“missile”建筑。

    Best way is to create a brand new slot for your new building, something like a slot_monolith with the right dimensions. But you’ll have then to find the correct coordinates in romans and barbarian settlements to set your new slot. If you put it on a road, soldiers will run against it and get stuck there.
    最好的方法是给你的新建筑创建一个新铭牌的插槽,一些事情像“monolith”插槽规格要正确。但是你还得去“romans”和“barbarian”协议里给你的新插槽找到正确的坐标。假如你把它放在路上,士兵将会碰到它并在那里卡住。

    So if you go to create your own slot, then you’ll have to add it to all the settlement files you want the monolith to be buildable in.
    因此,假如你创建你自己插槽,你想让“monolith”可以被建造,你不得不插槽加到所有的协议文件。


    2. Once found the right slot for your monolith, add a variant line to it. It will look like that:
    variant
    {
            cultures
            {
                    roman
            barbarian
            }
            buildings
            {
                Monolith monolith1
        }
        bardic_circle_barbarian,                 0,         0,         0,         0               
    }
    variant
    {
            cultures
            {
                    roman
            barbarian
            }
            buildings
            {
                monolith monolith2
            }
        bardic_circle_barbarian,                 0,         0,         0,         0               
    }
    2、一旦给你的建筑“monolith”找到正确的插槽,给它增加一个不同信息行,看到像那样一段码如上”~~~

    Consider that this way the 3d models shown ingame will be the bardic circle for both levels of your monolith, and for both romans and Britons. Of course you can use different models for cultures and levels if you want, but pay attention to dimensions of the models: if you use a model bigger then the slot you put it in, it may collide with other buildings or block roads.
    考虑这个方法出现在游戏里的3D模型将是吟游诗人体系,对于你的“monolith”两个等级和“romans 和 Britons”。
    当然,假如你想要,你可以用不同文化的模型和等级,但要注意模型的规格:假如你用一个比插槽大的模型把它放进去,它可能和其它建筑冲突或者挡住道路。

    n descr_settlement_plan.txt file you can also set the models for the building time of your monolith, or what to show if its not at all built. Here I try to stay at the basics.
    在文件“descr_settlement_plan.txt file ”中,你也可以设置模型“monolith”建造时间,或者它一点也没建造时显示。这里我尽量停留在基础上。

    3. Once you added your monolith to a slot and the slot is available in the settlement plans, you have to declare it in data/text/ building_battle.txt
    Easy step here: just add a line like:
    Code:
    {monolith1} My Monolith
    {monolith2} Again my Monolith
    Those lines never appears in game, ir at least I never saw them. But they are needed to have the building working.
    3.一旦你把“monolith”加入插槽,并且在协议计划里它是可用的,你不得不在文件“data/text/ building_battle.txt”声明一下。
    这里步骤很简单,只要增加像这样一行:
    {monolith1} My Monolith
    {monolith2} Again my Monolith
    这些行不会出现在游戏,至少我没看到过。但是建筑工作需要它们。

    4. Now you have to include your new building to the models db of the game. To do so, first thing open descr_building_battle.txt
    add the monolith entry like that:
    Code:
    monolith1
    {
        stat_cat large_stone
        localised_name monolith1
        level
        {
            min_health 1
            battle_stats
            item bardic_circle_barbarian
            physical_info        bardic_circle_barbarian_info.CAS
        }
        transition default_large_stone
        level
        {
            min_health 0
            battle_stats
            item                roman_rubble_112x64
            physical_info        info_roman_rubble_112x64.cas
        }
    }
    monolith2
    {
        stat_cat large_stone
        localised_name monolith2
        level
        {
            min_health 1
            battle_stats
            item bardic_circle_barbarian
            physical_info        bardic_circle_barbarian_info.CAS
        }
        transition default_large_stone
        level
        {
            min_health 0
            battle_stats
            item                roman_rubble_112x64
            physical_info        info_roman_rubble_112x64.cas
        }
    }
    4、现在你不得不把你的新建筑列入到游戏里db模型。这样做,第一件事打开文件“descr_building_battle.txt”,
    给“monolith”增加入口,像这样,源码如上:~~~~


    At this point, given you used an existing model, there is nothing else you have to do with files. But you have to delete the existing descr_items.db (which you have already backupped, haven’t you?) and then run the game.
    在这里,给你用一个现成的模型,。但你不得不删除已生成文件“descr_items.db”(你不是已经备份了吗?)然后运行游戏。


    You’ll have some errors, just ctrl-atl-canc and stop the program. If you have made no mistakes, the program creates the new descr_items.db including your monolith.
    Restart the game, and this time there should be no errors. If you play as romans or Britons you’ll be able not just to build the monolith but also to go and see it in your cities in tactical view. O well, you’ll see the bardic_circle, of course, but the cursor will say “Monolith” and you will be happy like the people in your settlement are.
    你会一些错误,只要“ctrl-atl-canc”停止程序。假如你没有错误,程序产生包含“monolith”的新文件“descr_items.db”。重新开始游戏,这次不会有错误。假如你玩势力“romans”或“Britons”,你不是仅仅能建造“monolith”,而且在战役地图中你的城市里可以看见它。好了,你将看见吟游诗人体系,当然,光标指示将会说“Monolith”。你会像你设定的人民一样高兴。


    Ok this was the complicated way, which is not that much because, as I just outlined, you’ll see the same old models in your game. So lets go to see how to add a completely new model to your new building. And, well, it will be not that easy.
    Did I already say that?
    这就是复杂的方法,像我划定的,它没有许多原因。在游戏里,你将看见同样的旧模型。让我们去看一下怎样给你的建筑增加一个全新的模型。好了,它不会像我已说那个那么简单。



    b.2) – Using brand new models
    Using brand new models
    1. To add a brand new model for your monolith, first thing you have to do is to create that model. You can do so by importing an original item form the game that have similar dimensions to the one you want to create and this also keep its own collision INFO file – or go on and create your new model with its own INFO file.
    使用全新模型
    1、给你的“monolith”增加一个全新模型,首先你必须给它创建一个模型。你可以按游戏里重要、独特的项目做(注:这里form,我觉得是作者笔误,它应该是from),游戏里你创建项目和这保持它自己碰撞“INFO”文件有相似的规格尺寸,或者给你的新模型创建它自己的“INFO”文件。


    If you keep and existent INFO file as reference for your new building, just import in 3dsMax the vanilla model and then start to create your own building keeping it within the dimensions of the original item. Once you created your new model, remove the original item and all its textures, add your own textures and finally export it as
    monolith1_high.cas
    Put it in
    Data\MODELS_BUILDING
    And put your textures in
    Data\MODELS_BUILDING\TEXTURES
    假如你保持现有的“INFO”文件作为你的新建筑参考,只要输入普通模型的3dsMax,然后开始创建你自己建筑并让它保持独特项目规格尺寸内。一旦你创建新的模型,移动独特项目和所有它的纹理贴图,加入到你自己的纹理贴图,最后把它导出为“monolith1_high.cas”,把它放进文件夹“Data\MODELS_BUILDING”,并把你的纹理贴图放入文件夹“
    Data\MODELS_BUILDING\TEXTURES”

    If you want to make a new building with its own INFO file, after you create the .cas for your new building you have to create the INFO file for it.
    假如你想创建关于新建筑它自己的“INFO”文件,然后你为你的新建筑创建*.cas文件,并为它创建“INFO”文件。


    To know how to do so, lets first explain what are INFO files and how they work. INFO files tell the game some functionalities of the model they refer to. Including their walkable/non walkable areas, if and where the camera will go around them or get through them, and some more complicated features like tunnels, platforms, siege points and the like.
    知道如何做这些,先解释“INFO”文件和他们是如何工作的。“INFO”文件告诉游戏它们提到的模型的功能。包括它们的通行/不通行的区域,游戏镜头(注意译,原意是照相机或摄像机)会在它们周围或通过它们。一些更复杂的特征像隧道,平台,围城点,等等。

    Here I will explain just the two basic ones needed to create functional INFO files for simple buildings, which are “collision” and “collision_3d” issues.
    这里我将解释两个基础问题,为简单建筑创建功能性“INFO”文件。它们是“collision”和“collision_3d”问题。


    - Collisions are simple squares, made on ONE SINGLE element (even better one single polygon) with no holes inside. They define the areas where troops or peasants will NOT be able to walk. If the building is just a cube, the basic collision file is a square a little bigger then the cube base. The units will walk into it and stop. If you don’t put working collision files in the INFO file, units will walk up on your buildings. If you need to add more then one collision area, you have to name them “collision_01”, “collision_02”, etc.
    -“碰撞”是简单正方形,产生于内部没有孔洞的单一元素(甚至更好是一个单一多边形)。它们明确了部队或农民不能行走的区域。假如建筑是一个立方体,基础碰撞文件是一个比正方体基础稍大一点正方形。单位走进它并停止。假如没有让碰撞文件在“INFO”文件工作,单位将爬上你的建筑物。假如你需要加入更多一点碰撞区域,你不得不把它们命名为“collision_01”, “collision_02”等等。

    - collision_3d is the general shape of your building in 3d. It mainly have two functions: telling the game that the camera will have to go around the building and not through it and blocking projectiles. Given so, it may be used to create fake roofs to some areas where the camera will be able to pass into, or invisible fences to protect troops from arrow attacks. Staying at the basics, the collision_3d is just a shape of the same size of your building, and that’s all. A good modeler will usually simplify it a lot, to make easier the job of the game engine.
    -碰撞_3d在你的建筑3d中是一个普通形状。它主要有两个功能:告诉游戏的游戏镜头只能在建筑物周围,不能穿过它;
    并阻止抛射物(注:应该是阻止投石机投射之类)。如此,它习惯给游戏镜头能进入的一些区域创建假屋顶,或者创建看不见栅栏包含部队不受弓箭的攻击。基于这些基础,这个“碰撞_3d”只是和你的建筑同一尺寸的同一形状,所有都一样。一个好的模型制作者通常会让它简单许多,可以让游戏引擎更容易的工作。


    If you’re lazy, you can do it in the easy way by just keeping the model as it is, collapsing all its part in one object and naming it “collision_3d” then exporting it as
    monolith1_INFO.cas
    and
    monolith2_INFO.cas
    Put it in
    Data\MODELS_BUILDING\INFO
    Given the game engine will have to deal with all the polys of all the objects around, its strongly advised you simplify the object in the INFO file.
    假如你懒惰,你可以用简单的方法制作它,只要保持它自己的模型,收集它所有部分作为一个整体,并把它命名为
    “collision_3d”,然后把它导出为“monolith1_INFO.cas”和“monolith2_INFO.cas”,再把它放在文件夹”
    Data\MODELS_BUILDING\INFO”底下。
    这样,游戏引擎将不得不处理物体周围的所有多变形,它会强烈建议你在文件“INFO”中使物体简单化。


    2. follow the point 1. of the complicated way about descr_settlement_plan.txt
    I strongly suggest you to create your own slot for your own building.
    2、到第一点这里,就是关于文件“descr_settlement_plan.txt”的复杂方法。


    3. Add your monolith to your slot, this time with no references to bardic_circle.
    3、把“monolith”加入你的插槽,这时没有游吟诗人体系的参照资料。



    4. Once found the right slot for your monolith, add a variant line to it. It will look like that:
    Code:
            variant
        {
            cultures
                    {
                        roman
                barbarian
            }
                    buildings
                    {
                        monolith monolith1
            }
            monolith1,                 0,         0,         0,         0               
        }
            variant
            {
                cultures
            {
                        roman
                barbarian
                    }
                    buildings
                    {
                        monolith monolith2
            }
            monolith2,                 0,         0,         0,         0               
        }
    4、一旦为你的“monolith”找到正确插槽,給它加入不同的行。像这样,源码如上:~~~~

    5. Follow step 3. of complicated way:
    Code:
    data/text/ building_battle.txt{monolith1} My Monolith{monolith2} Again my Monolith
    5、按照复杂方法的第三步,加入码如下:
    data/text/ building_battle.txt{monolith1} My Monolith{monolith2} Again my Monolith


    6. Just like complicated way, add your entry to
    descr_building_battle.txt
    but no need to use the item “bardic_circle_barbarian” because you’re gonna use your brand new item “monolith1” and “monolith2”.
    Here it is:
    Code:
    monolith1
    {
        stat_cat large_stone
        localised_name monolith1
        level
            {
            min_health 1
            battle_stats
            item monolith1
            physical_info        monolith1_INFO.cas
            }
        transition default_large_stone
        level
        {
            min_health 0
            battle_stats
            item                roman_rubble_112x64
            physical_info        info_roman_rubble_112x64.cas
        }
    }
    monolith2
    {
        stat_cat large_stone
        localised_name monolith2
        level
        {
            min_health 1
            battle_stats
            item monolith2
            physical_info        monolith2_INFO.cas
        }
        transition default_large_stone
        level
        {
            min_health 0
            battle_stats
            item                roman_rubble_112x64
            physical_info        info_roman_rubble_112x64.cas
        }
    }
    6、只要像复杂方法一样,把你的入口加到文件“descr_building_battle.txt”
    但不需要用项目““bardic_circle_barbarian””,因为你将要用你的全新项目“monolith1” and “monolith2”。
    这儿源码是这样的,如上:~~~~

    Note that you keep using roman_rubble_112x64 as default transition item. If you are good, you’ll probably create some more ambient objects to fit the building stage / destroyed stage of your own building. Either, try to use some default item which have similar dimensions.
    注意你要保留用“roman_rubble_112x64”作为缺省过渡项目。假如你做的很好,你可能创建一些环境物体去配合你的建筑当它处于建造状态/毁坏状态。或者,尽量用一些有相似规格尺寸的缺省项目。

    7. Now you need to have the game creating the monolith items. To do so, you’ll need one more step then the complicated way. Open data\descr_items.txt and add your monolith entry as:
    Code:
    type                monolith1lodmax_distance        4000.0model_rigid        monolith1_high.cas type                monolith2lodmax_distance        4000.0model_rigid        monolith2_high.cas
    This is the simplified version. You should actually have two or three cas files, high, med and low, to be used at different distances. That means you have to create three or more .cas files for each new building you create.
    But well, for now lets work with just the high one.
    7、现在你需要有游戏去创建“ monolith ”项目。如此,你需要多做一步步骤比那个复杂的方法。打开文件“data\descr_items.txt”并把你的 monolith ”输入:
    源码如下:
    type                monolith1lodmax_distance        4000.0model_rigid        monolith1_high.cas type                monolith2lodmax_distance        4000.0model_rigid        monolith2_high.cas
    这是一个简化的版本。你实际上可以有两个或三个“cas”文件,高,低,矮,被用到不同的距离。它意思是你不得不为你创建的每一个新建筑创建三个或更多的“cas”文件。
    但是好了,现在只要和其中高的那个工作。

    8. Now again you have to get rid of the descr_items.db (backup, backup!) and start the game. Game shows errors, ctrl-alt-canc, kill it, restart it. You should have your buildings in the game.
    8、现在你不得不再次去掉文件“descr_items.db”(备份,备份!)并开始游戏。游戏显示错误,按“ctrl-alt-canc”,关掉它,重启。你的建筑就会在游戏里出现了。

    Now, there are about 1 million chances you’ll get errors. Trying to write a troubleshooting on this process is simply ridiculous, but let me share a few recurring problems:
    现在,你可能有一百万次机会做错。在这个过程想尽力写排故障那是很可笑的,但是我给出一些经常碰到的问题:

    a) Game just does not load, no error messages – something is wrong in descr_settlement_plan.txt usually a not closed bracket or something similar.
    Game loads, you enter the campaign, no traces of your buildings in game – something wrong written in descr_items.txt or in descr_building_battle.txt
    Check if the game created the monolith1 and 2 items in data\items\ folder.
    a)游戏载入不了,没有错误信息——在文件“descr_settlement_plan.txt ”中一些错误事情是没有关掉支架或相似事情。
    载入游戏,你进入战略地图,在游戏里没有你的建筑痕迹——在文件“descr_items.txt”中或文件“descr_building_battle.txt”中,有些东西被写错了。
    检测在文件夹“data\items\ folder”中,游戏创建的“monolith1”和“monolith2”项目。

    b) Game loads, but when you go in tactical view, loading freezes – you missed adding the textures.
    b)载入游戏,当你进入战役地图时,载入卡住了——你丢失增加的纹理贴图

    c) All works, but your buildings are missing sides or show weird colors – 50% chances that the exporting procedure did not worked very well. It happens, export them again – no need to rebuild the db. The other 50% chances are – let me be rude – that you are a poor modeler.
    c)所有工作,但你的建筑丢失边数或显示奇怪的颜色——百分50机率是输出程序没有工作好。把它们再次输出——不需要重建文件“db”。其它百分50机率——放过我的粗鲁——你是一个水平比较差的模型者。
    发表于 2015-7-3 15:57:10 | 显示全部楼层
    LZ真是人才
    发表于 2015-7-3 16:25:05 | 显示全部楼层
    难得一见的好帖
    发表于 2015-7-3 15:41:54 | 显示全部楼层
    不错不错
    发表于 2015-7-3 16:15:05 | 显示全部楼层
    楼主是超人
    发表于 2015-7-3 15:54:42 | 显示全部楼层
    很好哦
    您需要登录后才可以回帖 登录 | 注册账号

    本版积分规则

    QQ|手机版|网站地图|汉魂王爵会员站   Powered by Discuz! X3.4Comsenz Inc.

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