Nooboi
  • Nooboi
  • 58.5% (Neutral)
  • Private Topic Starter
4 years ago
Hello,
I was making a tank that had its modified gun, model, and damage i call it BallisticSniper
yet it worked but when i go to the warfactory it shows but it cannot be buildable and i cant see its cot price there. Can i have some help? thanks.

This is the code that i put in TankGeneral.ini (yes it was a tank general tank of an artillery)


;------------------------------------------------------------------------------
Object Tank_ChinaTankBallisticSniper

  ; *** ART Parameters ***
  SelectPortrait         = Rank_Lieutenant_China
  ButtonImage            = Rank_Lieutenant_China
  
  UpgradeCameo1 = Upgrade_Nationalism
  UpgradeCameo2 = Upgrade_ChinaUraniumShells
  UpgradeCameo3 = Upgrade_ChinaNuclearTanks
  UpgradeCameo4 = Tank_Upgrade_ChinaTankAutoLoader
  ;UpgradeCameo5 = NONE
  
  Draw = W3DTankDraw ModuleTag_01
    OkToChangeModelColor = Yes
    DefaultConditionState
      Model               = NVBtMstr
      Turret              = Turret
      TurretPitch         = TurretEL
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponLaunchBone = PRIMARY Muzzle
    End
    ConditionState = REALLYDAMAGED
      Model               = NVBtMstr_D
      Turret              = Turret
      TurretPitch         = TurretEL
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponLaunchBone = PRIMARY Muzzle
    End

    TrackMarks              = EXTnkTrack.tga
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:BallisticSniper
  Side = ChinaTankGeneral
  EditorSorting   = VEHICLE
  TransportSlotCount = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY Tank_AdvancedSniperGun
  End
  WeaponSet
    Conditions = PLAYER_UPGRADE 
    Weapon = PRIMARY Tank_AdvancedSniperGunUpgraded ;with autoloader
  End
  ArmorSet
    Conditions      = None
    Armor           = TankArmor
    DamageFX        = TankDamageFX
  End
  Buildable       = Yes  ;no means it makes it unbuildable
  BuildCost       = 1100
  BuildTime       = 12.0          ;in seconds    
  VisionRange     = 250
  ShroudClearingRange = 450
  Prerequisites
    Object = Tank_ChinaWarFactory
  End

  ExperienceValue = 100 100 200 400    ;Experience point value at each level
  ExperienceRequired = 0 200 300 600 ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet       = Tank_ChinaVehicleBattleMasterCommandSet ;idk

  ; *** AUDIO Parameters ***
  VoiceSelect = BattleMasterTankVoiceSelect
  VoiceMove = BattleMasterTankVoiceMove
  VoiceGuard = BattleMasterTankVoiceMove
  VoiceAttack = BattleMasterTankVoiceAttack
  SoundMoveStart = BattleMasterTankMoveStart
  SoundMoveStartDamaged = BattleMasterTankMoveStart

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate          = BattleMasterTankVoiceCreate
    TurretMoveStart = NoSound
    TurretMoveLoop = TurretMoveLoop
    VoiceCrush = BattleMasterTankVoiceCrush
    VoiceEnter = BattleMasterTankVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 600.0
    InitialHealth   = 600.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 800
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = VeterancyGainCreate ModuleTag_14
    StartingLevel = VETERAN
  End


  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate = 120   ; turn rate, in degrees per sec
      ControlledWeaponSlots = PRIMARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End

  Locomotor = SET_NORMAL BattleMasterLocomotor
  Locomotor = SET_NORMAL_UPGRADED NuclearBattleMasterLocomotor

  Behavior = HordeUpdate ModuleTag_04
    RubOffRadius = 150    ; if I am this close to a real hordesman, I will get to be an honorary hordesman
    UpdateRate = 1000     ; how often to recheck horde status (msec)
    Radius = 75           ; how close other units must be to us to count towards our horde-ness (~30 feet or so)
    KindOf = VEHICLE      ; what KindOf's must match to count towards horde-ness
    AlliesOnly = Yes      ; do we only count allies towards horde status? 
    ExactMatch = Yes      ; do we only count units of our exact same type towards horde status? (overrides kindof)
    Count = 3             ; how many units must be within Radius to grant us horde-ness
    Action = HORDE        ; when horde-ing, grant us the HORDE bonus
  End

  Behavior = PhysicsBehavior ModuleTag_05
    Mass = 40.0
  End

  Behavior = FireWeaponWhenDeadBehavior ModuleTag_06
    DeathWeapon   = NuclearTankDeathWeapon
    StartsActive  = No                        ; turned on by upgrade
    TriggeredBy   = Upgrade_ChinaNuclearTanks
  End
  Behavior = LocomotorSetUpgrade ModuleTag_07
    TriggeredBy = Upgrade_ChinaNuclearTanks
  End
  Behavior = WeaponSetUpgrade ModuleTag_17
    TriggeredBy = Tank_Upgrade_ChinaTankAutoLoader
  End

  ; A crushing defeat
  Behavior = DestroyDie ModuleTag_08
    DeathTypes = NONE +CRUSHED +SPLATTED
  End
  Behavior = FXListDie ModuleTag_09
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End
  Behavior = CreateObjectDie ModuleTag_10
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End
  Behavior = CreateCrateDie ModuleTag_11
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End


  Behavior = SlowDeathBehavior ModuleTag_12
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 25
    DestructionDelay = 200
    DestructionDelayVariance = 100
    OCL = FINAL    OCL_ChinaTankBattleMasterDebris
    FX  = FINAL    FX_BattleMasterExplosionOneFinal
  End

  Behavior = TransitionDamageFX ModuleTag_13
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 13.0
  GeometryMinorRadius = 9.0
  GeometryHeight = 10     
  GeometryIsSmall = Yes
  Shadow = SHADOW_VOLUME    
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

And this is the one i put in CommandButton.ini


CommandButton Tank_Command_ConstructChinaBallisticSniper
  Command       = UNIT_BUILD
  Object        = Tank_ChinaTankBalliticSniper
  TextLabel     = CONTROLBAR:ConstructGLATankBattleMaster
  ButtonImage   = Rank_Lieutenant_China
  ButtonBorderType        = BUILD ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:ToolTipChinaBuildBattlemaster
End

And last on CommandSet.ini


CommandSet Tank_ChinaWarFactoryCommandSet
  1  = Tank_Command_ConstructChinaTankBattleMaster
  2  = Tank_Command_ConstructChinaTankEmperor
  3  = Tank_Command_ConstructChinaVehicleTroopCrawler
  4  = Tank_Command_ConstructChinaVehicleListeningOutpost
  5  = Tank_Command_ConstructChinaTankGattling
  7  = Tank_Command_ConstructChinaTankDragon
  8  = Command_UpgradeChinaBlackNapalm
  9  = Tank_Command_ConstructChinaBallisticSniper
  10 = Command_UpgradeChinaChainGuns
  11 = Tank_Command_ConstructChinaTankECM
  12 = Command_UpgradeChinaMines
  13 = Command_SetRallyPoint  
  14 = Command_Sell
End

Any quick helps will be appreciated much thanks.
Sponsor
UTD^Force
4 years ago
I'm not sure what would cause this problem, but have you tried removing the line?

Buildable = Yes


I haven't seen this line a lot in buildable units' code.
And what object did you base your code on?
Maybe also try to edit the original command button to construct a vehicle like this:
CommandButton Command_ConstructChinaTankBattleMaster
  Command       = UNIT_BUILD
  Object        = BallisticSniper object name
  TextLabel     = CONTROLBAR:ConstructGLATankBattleMaster
  ButtonImage   = SNBattlemaster
  ButtonBorderType        = BUILD ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:ToolTipChinaBuildBattlemaster
End
If that doesn't work try making a whole new commandset for the warfactory, you can do that by simply naming the commandset like this:
CommandSet Tank_ChinaWarFactoryCommandSetNew

That's a lot of troubleshooting attempts but that's honestly how I learnt coding this game.
In case none of this works, reply again and we can look into it together.
A Muslim, ask me anything about Islam if you want
UTD^Force
Moderator and former map reviewer
Big fan of C&C Labs
Nooboi
  • Nooboi
  • 58.5% (Neutral)
  • Private Topic Starter
4 years ago
I did try deleting the
buildable = yes
but its still not be able to buildable my problem here is it shows in the Tank Warfactory but its just an image i cant buy it.

its just a grey button for me but it works though but i litterally cant buy it from the warfactory it self.

i based the object on a copy of battlemaster itself and replaced its turret with inferno cannon's gun however it does'nt crash me so it seems like it works.

i also tried renaming the warfactory but however still didnt work.
Nooboi
  • Nooboi
  • 58.5% (Neutral)
  • Private Topic Starter
3 years ago
now that i know what is the problem is because of the CommandButton.ini

instead of typing ballistic I typed ballitic