设为首页收藏本站

红警DIY论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4220|回复: 11

一个想法,集思广益,共同学习~如何创建一个‘类暴民’

[复制链接]
发表于 2012-2-27 06:15:16 | 显示全部楼层 |阅读模式
这里所谓‘类暴民’兵种,就是多个步兵单位整合在一起被玩家控制,并且有不同的攻击方式甚至分工。
比如说一个狙击小队,里面包括一个狙击手和一个观察员,如果这个狙击小队里面的狙击手over了之后,这个狙击小队就只有一个观察员,攻击方式成为普通的手枪,但是观察距离很远,并且探隐形。但如果观察员over了,只留下狙击手的话,攻击方式为狙击枪,观察距离就变得比较近,当然也可探测隐形。并且这个‘类暴民’兵种里面的两个成员不会像暴民那样会在一定情况下再生。
我试着创建了一下,将美国的狙击手和中国的火箭兵整合在一起,并修改了相应的参数使之成为上述各有特点的新兵种,然后在中国阵营里面创建了一个“SniperTeam”的步兵单位,整合了这两个兵种。可是游戏里面造出来的这个兵种,没有图像,就是说看不到有兵,但是拖拉选中的时候,右边却有美国狙击手的图像,声音等参数也正常。。。好了,我就阐述到这里,有没有moder有类似的修改暴民类兵种的经验啊?
 楼主| 发表于 2012-2-27 06:19:50 | 显示全部楼层
额,小弟初来乍到,不懂规矩,没注意发帖的地方。。。这里是不是只讨论红警啊?我换个地方发。。。
发表于 2012-2-27 07:37:36 | 显示全部楼层
  Behavior            = SpawnBehavior ModuleTag_05
    SpawnNumber       = 2
    SpawnReplaceDelay = 999999999999999999999
        SpawnTemplateName = 观察员
        SpawnTemplateName =焗鸡手

其他全部复制原版的mob
 楼主| 发表于 2012-2-28 22:39:13 | 显示全部楼层
恩,谢谢,我按照你的方法做成功了,但是有几个问题。
 楼主| 发表于 2012-2-28 22:59:12 | 显示全部楼层
恩,谢谢,我按照你的方法做成功了,但是有几个问题。
1. 造出来的单位中,狙击手和观察员是分别得血条,但因为在SpawnBehavior ModuleTag_05里面有
SlavesHaveFreeWill = No,所以控制是对整个小队的控制,即使选中单独的狙击手或者观察员,也是会控制整个小队。
那么该如何去掉单独的血条呢?就好像暴民里面的单独单位没有血条,而是共享一个血条。我观察过了暴民里面各个单独兵种的代码,没有发现类似于不显示血条的代码,或许是我观察的不仔细,或者是有些代码我看不懂。
2. 因为我现在用的单位没有进行特别处理,完全就是本来的美国狙击手和中国火箭兵,只不过side改成了China,那对于
他们的视野,到底是由SniperTeam这个步兵单位里面的VisionRange和ShroudClearingRange决定呢,还是由狙击手和火箭兵各自的视野来决定呢?(所谓由各自来决定,假设狙击手视野比火箭兵大,那狙击手over之后视野变小,成为火箭兵的视野)
3. 在SniperTeam里面控制单位进阶的IsTrainable = No,但是狙击手进阶为二级后,整个SniperTeam也进阶为二级了。有方法可以让这个SniperTeam进阶而不是Team里面单独的单位进阶么?

我的问题有些低水平,毕竟sage引擎功能很强大,有很多我不懂甚至不了解的命令及行为,关键目的在于学习,希望各位高手前辈不吝赐教,感激不尽。
 楼主| 发表于 2012-2-28 22:59:36 | 显示全部楼层
本帖最后由 赤雪 于 2012-2-28 23:01 编辑

网络卡,多发了一遍,我给删了。。
发表于 2012-2-28 23:55:14 | 显示全部楼层
1 血条什么的不影响,直接无视掉算了
2 你可以试试team的视野非常大,比如全图,内部兵视野正常,或者相反来验证
3 复制个不能升级的焗鸡手
 楼主| 发表于 2012-3-1 01:03:57 | 显示全部楼层
嘿嘿,谢谢你。刚才又看了一下代码,基本上这几个问题解决了。
1. 是否显示血条由ENGINEERING Parameters 下面的 KindOf来决定,如果KindOf后面有IGNORED_IN_GUI (在用户图形界面忽略) ,那就不显示血条,不过我只在类暴民兵种里面用了一下这个,不知道单独的兵种是否也会不显示血条。。
2. 视野好像由整个team单位以及小队中的成员共同决定,取视野最大的一个。
3. 至于经验值。。。小队内的两个成员都无法进阶的话,即使这个小队单位的IsTrainable = Yes,也是不能进阶的。狙击手的血条去掉之前,反而小队能进阶,其实就是狙击手的等级。。

不过到目前为止还有一些不明白的地方,等有时间慢慢整理上来~
 楼主| 发表于 2012-3-1 01:58:40 | 显示全部楼层
现附上代码,希望高手提供宝贵意见
狙击小队:
Object ChinaInfantrySniperTeamNexus

;**** ART Parameters **************************

  SelectPortrait = SAPathfinder1_L
  ButtonImage    = SAPathfinder
  
  ;UpgradeCameo1 = NONE
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes
    DefaultConditionState
      Model = None
;      Model = AVBomber_B
    End
  End


;****DESIGN parameters **************************

  DisplayName      = OBJECT:AngryMobNexus
  Side = China

  RadarPriority       = NOT_ON_RADAR

  EditorSorting   = INFANTRY
  TransportSlotCount = 2                 ;how many "slots" we take in a transport (0 == not transportable)

  WeaponSet
    Conditions = None
    Weapon = PRIMARY GLAAngryMobNexusHarmlessWeapon
    Weapon = SECONDARY GLAAngryMobNexusHarmlessWeapon
    Weapon = TERTIARY GLAAngryMobNexusHarmlessWeapon
  End


  ArmorSet
    Conditions      = None
    Armor           = InvulnerableAllArmor
    DamageFX        = None
  End

  BuildCost       = 1400
  BuildTime       = 12.0          ;in seconds   
  VisionRange     = 150  ; it can scout for the spawn
  ShroudClearingRange = 0

  Prerequisites
    Object = ChinaBarracks
    ;Object = ChinaPropagandaCenter
  End

  ExperienceValue    = 150 150 200 300 ;Experience point value at each level
  ExperienceRequired = 0 10 20 30  ;Experience points needed to gain each level
  IsTrainable     = Yes
  CrushableLevel        = 2
  CommandSet    = GLAInfantryAngryMobCommandSet;

;**** AUDIO Parameters *****************************
  VoiceSelect = AngryMobVoiceSelect
  VoiceMove = AngryMobVoiceMove
  VoiceGuard = AngryMobVoiceMove
  VoiceAttack = AngryMobVoiceAttack
  SoundMoveStart = NoSound
  SoundAmbient = AngryMobAmbientLoop
  SoundAmbientRubble = NoSound
  UnitSpecificSounds
    VoiceCreate          = AngryMobVoiceCreate
  End


;**** ENGINEERING Parameters ******************************

  RadarPriority = UNIT
  KindOf = PRELOAD CAN_ATTACK INFANTRY MOB_NEXUS ATTACK_NEEDS_LINE_OF_SIGHT NO_COLLIDE SELECTABLE SCORE
  Body = ImmortalBody ModuleTag_02
    MaxHealth       = 99999.0
    InitialHealth   = 99999.0
  End

  Behavior = AIUpdateInterface ModuleTag_03
    AutoAcquireEnemiesWhenIdle = Yes
  End

  Locomotor = SET_NORMAL AngryMobNexusLocomotor ;Important! don't make the Nexus any faster!
  Locomotor = SET_WANDER AngryMobNexusLocomotor ;Important! don't make the Nexus any faster!
  Locomotor = SET_PANIC AngryMobNexusLocomotor ;Important! don't make the Nexus any faster!

;  Locomotor = SET_NORMAL WanderHumanLocomotor ;Important! don't make the Nexus any faster!
;  Locomotor = SET_WANDER WanderHumanLocomotor ;Important! don't make the Nexus any faster!
;  Locomotor = SET_PANIC WanderHumanLocomotor ;Important! don't make the Nexus any faster!

  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End

  Behavior            = SpawnBehavior ModuleTag_05
    SpawnNumber       = 2
    SpawnReplaceDelay = 3600000000 ; 30 seconds

        SpawnTemplateName = ChinaInfantrySniperTeamSniper
        SpawnTemplateName = ChinaInfantrySniperTeamObserver



    ExitByBudding = Yes;!

    InitialBurst = 2 ; the first set of 5 will not delay
    OneShot     = No
    AggregateHealth = Yes
    SlavesHaveFreeWill = No
  End

  Behavior = QueueProductionExitUpdate ModuleTag_06
    UnitCreatePoint   = X:  0.0  Y:  0.0   Z:0.0
    NaturalRallyPoint = X: 0.0  Y:  0.0   Z:0.0
    ExitDelay     = 5000 ; 5 sec
    InitialBurst = 5 ; the first set of 5 will not delay
  End

  Behavior = DestroyDie ModuleTag_07
    DeathTypes = ALL
  End

  Geometry = CYLINDER
  GeometryMajorRadius = 1.0
  GeometryMinorRadius = 1.0
  GeometryHeight = 1.0     
  GeometryIsSmall = Yes
  Shadow = SHADOW_VOLUME

End
 楼主| 发表于 2012-3-1 02:01:57 | 显示全部楼层
狙击手:

Object ChinaInfantrySniperTeamSniper

    ; *** ART Parameters ***
  
  UpgradeCameo1 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo2 = Upgrade_AmericaChemicalSuits
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DModelDraw ModuleTag_01

    OkToChangeModelColor = Yes

    DefaultConditionState
      Model = AIPFDR_SKN
      IdleAnimation = AIPFDR_SKL.AIPFDR_STA
      IdleAnimation = AIPFDR_SKL.AIPFDR_IDA
      AnimationMode = ONCE
      WeaponFireFXBone = PRIMARY Muzzle
      WeaponMuzzleFlash = PRIMARY MuzzleFX
      TransitionKey = TRANS_Standing
    End
    AliasConditionState = REALLYDAMAGED

    ConditionState = MOVING
      Animation = AIPFDR_SKL.AIPFDR_RNA 25
      AnimationMode = LOOP
      Flags = RANDOMSTART
      TransitionKey = TRANS_Standing
      ParticleSysBone   = None InfantryDustTrails
    End
    AliasConditionState = MOVING REALLYDAMAGED

    ConditionState  = FIRING_A
      Animation     = AIPFDR_SKL.AIPFDR_ATB                 ; recoil in standing position
      AnimationMode = ONCE
      TransitionKey = TRANS_FiringA
    End
    AliasConditionState = FIRING_A MOVING
    AliasConditionState = FIRING_A MOVING REALLYDAMAGED
    AliasConditionState = FIRING_A REALLYDAMAGED

    ConditionState  = BETWEEN_FIRING_SHOTS_A
      Animation     = AIPFDR_SKL.AIPFDR_ATBST               ; motionless in standing position
      AnimationMode = ONCE
      WaitForStateToFinishIfPossible = TRANS_FiringA
    End
    AliasConditionState = BETWEEN_FIRING_SHOTS_A REALLYDAMAGED
    AliasConditionState = RELOADING_A
    AliasConditionState = RELOADING_A REALLYDAMAGED

    ConditionState = DYING
      Animation = AIPFDR_SKL.AIPFDR_DTA
      AnimationMode = ONCE
      TransitionKey = TRANS_Dying
    End
   
    TransitionState = TRANS_Dying TRANS_Flailing
      Animation = AIPFDR_SKL.AIPFDR_ADTA1
      AnimationMode = ONCE
    End

    ConditionState = DYING EXPLODED_FLAILING
      Animation = AIPFDR_SKL.AIPFDR_ADTA2
      AnimationMode = LOOP
      TransitionKey = TRANS_Flailing
    End

    ConditionState = DYING EXPLODED_BOUNCING
      Animation = AIPFDR_SKL.AIPFDR_ADTA3
      AnimationMode = ONCE
      TransitionKey = None
    End

    ConditionState = FREEFALL
      Animation = AIPFDR_SKL.AIPFDR_PFL
      AnimationMode = LOOP
      TransitionKey = TRANS_Falling
    End
    AliasConditionState = FREEFALL DYING

    ConditionState = PARACHUTING
      Animation = AIPFDR_SKL.AIPFDR_PHG
      AnimationMode = LOOP
      Flags = PRISTINE_BONE_POS_IN_FINAL_FRAME  
      ;our bone positions should come from the last frame, rather than the first
      TransitionKey = TRANS_Chute
    End
    AliasConditionState = PARACHUTING DYING


    TransitionState = TRANS_Falling TRANS_Chute
      Animation = AIPFDR_SKL.AIPFDR_POP
      AnimationMode = ONCE
      Flags = PRISTINE_BONE_POS_IN_FINAL_FRAME  
      ;our bone positions should come from the last frame, rather than the first
    End

    TransitionState = TRANS_Chute TRANS_Standing
      Animation = AIPFDR_SKL.AIPFDR_PTD
      AnimationMode = ONCE
    End
  End

  
  ; ***DESIGN parameters ***
  DisplayName      = OBJECTathfinder
  Side = China
  EditorSorting = INFANTRY
  TransportSlotCount = 1                 ;how many "slots" we take in a transport (0 == not

transportable)
  
  WeaponSet
    Conditions = None
    Weapon = PRIMARY USAPathfinderSniperRifle
  End
  ArmorSet
    Conditions      = None
    Armor           = HumanArmor
    DamageFX        = InfantryDamageFX
  End

  VisionRange = 200
  ShroudClearingRange = 400
  Prerequisites
    Object = AmericaBarracks
    Science = SCIENCE_Pathfinder
  End
  BuildCost = 600
  BuildTime = 10.0          ;in seconds  
  
  ExperienceValue = 40 40 60 80    ;Experience point value at each level
  ExperienceRequired = 0 50 100 200   ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrushableLevel      = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaInfantryPathfinderCommandSet

;**** AUDIO Parameters ************************
  VoiceSelect = PathfinderVoiceSelect
  VoiceMove = PathfinderVoiceMove
  VoiceGuard = PathfinderVoiceMove
  VoiceAttack = PathfinderVoiceAttack
  VoiceFear = PathfinderVoiceFear
  SoundStealthOn = StealthOn
  SoundStealthOff = StealthOff
  VoiceFear = PathfinderVoiceFear
  
  UnitSpecificSounds
    VoiceCreate          = PathfinderVoiceCreate
    VoiceGarrison = PathfinderVoiceGarrison
    VoiceEnter = PathfinderVoiceMove
    VoiceEnterHostile =  PathfinderVoiceMove
    VoiceGetHealed      = PathfinderVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  Behavior                = ArmorUpgrade ModuleTag_Armor01
    TriggeredBy           = Upgrade_AmericaChemicalSuits
  End
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS INFANTRY

STEALTH_GARRISON IGNORED_IN_GUI SCORE CANNOT_RETALIATE

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 120.0
    InitialHealth   = 120.0
  End

  Behavior = AIUpdateInterface ModuleTag_03
    AutoAcquireEnemiesWhenIdle = Yes Stealthed
    MoodAttackCheckRate        = 250
  End

  Behavior = AutoFindHealingUpdate   ModuleTag_04 ; This update will have the unit go to a healing

station if injured. jba
    ScanRate = 1000 ; once a second.
    ScanRange = 300 ;
    NeverHeal = 0.85 ;  don't heal if we are > 85% healthy.
    AlwaysHeal = 0.25 ; if we get below 25%, find healing right away.
  End

  Locomotor = SET_NORMAL RedguardLocomotor

  Behavior = PhysicsBehavior ModuleTag_06
    Mass = 5.0
  End

  Behavior = MobMemberSlavedUpdate ModuleTag_07
    MustCatchUpRadius   = 80
    NoNeedToCatchUpRadius = 40
    Squirrelliness = 0.05
    CatchUpCrisisBailTime = 30; this is in calls to this update, not in frames
  End

  Behavior = StealthDetectorUpdate ModuleTag_08
    DetectionRate   = 500   ; how often to rescan for stealthed things in my sight (msec)
    DetectionRange = 200 ;Dustin, enable this for independant balancing!
    CanDetectWhileGarrisoned  = No ;Garrisoned means being in a structure that you units can shoot out

of.
    CanDetectWhileContained   = No ;Contained means being in a transport or tunnel network.
  End
  Behavior = StealthUpdate ModuleTag_09
    StealthDelay                = 0           ; msec
    StealthForbiddenConditions  = MOVING ; stays stealthy while attacking
    FriendlyOpacityMin          = 30.0%
    FriendlyOpacityMax          = 80.0%
    PulseFrequency              = 500   ; msec
    MoveThresholdSpeed          = 3
    InnateStealth               = Yes
    OrderIdleEnemiesToAttackMeUponReveal  = Yes
  End

  Behavior = SquishCollide ModuleTag_10
    ;nothing
  End


; --- begin Death modules ---
  Behavior = SlowDeathBehavior ModuleTag_Death01
    DeathTypes          = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA -

POISONED_GAMMA
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_PathfinderDie
  End
  Behavior = SlowDeathBehavior ModuleTag_Death02
    DeathTypes          = NONE +CRUSHED +SPLATTED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_GIDieCrushed
  End
  Behavior = SlowDeathBehavior ModuleTag_Death03
    DeathTypes          = NONE +EXPLODED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_PathfinderDie
    FlingForce          = 8
    FlingForceVariance  = 3
    FlingPitch          = 60
    FlingPitchVariance  = 10
  End
  Behavior = SlowDeathBehavior ModuleTag_Death04
    DeathTypes          = NONE +BURNED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByFireUSA
    OCL                 = INITIAL OCL_FlamingInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death05
    DeathTypes          = NONE +POISONED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinUSA
    OCL                 = INITIAL OCL_ToxicInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death06 ; don't forget to give it a new, unique module tag
    DeathTypes          = NONE +POISONED_BETA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinUSA
    OCL                 = INITIAL OCL_ToxicInfantryBeta ;you'll have to create this OCL and make it

use the blue guys instead of green ones
  End

  Behavior = SlowDeathBehavior ModuleTag_Death07
    DeathTypes          = NONE +POISONED_GAMMA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinUSA
    OCL                 = INITIAL OCL_ToxicInfantryGamma
  End
; --- end Death modules ---

  Behavior = PoisonedBehavior ModuleTag_13
    PoisonDamageInterval = 100  ; Every this many msec I will retake the poison damage dealt me...
    PoisonDuration = 3000       ; ... for this long after last hit by poison damage
  End

  Geometry = CYLINDER
  GeometryMajorRadius = 10.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 12.0
  GeometryIsSmall = Yes
  Shadow = SHADOW_DECAL
  ShadowSizeX = 14;
  ShadowSizeY = 14;
  ShadowTexture = ShadowI;
  BuildCompletion = APPEARS_AT_RALLY_POINT

End
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|手机版|管理员邮箱|红警DIY官方论坛    

GMT+8, 2017-5-28 20:28 , Processed in 0.056892 second(s), 19 queries , Xcache On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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