Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Nooboi  
#1 Posted : Friday, December 10, 2021 8:42:57 AM(UTC)
Nooboi
Private
Joined: 10/22/2021(UTC)
Posts: 28

Thanks: 6 times
Hello, i had this issue when i play the game it crashes because it wont work but however it seems like i cant find the problem.

I Tried using a tank model and inputted some codes in it but it still crashes is there something wrong in my code?

Code:

Object GermanTigerI

 ; *** ART Parameters ***
 SelectPortrait   = SGTiger
 ButtonImage      = SGTiger
 
 ;UpgradeCameo1 = Upgrade_GermanSteel
 ;UpgradeCameo2 = Upgrade_TigerGunUpgrade
 ;UpgradeCameo3 = NONE
 ;UpgradeCameo4 = NONE
 ;UpgradeCameo5 = NONE
 
 Draw = W3DTankDraw ModuleTag_01
  OkToChangeModelColor = Yes

  ConditionState = NONE
   Model = GMTigerI
   Turret = Turret
   ShowSubObject = Barrel01 BarrelA01
   HideSubObject = BarrelUp01 BarrelB01 GumaUp02 BarrelAUp01
   WeaponFireFXBone = PRIMARY WeaponAUP01
   WeaponRecoilBone = PRIMARY BarrelUP01
   WeaponMuzzleFlash = PRIMARY FXAUP01
   WeaponLaunchBone = PRIMARY WeaponAUP01
  End

  ConditionState = REALLYDAMAGED
   Model = GMTigerI_D
   Turret = Turret
   ShowSubObject = Barrel01 BarrelA01
   HideSubObject = BarrelUp01 BarrelB01 GumaUp02 BarrelAUp01
   WeaponFireFXBone = PRIMARY WeaponAUP01
   WeaponRecoilBone = PRIMARY BarrelUP01
   WeaponMuzzleFlash = PRIMARY FXAUP01
   WeaponLaunchBone = PRIMARY WeaponAUP01
  End

  ConditionState = RUBBLE
   Model = GMTigerI_D
   Turret = Turret
   ShowSubObject = Barrel01 BarrelA01
   HideSubObject = BarrelUp01 BarrelB01 GumaUp02 BarrelAUp01
   WeaponFireFXBone = PRIMARY WeaponAUP01
   WeaponRecoilBone = PRIMARY BarrelUP01
   WeaponMuzzleFlash = PRIMARY FXAUP01
   WeaponLaunchBone = PRIMARY WeaponAUP01
  End

; Upgrade
  ConditionState = WEAPONSET_PLAYER_UPGRADE
   Model = GMTigerI
   Turret = Turret
   ShowSubObject = BarrelUp01 BarrelB01 GumaUp02 BarrelAUp01
   HideSubObject = Barrel01 BarrelA01
   WeaponFireFXBone = PRIMARY WeaponAUP01
   WeaponRecoilBone = PRIMARY BarrelUP01
   WeaponMuzzleFlash = PRIMARY FXAUP01
   WeaponLaunchBone = PRIMARY WeaponAUP01
  End

  ConditionState = REALLYDAMAGED WEAPONSET_PLAYER_UPGRADE
   Model = GMTigerI_D
   Turret = Turret
   ShowSubObject = BarrelUp01 BarrelB01 GumaUp02 BarrelAUp01
   HideSubObject = Barrel01 BarrelA01
   WeaponFireFXBone = PRIMARY WeaponAUP01
   WeaponRecoilBone = PRIMARY BarrelUP01
   WeaponMuzzleFlash = PRIMARY FXAUP01
   WeaponLaunchBone = PRIMARY WeaponAUP01
  End

  ConditionState = RUBBLE WEAPONSET_PLAYER_UPGRADE
   Model = GMTigerI_D
   Turret = Turret
   ShowSubObject = BarrelUp01 BarrelB01 GumaUp02 BarrelAUp01
   HideSubObject = Barrel01 BarrelA01
   WeaponFireFXBone = PRIMARY WeaponAUP01
   WeaponRecoilBone = PRIMARY BarrelUP01
   WeaponMuzzleFlash = PRIMARY FXAUP01
   WeaponLaunchBone = PRIMARY WeaponAUP01
  End

  TrackMarks = EXTnkTrack.tga
  TreadAnimationRate = 2.0; amount of tread texture to move per second
  TreadDriveSpeedFraction = 0.3 ; fraction of locomotor speed below which treads stop moving.
  TreadPivotSpeedFraction = 0.6 ; fraction of locomotor speed below which we allow pivoting.

 End

 ; ***DESIGN parameters ***
 DisplayName      = OBJECT:Tiger
 Side             = GLA
 EditorSorting    = VEHICLE
 TransportSlotCount  = 3         ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY Tiger1NormalGun
  End
  WeaponSet
    Conditions = PLAYER_UPGRADE
    Weapon = PRIMARY Tiger1MorePenertration
  End
 ArmorSet
  Conditions = None
  Armor       = TankArmor
  DamageFX    = TankDamageFX
 End
 BuildCost    = 1000
 BuildTime    = 12.0     ;in seconds  
 VisionRange   = 155
 ShroudClearingRange = 300
 Prerequisites
  Object = AmericaWarFactory
  ;Science = SCIENCE_HeavyTanks
 End

 ExperienceValue = 100 100 200 300  ;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     = 3 ;What am I?:    0 = for infantry, 1 = for trees, 2 = general vehicles
 CommandSet      = GenericCommandSet

 ; *** AUDIO Parameters ***
 VoiceSelect           = TigerTankVoiceSelect
 VoiceMove             = TigerTankVoiceMove
 VoiceGuard            = TigerTankVoiceMove
 VoiceAttack           = TigerTankVoiceAttack
 SoundMoveStart        = TigerTankMoveStart
 SoundMoveStartDamaged = TigerTankMoveStart

 UnitSpecificSounds
  ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
  VoiceCreate     = TigerTankVoiceCreate
  ;TurretMoveStart = NoSound
  TurretMoveLoop  = TurretMoveLoop
  VoiceSalvage    = TigerTankVoiceSalvage
  VoiceCrush      = TigerTankVoiceCrush
  VoiceEnter      = TIgerTankVoiceMove
 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    = 800.0
  InitialHealth  = 800.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 = 860
  SubdualDamageHealRate = 500
  SubdualDamageHealAmount = 50
 End

  Behavior = AIUpdateInterface ModuleTag_03
   Turret
     TurretTurnRate = 40
     RecenterTime = 3000
     ControlledWeaponSlots = PRIMARY
   End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL TigerLocomotor
 Behavior = PhysicsBehavior ModuleTag_04
   Mass = 50.0
 End

 ; Catch fire, and explode death
 Behavior = SlowDeathBehavior ModuleTag_06
  DeathTypes = ALL -CRUSHED -SPLATTED
  ProbabilityModifier = 50
  DestructionDelay = 1000
  DestructionDelayVariance = 300
  FX = INITIAL FX_CrusaderCatchFire
  OCL = FINAL  OCL_TigerTankDeathEffect 
  FX = FINAL  FX_BattleMasterExplosionOneFinal
 End

  Behavior = WeaponSetUpgrade ModuleTag_07
    TriggeredBy = Tank_Upgrade_ChinaTankAutoLoader
  End

 Behavior = CreateCrateDie ModuleTag_08
  CrateData = SalvageCrateData
  ;CrateData = EliteTankCrateData
  ;CrateData = HeroicTankCrateData
 End
 
 Behavior         = TransitionDamageFX ModuleTag_09
  ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
  ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
 End
 
 ; A crushing defeat
 Behavior = FXListDie ModuleTag_10
  DeathTypes = NONE +CRUSHED +SPLATTED
  DeathFX = FX_CarCrush
 End

 Behavior = FlammableUpdate ModuleTag_11
  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 = 17.0
 GeometryMinorRadius = 10.0
 GeometryHeight = 9.5   
 GeometryIsSmall = Yes 
 Shadow = SHADOW_VOLUME  
 ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length

End

;=================================================
ObjectCreationList OCL_TigerTankDeathEffect
  CreateDebris
    ModelNames = UVTigerI_D2
    Offset = X:-4.678 Y:6.497 Z:2.993
    Mass = 5.0
    Count = 1
    Disposition = SEND_IT_FLYING
    DispositionIntensity = 2.5
  End
  CreateDebris
    ModelNames = CVTank_D3
    Offset = X:-19.262 Y:0 Z:6.23
    Mass = 5.0
    Count = 1
    Disposition = SEND_IT_FLYING
    DispositionIntensity = 2.5
    BounceSound = VehicleDebris
  End
    CreateDebris
    ModelNames = AVPowTruck_d4
    Offset = X:8.721 Y:0.131 Z:14.81
    Mass = 5.0
    Count = 1
    Disposition = SEND_IT_FLYING
    DispositionIntensity = 2.5
    BounceSound = VehicleDebris
  End
End

;===================================================
Locomotor TigerLocomotor
  Surfaces            = GROUND
  Speed               = 32
  SpeedDamaged        = 32
  TurnRate            = 50
  TurnRateDamaged     = 50
  Acceleration        = 30
  AccelerationDamaged = 30   
  Braking             = 50  
  MinTurnSpeed        = 0   
  ZAxisBehavior       = NO_Z_MOTIVE_FORCE
  Appearance          = TREADS

  AccelerationPitchLimit = 2
  DecelerationPitchLimit = 2
  PitchStiffness = 0.05
  RollStiffness = 0.05
  PitchDamping = 0.8
  RollDamping = 0.3
  ForwardAccelerationPitchFactor = 0.5
  LateralAccelerationRollFactor = 0.33
End

;===================================================
CommandButton Command_ConstructGermanTigerI
  Command       = UNIT_BUILD
  Object        = GermanTigerI
  TextLabel     = CONTROLBAR:ConstructGermanTiger
  ButtonImage   = SGTiger
  ButtonBorderType        = BUILD ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:ToolTipBuildGermanTiger
End

Edited by user Wednesday, March 16, 2022 4:54:08 AM(UTC)  | Reason: testing

Sponsor
Offline UTD^Force  
#2 Posted : Saturday, December 11, 2021 4:08:57 AM(UTC)
UTD^Force
Colonel
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 8/13/2013(UTC)
Posts: 817
Jordan
Location: Middle east

Thanks: 430 times
Was thanked: 184 time(s) in 168 post(s)
I scanned through the code quickly but I didn't see anything wrong.
Is this for a map or a mod?
And if you still can't locate the problem try doing the code in steps as in set an original command button to construct your tank and give your tank an already used death effect and locomotor. If the game crashes, you know that the problem is with the tank's code itself, and if it doesn't crash then the problem is somewhere in the commandbutton/locomotor/OCL.
Last tip it's easier the read the code on the website if you set it to appear like this:

Code:
Code
 Something
  Other thing
 End
End

Just put your code between these [ucode=plain] your code [/ucode] but remove the two "u" letters.
Proud Muslim

UTD^Force

Moderator and former map reviewer
CnC Labs
Offline Nooboi  
#3 Posted : Wednesday, March 16, 2022 4:55:19 AM(UTC)
Nooboi
Private
Joined: 10/22/2021(UTC)
Posts: 28

Thanks: 6 times
So basically i found out the my COMMANDBUTTON unit didn't match with the object so it failed to construct.
and again ty for tips.

Edited by user Monday, June 20, 2022 9:00:53 PM(UTC)  | Reason: thanks i get it now :)

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.