EXC2迟迟不更新,只好自己动手写几个脚本玩玩

TA-EXCESS 2很久没更新了。测试版里面有几个模型没有脚本,所以就自己写来玩玩了。

ARM两个炮塔,其中一个对应原版的双管加农炮,模型简单,一下子就写好,另一个炮塔构造基本一样,也很快弄好。
CROE两个炮塔和2级采矿机。一个对应原版的超远程跑,一个和一级导弹塔近似,都不难。2级采矿机跟一级一个样,几乎不需要修改什么,直接用一级采矿机的脚本也行。

GOK两个都是麻烦的家伙,一个是像ECX1的恶魔骑士,一个是厌恶者。还好最麻烦的四条腿走路的动作是一样的,做好一个另一个就不用愁。找到一代的厌恶者的脚本,还好腿的结构一样,这样走路的动作就不用自己做了,直接改零件名套用。

防护罩脚本很轻松,直接复制EX2其他单位的就行。

下半身搞定,上半身更轻松,控制炮台攻击的脚本最熟悉了。

基本上就搞定了这几个附带的模型。唯一出问题的是新的恶魔骑士从模型就能看出有工程部件。于是就加了工程脚本。基本没什么问题,就是手动攻击会打两下就不打。问题应该是出在同一个炮台下有个瞄准系统上。

看其他类似单位的处理方法看得有点头晕。不是很大的问题,等能看懂了再搞,不过说不定在那之前ECXESS 2已经更新了。

大致上处理的方法是用是否瞄准来控制,有些静态变量不知道是不是必须的,还是单位本身独特的,看不懂,所以没搞。

下面这个是我写的恶魔骑士的脚本,能走路,能开炮,能建造。没做瞄准控制,所以在攻击瞄准方面有点小问题。可以就这个来探讨一下单炮台两个瞄准系统的处理方法。

#define TA                        // This is a TA script

#include "sfxtype.h"
#include "exptype.h"

piece  base, pelvis, rflegy, rfleg, rfleg2, rfleg3, rfclaw,
   lflegy, lfleg, lfleg2, lfleg3, lfclaw, rblegy, rbleg, rbleg2,
   rbleg3, rbclaw, lblegy, lbleg, lbleg2, lbleg3, lbclaw, 
   turret, pitchturret, barrel, fire, flare, gem, gema, gemb, gemc, gemd, shieldturn, shield, larm, lathe, spray;

static-var  bMoving, DamageNow, LastDamage, ShieldOn, ShieldBlocks, ShieldPower;

// Signal definitions
#define SIG_AIM                                2


ShieldUnit(CycleDone)
{
   signal 64;
   set-signal-mask 64;
   while( get BUILD_PERCENT_LEFT )
   {
   sleep 500;
   }
   while( TRUE )
   {
   //Shield control
   if( ShieldPower < 0 )
   {
   ShieldPower = 0;
   }
   if( ShieldOn == 1 )
   {
   ShieldPower = ShieldPower + 6.25;
   if( ShieldPower > 0 )
   {
   show gema;
   hide gemb;
   hide gemc;
   hide gemd;
   if( ShieldPower < 187.5 )
   {
   hide gema;
   show gemb;
   hide gemc;
   hide gemd;
   }
   if( ShieldPower < 125 )
   {
   hide gema;
   hide gemb;
   show gemc;
   hide gemd;
   }
   }
   if( ShieldPower > 250 )
   {
   ShieldPower = 250;
   }
   }
   if( ShieldBlocks == 0 )
   {
   hide gema;
   hide gemb;
   hide gemc;
   show gemd;
   if( ShieldPower >= 125 )
   {
   ShieldBlocks = 1;
   set ARMORED to 1;
   hide gema;
   hide gemb;
   show gemc;
   hide gemd;
   }
   }

   //Damage effects
   CycleDone = 0;
   LastDamage = get HEALTH;
   if( CycleDone == 0 )
   {
   if( LastDamage < 30 )
   {
   emit-sfx 256 | 1 from turret;
   emit-sfx 256 | 2 from barrel;
   sleep 250;
   emit-sfx 256 | 1 from turret;
   emit-sfx 256 | 2 from barrel;
   sleep 250;
   CycleDone = 1;
   }
   }
   if( CycleDone == 0 )
   {
   if( LastDamage < 60 )
   {
   emit-sfx 256 | 1 from turret;
   sleep 250;
   emit-sfx 256 | 1 from turret;
   sleep 250;
   CycleDone = 1;
   }
   }
   if( CycleDone == 0 )
   {
   sleep 500;
   }
   }
}

HitByWeapon(AngleX, AngleZ, Impact)
{
   DamageNow = get HEALTH;
   hide shield;
   if( ShieldBlocks == 1 )
   {
   signal 128;
   set-signal-mask 128;
   turn shieldturn to z-axis (55 * AngleZ) now;
   turn shieldturn to x-axis (55 * AngleX) now;
   show shield;
   Impact = 18 * ( LastDamage - DamageNow );
   if( Impact < 4 )
   {
   Impact = 4;
   }
   ShieldPower = ShieldPower - Impact;
   LastDamage = DamageNow;
   if( ShieldPower <= 0 )
   {
   set ARMORED to 0;
   ShieldBlocks = 0;
   hide gema;
   hide gemb;
   hide gemc;
   show gemd;
   }
   sleep 100;
   hide shield;
   return (0);
   }
   LastDamage = DamageNow;
}

MotionControl(Func_Var_1, Func_Var_2)
{
   Func_Var_2 = 1;
   while( TRUE )
   {
   Func_Var_1 = bMoving;
   if( Func_Var_1 )
   {
   if( bMoving )
   {
   turn rfleg to y-axis <65.000000> speed <146.664835>;
   turn rfleg2 to z-axis <30.000000> speed <26.664835>;
   turn rfleg3 to z-axis <15.000000> speed <40.000000>;
   turn rfclaw to z-axis <-5.000000> speed <26.664835>;
   turn lfleg to y-axis <10.000000> speed <133.335165>;
   turn lfleg2 to z-axis <0.000000> speed <13.335165>;
   turn lfleg3 to z-axis <30.000000> speed <26.664835>;
   turn lfclaw to z-axis <-35.000000> speed <53.335165>;
   turn rbleg to y-axis <-35.000000> speed <146.664835>;
   turn rbleg2 to z-axis <5.000000> speed <13.335165>;
   turn rbleg3 to z-axis <-35.000000> speed <13.335165>;
   turn rbclaw to z-axis <25.000000> speed <66.664835>;
   turn lbleg to y-axis <30.000000> speed <93.335165>;
   turn lbleg2 to z-axis <-40.000000> speed <26.664835>;
   turn lbleg3 to z-axis <0.000000> speed <40.000000>;
   turn lbclaw to z-axis <-5.000000> speed <26.664835>;
   turn pelvis to z-axis <5.000000> speed <13.335165>;
   sleep 375;
   }
   if( bMoving )
   {
   turn rfleg to y-axis <70.000000> speed <13.335165>;
   turn rfleg2 to z-axis <-10.000000> speed <106.664835>;
   turn rfleg3 to z-axis <30.000000> speed <40.000000>;
   turn rfclaw to z-axis <-10.000000> speed <13.335165>;
   turn lfleg to y-axis <25.000000> speed <40.000000>;
   turn lfleg2 to z-axis <-15.000000> speed <40.000000>;
   turn lfleg3 to z-axis <45.000000> speed <40.000000>;
   turn rbleg to y-axis <-70.000000> speed <66.664835>;
   turn rbleg2 to z-axis <-10.000000> speed <40.000000>;
   turn rbleg3 to z-axis <30.000000> speed <173.335165>;
   turn rbclaw to z-axis <-10.000000> speed <93.335165>;
   turn lbleg to y-axis <5.000000> speed <66.664835>;
   turn lbleg2 to z-axis <-15.000000> speed <66.664835>;
   turn lbleg3 to z-axis <45.000000> speed <120.000000>;
   turn lbclaw to z-axis <-35.000000> speed <80.000000>;
   turn pelvis to x-axis <5.000000> speed <13.335165>;
   turn pelvis to z-axis <0.000000> speed <6.664835>;
   sleep 375;
   }
   if( bMoving )
   {
   turn rfleg to y-axis <40.000000> speed <80.000000>;
   turn rfleg2 to z-axis <5.000000> speed <40.000000>;
   turn rfleg3 to z-axis <-20.000000> speed <133.335165>;
   turn rfclaw to z-axis <15.000000> speed <66.664835>;
   turn lfleg to y-axis <-10.000000> speed <93.335165>;
   turn lfleg2 to z-axis <-40.000000> speed <66.664835>;
   turn lfleg3 to z-axis <0.000000> speed <120.000000>;
   turn lfclaw to z-axis <-5.000000> speed <80.000000>;
   turn rbleg to y-axis <-65.000000> speed <13.335165>;
   turn rbleg2 to z-axis <30.000000> speed <106.664835>;
   turn rbleg3 to z-axis <15.000000> speed <40.000000>;
   turn rbclaw to z-axis <-5.000000> speed <13.335165>;
   turn lbleg to y-axis <-20.000000> speed <66.664835>;
   turn lbleg2 to z-axis <0.000000> speed <40.000000>;
   turn lbleg3 to z-axis <40.000000> speed <13.335165>;
   turn lbclaw to z-axis <-25.000000> speed <26.664835>;
   turn pelvis to x-axis <0.000000> speed <13.335165>;
   sleep 375;
   }
   if( bMoving )
   {
   turn rfleg to y-axis <-10.000000> speed <133.335165>;
   turn rfleg2 to z-axis <0.000000> speed <13.335165>;
   turn rfleg3 to z-axis <-30.000000> speed <26.664835>;
   turn rfclaw to z-axis <35.000000> speed <53.335165>;
   turn lfleg to y-axis <-65.000000> speed <146.664835>;
   turn lfleg2 to z-axis <-30.000000> speed <26.664835>;
   turn lfleg3 to z-axis <-15.000000> speed <40.000000>;
   turn lfclaw to z-axis <5.000000> speed <26.664835>;
   turn rbleg to y-axis <-30.000000> speed <93.335165>;
   turn rbleg2 to z-axis <40.000000> speed <26.664835>;
   turn rbleg3 to z-axis <0.000000> speed <40.000000>;
   turn rbclaw to z-axis <5.000000> speed <26.664835>;
   turn lbleg to y-axis <35.000000> speed <146.664835>;
   turn lbleg2 to z-axis <-5.000000> speed <13.335165>;
   turn lbleg3 to z-axis <35.000000> speed <13.335165>;
   turn pelvis to z-axis <-5.000000> speed <13.335165>;
   sleep 375;
   }
   if( bMoving )
   {
   turn rfleg to y-axis <-25.000000> speed <40.000000>;
   turn rfleg2 to z-axis <15.000000> speed <40.000000>;
   turn rfleg3 to z-axis <-45.000000> speed <40.000000>;
   turn lfleg to y-axis <-70.000000> speed <13.335165>;
   turn lfleg2 to z-axis <10.000000> speed <106.664835>;
   turn lfleg3 to z-axis <-30.000000> speed <40.000000>;
   turn lfclaw to z-axis <10.000000> speed <13.335165>;
   turn rbleg to y-axis <-5.000000> speed <66.664835>;
   turn rbleg2 to z-axis <15.000000> speed <66.664835>;
   turn rbleg3 to z-axis <-45.000000> speed <120.000000>;
   turn rbclaw to z-axis <35.000000> speed <80.000000>;
   turn lbleg to y-axis <70.000000> speed <93.335165>;
   turn lbleg2 to z-axis <10.000000> speed <40.000000>;
   turn lbleg3 to z-axis <-30.000000> speed <173.335165>;
   turn lbclaw to z-axis <10.000000> speed <93.335165>;
   turn pelvis to x-axis <5.000000> speed <13.335165>;
   turn pelvis to z-axis <0.000000> speed <6.664835>;
   sleep 375;
   }
   if( bMoving )
   {
   turn rfleg to y-axis <10.000000> speed <93.335165>;
   turn rfleg2 to z-axis <40.000000> speed <66.664835>;
   turn rfleg3 to z-axis <0.000000> speed <120.000000>;
   turn rfclaw to z-axis <5.000000> speed <80.000000>;
   turn lfleg to y-axis <-40.000000> speed <80.000000>;
   turn lfleg2 to z-axis <-5.000000> speed <40.000000>;
   turn lfleg3 to z-axis <20.000000> speed <133.335165>;
   turn lfclaw to z-axis <-15.000000> speed <66.664835>;
   turn rbleg to y-axis <20.000000> speed <66.664835>;
   turn rbleg2 to z-axis <0.000000> speed <40.000000>;
   turn rbleg3 to z-axis <-40.000000> speed <13.335165>;
   turn rbclaw to z-axis <25.000000> speed <26.664835>;
   turn lbleg to y-axis <65.000000> speed <13.335165>;
   turn lbleg2 to z-axis <-30.000000> speed <106.664835>;
   turn lbleg3 to z-axis <-15.000000> speed <40.000000>;
   turn lbclaw to z-axis <5.000000> speed <13.335165>;
   turn pelvis to x-axis <0.000000> speed <13.335165>;
   sleep 375;
   }
   Func_Var_2 = 1;
   }
   if( !Func_Var_1 )
   {
   if( Func_Var_2 )
   {
   turn rfleg to y-axis <45.000000> speed <60.000000>;
   turn rfleg2 to z-axis <0.000000> speed <60.000000>;
   turn rfleg3 to z-axis <0.000000> speed <60.000000>;
   turn rfclaw to z-axis <0.000000> speed <60.000000>;
   turn lfleg to y-axis <-45.000000> speed <60.000000>;
   turn lfleg2 to z-axis <0.000000> speed <60.000000>;
   turn lfleg3 to z-axis <0.000000> speed <60.000000>;
   turn lfclaw to z-axis <0.000000> speed <60.000000>;
   turn rbleg to y-axis <-45.000000> speed <60.000000>;
   turn rbleg2 to z-axis <0.000000> speed <60.000000>;
   turn rbleg3 to z-axis <0.000000> speed <60.000000>;
   turn rbclaw to z-axis <0.000000> speed <60.000000>;
   turn lbleg to y-axis <45.000000> speed <60.000000>;
   turn lbleg2 to z-axis <0.000000> speed <60.000000>;
   turn lbleg3 to z-axis <0.000000> speed <60.000000>;
   turn lbclaw to z-axis <0.000000> speed <60.000000>;
   turn pelvis to x-axis <0.000000> speed <10.000000>;
   turn pelvis to z-axis <0.000000> speed <10.000000>;
   Func_Var_2 = 0;
   }
   sleep 100;
   }
   }
}

Create()
{
   turn rfleg to y-axis <45.000000> now;
   turn lfleg to y-axis <-45.000000> now;
   turn rbleg to y-axis <-45.000000> now;
   turn lbleg to y-axis <45.000000> now;
   bMoving = FALSE;
   ShieldOn = 0;
   ShieldBlocks = 0;
   ShieldPower = 0;
   DamageNow = 100;
   LastDamage = 100;

   hide flare;
   hide shield;
   hide gema;
   hide gemb;
   hide gemc;
   
   set ARMORED to 0;

   spin flare around z-axis speed <2000.00>;

   start-script ShieldUnit();
   start-script MotionControl();
   
   while( get BUILD_PERCENT_LEFT )
   {
   sleep 500;
   }
   
   ShieldOn = 1;
   ShieldBlocks = 1;
   ShieldPower = 250;
   LastDamage = get HEALTH;
   set ARMORED to 1;
   show gema;
   hide gemd;
   
   spin shield around y-axis speed <-720.00>;
}

StartMoving()
{
   bMoving = TRUE;
}

StopMoving()
{
   bMoving = FALSE;
}

RestoreAfterDelay()
{
   sleep 5000;
   set-signal-mask 0;
   turn turret to y-axis <0.000000> speed <30.000000>;
   turn pitchturret to x-axis <0.000000> speed <30.000000>;
}

SweetSpot(piecenum)
{
   piecenum = pelvis;
}

AimFromPrimary(PieceNum)
{
   PieceNum = barrel;
}

QueryPrimary(PieceNum)
{
   PieceNum = fire;
}

AimPrimary(Heading, Pitch)
{
   signal 2;
   set-signal-mask 2;
   turn turret to y-axis Heading speed <120.00>;
   turn pitchturret to x-axis <0.00> - Pitch speed <40.00>;
   wait-for-turn turret around y-axis;
   wait-for-turn pitchturret around x-axis;
   start-script RestoreAfterDelay();
   return (1);
}

FirePrimary()
{
   move barrel to z-axis [-1.00] speed [10.00];
   show flare;
   sleep 100;
   hide flare;
   sleep 500;
   move barrel to z-axis [0.00] speed [1.00];
}

QueryNanoPiece(PieceNum)
{
   PieceNum = spray;
}

StartBuilding(Heading, Pitch)
{
   signal 32;
   set-signal-mask 32;
   turn turret to y-axis Heading speed <120.00>;
   turn larm to x-axis <0.00> - Pitch speed <40.00>;
   wait-for-turn turret around y-axis;
   wait-for-turn larm around x-axis;
   set INBUILDSTANCE to 1;
}

TargetCleared(Func_Var_1)
{
   signal 32;
   set-signal-mask 32;
   call-script RestoreAfterDelay();
}

StopBuilding()
{
   set INBUILDSTANCE to 0;
   signal 32;
   set-signal-mask 32;
   call-script RestoreAfterDelay();
}

Killed(severity, corpsetype)
{
   hide flare;
   if( severity <= 25 )
   {
   corpsetype = 1;
   explode pelvis type BITMAPONLY | BITMAP1;
   explode turret type BITMAPONLY | BITMAP2;
   explode pitchturret type BITMAPONLY | BITMAP2;
   return (0);
   }
   if( severity <= 50 )
   {
   corpsetype = 2;
   explode pelvis type SHATTER | BITMAP1;
   explode turret type SHATTER | BITMAP2;
   explode pitchturret type SHATTER | BITMAP1;
   return (0);
   }
   corpsetype = 3;
   explode pelvis type BITMAPONLY | BITMAP1;
   explode turret type BITMAPONLY | BITMAP1;
   explode pitchturret type SHATTER | EXPLODE_ON_HIT | BITMAP4;
}

脚本没简介的话,没几个看得懂的啊,哈哈。
而且EXC 2最大的更新其实是平衡的调整,加分支持