幻想坦克吧 关注:1,005贴子:58,130
  • 13回复贴,共1

怎样在房间里添加其新的BOT!

只看楼主收藏回复


就是更改添加一些新的BOT,像原来固有的坦克:Babyboss ,Bosstank等一样可以在房间里出现的BOT坦克.....
1, 在game\server\scripts中找到tankDb.cs,打开模仿并创建新的坦克.例如:由BABYBOSS那一栏:[内容可能与你的tankdb.cs不同,这只是
个例子]
datablock TankData(BabyBoss : MediumTank)
{
    shapeFile = "~/data/shapes/tanks/tank05.dts";
    brainShapeFile = "~/data/shapes/tanks/brainjar04.dts";
    fx = "BabyBossFX";
    maxSpeed = 16.0;           // meters per second (in forward direction)
    accelRate = 15.0;          // increase velocity this many meters per second
    deccelRate = 16.0;         // when breaking, decrease velocity
    turnRate = 61.0;           // degrees per second
    antiSlideRate = 10.2;
    turretHorRange = 33.5;     // range in +/- degrees of turret horizontally
    turretAutoLevel = 0.92;
    damageAmount = 10.0;       // total amount of damage tank can withstand
    suspensionRange = 1000.8;     // proportion of wheel size for wheel to move up/down
    damageScale = 1.0;         // multiply damage we do to others by this amount
    armorScale = 1.8;          // multiply damage we take by this amount (note: smaller better)
    defaultProjectile = "ufoProjectile";
    ai = GoldLightAI;
};
可模仿创建为:
datablock TankData(XYTANK : MediumTank)
{
    shapeFile = "~/data/shapes/fighter2/fighter.dts";
    brainShapeFile = "~/data/shapes/tanks/bot03.dts";
    fx = "BabyBossFX";
    maxSpeed = 32.0;           // meters per second (in forward direction)
    accelRate = 20.0;          // increase velocity this many meters per second
    deccelRate = 32.0;         // when breaking, decrease velocity
    turnRate = 61.0;           // degrees per second
    antiSlideRate = 12.2;
    turretHorRange = 33.5;     // range in +/- degrees of turret horizontally
    turretAutoLevel = 0.92;
    damageAmount = 30.0;       // total amount of damage tank can withstand
    suspensionRange = 1000.8;     // proportion of wheel size for wheel to move up/down



1楼2010-02-19 12:01回复

        damageScale = 1.0;         // multiply damage we do to others by this amount
        armorScale = 1.8;          // multiply damage we take by this amount (note: smaller better)
        defaultProjectile = "ufoProjectile";
        ai = XYTANKAI;
    };
    当然其中的数据可以你自己随便改,如形状速度等...
    然后找到
    //--------------------------------------------------------
    // AI Tanks
    //--------------------------------------------------------以下的内容:
    例如:
    datablock TankData(BronzeLightTank : LightTank)
    {
        brainShapeFile = "~/data/shapes/tanks/brainjar02.dts";
        //damageAmount = 10.0;
        ai = BronzeLightAI;
    };
    可模仿创建为;
    datablock TankData(XYTANK :XYTANK)
    {
        brainShapeFile = "~/data/shapes/tanks/brainjar02.dts";
        //damageAmount = 10.0;...........[这是你创建的BOT的抵御能力,你可随便改]
        ai = XYTANKAI;
    };
    保存关闭
    2,再在game\server里找到prefs.cs,打开找到这段代码:
    $pref::Server::Bot0 = "GoldLightTank";
    $pref::Server::Bot1 = "GoldLightTank";
    $pref::Server::Bot2 = "GoldLightTank";
    $pref::Server::Bot3 = "GoldLightTank";
    $pref::Server::Bot4 = "GoldLightTank";
    $pref::Server::Bot5 = "GoldLightTank";
    $pref::Server::Bot6 = "GoldLightTank";
    $pref::Server::Bot7 = "GoldLightTank";
    在这代码里在你的房间里添加你的新BOT可改为
    $pref::Server::Bot0 = "XYTank";
    $pref::Server::Bot1 = "XYTank";
    $pref::Server::Bot2 = "GoldLightTank";
    $pref::Server::Bot3 = "GoldLightTank";
    $pref::Server::Bot4 = "GoldLightTank";
    $pref::Server::Bot5 = "GoldLightTank";
    $pref::Server::Bot6 = "GoldLightTank";
    $pref::Server::Bot7 = "GoldLightTank";
    保存关闭即可!
    3, 在game\server\scripts里找到tankAI.cs,打开找到//-----------------------------------------------------------------------
    //----------------------------- GOLD TANKS ------------------------------
    //-----------------------------------------------------------------------
    随便找下面的一段代码:
    new TankAIData(GoldLightAI : SilverLightAI)
    {
        aim = 0.4;
        aimSpeed = 0.6;
        fleeDamage = 50;
        triggerHappy = 2;
    };
    可模仿创建为:
    new TankAIData(XYTANKAI : SilverLightAI)
    {
        aim = 0.1;
        aimSpeed = 0.5;
        fleeDamage = 60;
        triggerHappy = 3;
    };
    关闭保存,
    4 ,打开TT运行即可,更改新坦克数据时他的形状,脑壳形状要实际在你的TT中存在,数据要合理,如果发生错误,在回到代码中查找问题,
    记住更改前要备份文件,防止出错。
    


    2楼2010-02-19 12:01
    回复
      2025-05-25 20:50:52
      广告
      膜拜下


      删除|3楼2010-02-19 12:18
      回复
        不是说有教程了么 我本来去年打算写的后来就搁置了


        4楼2010-02-19 17:47
        回复
          既然如此我有空写其他的


          5楼2010-02-19 17:48
          回复
            .@_@


            6楼2010-02-19 17:57
            回复
              我知道你没空- -


              删除|7楼2010-02-19 18:26
              回复
                下星期就有了


                8楼2010-02-19 18:45
                回复
                  2025-05-25 20:44:52
                  广告
                  代码前带//貌似是系统运行时省略的代码 记不大清楚了


                  9楼2010-02-19 18:46
                  回复
                    多久没玩了你?


                    删除|10楼2010-02-19 19:31
                    回复
                      一直忙 没空


                      11楼2010-02-20 08:09
                      回复


                        删除|12楼2010-02-20 10:27
                        回复
                          我是一只想玩玩不了·


                          删除|13楼2010-02-20 10:28
                          回复
                            乱码···


                            14楼2011-01-21 22:16
                            回复