View Single Post
Old 02-01-2006, 08:41 PM   #1 (permalink)
Waraddict
Senior Member
 
Join Date: Mar 2003
Location: Rep. of Ireland
Posts: 373
Default Getting a unit to fire a weapon upon construction

The use I have for this is complicated, so I'm cutting to the chase, I simply need to get a unit to fire a weapon upon just being built, the strange thing is, either the weapon doesn't go off or it doesn't do any damage, have a look at the code for the unit in question, Im using black lotus as a placeholder graphic....

Code:
Object SpecialSystemUnit


  VisionRange     = 0.0
  EditorSorting   = VEHICLE

  Draw = W3DModelDraw ModuleTag_01

    OkToChangeModelColor = Yes
    
    ; --- idle
    DefaultConditionState
      Model             = NIHERO_SKN
      IdleAnimation     = NIHERO_SKL.NIHERO_STA 0 17
      IdleAnimation     = NIHERO_SKL.NIHero_IDA
      IdleAnimation     = NIHERO_SKL.NIHero_IDB
      AnimationMode     = ONCE
      ;TransitionKey     = TRANS_Stand
    End
  End
  ;Draw = W3DModelDraw ModuleTag_NOTREALLYADRAW

  ;  DefaultConditionState
  ;    Model = None
      ;ParticleSysBone = None
  ;  End
  ;End

  Behavior = AIUpdateInterface ModuleTag_04
     AutoAcquireEnemiesWhenIdle = No
  End

  Locomotor = SET_NORMAL BasicHumanLocomotor

  TransportSlotCount  = 1
  MaxSimultaneousOfType = 1
  BuildCost             = 1
  BuildTime             = 1.0
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS INFANTRY SCORE PARACHUTABLE;NO_COLLIDE UNATTACKABLE INERT

  UnitSpecificSounds
    VoiceCreate     = RedGuardVoiceCreate
  End

  ArmorSet
    Conditions           = None
    Armor                = PrimaryBuildingArmor
    DamageFX             = TankDamageFX
  End

  WeaponSet
    Conditions = None 
    Weapon = PRIMARY SpecialSystemWeapon
  End

  Body = ActiveBody ModuleTag_01
    MaxHealth = 10    
    InitialHealth = 10
  End

  Behavior = FireWeaponUpdate ModuleTag_99
    Weapon = SpecialSystemWeapon
    InitialDelay = 10
  End

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

End
And the weapon...

Code:
Weapon SpecialSystemWeapon
  LeechRangeWeapon = Yes
  AttackRange = 1.0
  PrimaryDamage = 999999.0 
  PrimaryDamageRadius = 1.0 
  DamageDealtAtSelfPosition = Yes 
  RadiusDamageAffects = ALLIES 
  DamageType = POISON
  DeathType = EXTRA_2 ; Very important for this to work
  WeaponSpeed = 99999.0 
  DelayBetweenShots = 0 
  ClipSize = 1 
  ClipReloadTime = 0 
  AutoReloadsClip = No 
End
Any thoughts? personally I think this is just one of those SAGE engine bugs, for instance OCLs can behave very differently depending what module you use for them, its something along those lines...
Waraddict is offline   Reply With Quote