←  C&C Generals & Zero Hour Editing

Fallout Studios Forums

»

C&C generals ZH's upgrade limit

Evil_Ultralisco's Photo Evil_Ultralisco 09 Nov 2009

hi, do you have any solution for the limit upgrade in C&C Generals ZH
Quote

Ion Cannon!'s Photo Ion Cannon! 09 Nov 2009

View PostEvil_Ultralisco, on 9 Nov 2009, 1:16, said:

hi, do you have any solution for the limit upgrade in C&C Generals ZH


Re-use old upgrades, you cannot remove the 128 upgrade limit.
Quote

H4mm3r's Photo H4mm3r 09 Nov 2009

So does that mean, 128 different upgrades (such as +25% to a weapon) or does it mean, 128 units can upgrade once? Nobody ever really explains that.
Quote

Destiny's Photo Destiny 09 Nov 2009

128 different upgrades. I'm sure common sense tells you that there are always more than 128 units on a battlefield (Excluding start of game, blablabla).
Quote

Dreadnought's Photo Dreadnought 09 Nov 2009

It can be removed by removing the script and changed by editing the script.
Quote

Kris's Photo Kris 09 Nov 2009

What script?

Anyway, the upgrade limit is Hardcoded
Quote

Amdrial's Photo Amdrial 09 Nov 2009

View PostDreadnought, on 9 Nov 2009, 3:49, said:

It can be removed by removing the script and changed by editing the script.


Oh boy, if you could tell us which script we have to remove without breaking any laws, we would have such an awesome modding breakthrough!
Quote

Kris's Photo Kris 09 Nov 2009

Heck Yes!
Quote

Ion Cannon!'s Photo Ion Cannon! 09 Nov 2009

Not really, the upgrade limit is just a minor annoyance. Its quite possible to reuse other upgrades from faction A for faction B and allow them to cost and do entirely different things.
Quote

Mbob61's Photo Mbob61 10 Nov 2009

128 upgrades should be more than enough if you reuse all the many many old zero hour ones.
Also, I'm almost definite the limit is hardcoded and breaking that is a big no no.

Mike
Quote

cccdfern's Photo cccdfern 12 Nov 2009

Aw noo!

How can I make an upgrade be unique in two forms?
Like have the basic overlord gattling cannon for china, and have an arty attachment for the americans one.
Ill upload codes.
Quote

Mbob61's Photo Mbob61 12 Nov 2009

Its quite simple really. The actual upgrade part in the upgrade ini has no specifics about faction or anything like that.
So you make an upgrade with a general sounding name like "tank advancement" or something like that.
Then use the "overlord contain" coding and have both triggered by the same upgrade. That should work ok.

Mike
Quote

cccdfern's Photo cccdfern 12 Nov 2009

Like this? Trouble is, I can't remember how I got it to work in the end.

Upgrade Upgrade_AmericaTankOverlordFireBaseTower
  DisplayName        = UPGRADE:OverlordGattlingCannon
  Type               = OBJECT
  BuildTime          = 20.0
  BuildCost          = 1200
  ButtonImage        = SSOLGattling
  ResearchSound      = OverlordTankGattlingCannonVoiceCreate
  UnitSpecificSound  = OverlordExpansion
End

Upgrade Upgrade_ChinaOverlordGattlingCannon
  DisplayName        = UPGRADE:OverlordGattlingCannon
  Type               = OBJECT
  BuildTime          = 20.0
  BuildCost          = 1200
  ButtonImage        = SSOLGattling
  ResearchSound      = OverlordTankGattlingCannonVoiceCreate
  UnitSpecificSound  = OverlordExpansion
End

CommandSet AmericaTankOverlordCommandSet
  1  = Command_UpgradeChinaOverlordBattleBunker
  3  = Command_UpgradeChinaOverlordGattlingCannon
  11 = Command_AttackMove
  13 = Command_Guard
  14 = Command_Stop
End

CommandButton Command_UpgradeAmericaTankOverlordFireBaseTower
  Command       = OBJECT_UPGRADE
  Upgrade       = Upgrade_AmericaTankOverlordFireBaseTower
  Options       = OK_FOR_MULTI_SELECT NOT_QUEUEABLE
  TextLabel     = CONTROLBAR:UpgradeAmericaTankOverlordFireBaseTower
  ButtonImage   = SAFirebase
  ButtonBorderType        = UPGRADE ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:TooltipUpgradeAmericaTankOverlordFireBaseTower
  UnitSpecificSound       = OverlordTankVoiceModeGattling
End



;------------------------------------------------------------------------------
Object AmericaTankOverlord

; *** ART Parameters ***
SelectPortrait = SNOverlord_L
ButtonImage = SNOverlord

UpgradeCameo1 = NONE
UpgradeCameo2 = NONE
UpgradeCameo3 = NONE
UpgradeCameo4 = Upgrade_ChinaOverlordGattlingCannon
UpgradeCameo5 = NONE


Draw = W3DOverlordTankDraw ModuleTag_01
ConditionState = NONE
Model               = NVOvrlrd		
Animation           = NVOvrlrd.NVOvrlrd
AnimationMode = LOOP
Turret = Turret01
WeaponFireFXBone = PRIMARY Muzzle
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY MuzzleFX
WeaponLaunchBone = PRIMARY Muzzle
End
ConditionState = REALLYDAMAGED
Model               = NVOvrlrd_d	
Animation           = NVOvrlrd_d.NVOvrlrd_d	
AnimationMode = LOOP
Turret = Turret01
WeaponFireFXBone = PRIMARY Muzzle
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY MuzzleFX
WeaponLaunchBone = PRIMARY Muzzle
End

ConditionState = RUBBLE
Model = NVOvrlrd_d
Turret = Turret01
WeaponFireFXBone = PRIMARY Muzzle
WeaponRecoilBone = PRIMARY Barrel
WeaponMuzzleFlash = PRIMARY MuzzleFX
WeaponLaunchBone = PRIMARY Muzzle
End

TrackMarks = EXTnkTrack.tga
OkToChangeModelColor = Yes
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:Overlord
Side = America
EditorSorting = VEHICLE
TransportSlotCount = 3 ;how many "slots" we take in a transport (0 == not transportable)
WeaponSet
Conditions = None
Weapon = PRIMARY DragonTankFlameWeapon
End
WeaponSet
Conditions = PLAYER_UPGRADE
Weapon = PRIMARY DragonTankFlameWeaponUpgraded
Weapon = SECONDARY GattlingBuildingGunAirDummy ;Dummy weapon that allows manual targeting of air units outside range
;gattling cannon upgrade has been made.
End
ArmorSet
Conditions = None
Armor = TankArmor
DamageFX = TankDamageFX
End
BuildCost = 2000
BuildTime = 15.0 ;in seconds
VisionRange = 150
ShroudClearingRange = 200
Prerequisites
Object = AmericaWarFactory
End

ExperienceValue = 200 200 400 600 ;Experience point value at each level
ExperienceRequired = 0 400 600 1200 ;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experience
CrusherLevel = 3 ;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 = AmericaTankOverlordCommandSet

; *** AUDIO Parameters ***
VoiceSelect = DragonTankVoiceSelect
SoundMoveStart = OverlordTankMoveStart
SoundMoveStartDamaged = OverlordTankMoveStart
VoiceMove = DragonTankVoiceMove
VoiceGuard = DragonTankVoiceMove
VoiceAttack = DragonTankVoiceAttack
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate     = DragonTankVoiceCreate
    TurretMoveStart = NoSound
    TurretMoveLoop = TurretMoveLoop
    VoiceEnter = DragonTankVoiceMove
    VoiceFlameLocation = DragonTankVoiceFireStorm
  End

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

Body = ActiveBody ModuleTag_02
MaxHealth = 1400.0
InitialHealth = 1400.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 = 2200
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 50
End

Behavior = TransportAIUpdate ModuleTag_03
Turret
TurretTurnRate = 60 ;30 ;15 // turn rate, in degrees per sec
ControlledWeaponSlots = PRIMARY
End
AutoAcquireEnemiesWhenIdle = Yes
End

Locomotor = SET_NORMAL OverlordLocomotor
Locomotor = SET_NORMAL_UPGRADED NuclearOverlordLocomotor

Behavior = FireWeaponWhenDeadBehavior ModuleTag_04
DeathWeapon = NuclearTankDeathWeapon
StartsActive = No ; turned on by upgrade
TriggeredBy = Upgrade_ChinaNuclearTanks
End
Behavior = LocomotorSetUpgrade ModuleTag_05
TriggeredBy = Upgrade_ChinaNuclearTanks
End

Behavior = ProductionUpdate ModuleTag_24
MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
End

Behavior = OverlordContain ModuleTag_06 ; Like Transport, but when full, passes transport queries along to first passenger (redirects like tunnel)
Slots = 1
DamagePercentToUnits = 100%
AllowInsideKindOf = PORTABLE_STRUCTURE
PassengersAllowedToFire = Yes
PassengersInTurret = Yes ; My passengers ride in my turret, that's where the Firepoint bones are
ExperienceSinkForRider = Yes ; I get the Exp for things my turret friend kills
End

Behavior = ObjectCreationUpgrade ModuleTag_07
UpgradeObject = OCL_OverlordGattlingCannon
TriggeredBy = Upgrade_ChinaOverlordGattlingCannon
ConflictsWith = Upgrade_ChinaOverlordPropagandaTower Upgrade_ChinaOverlordBattleBunker
End
Behavior = WeaponSetUpgrade ModuleTag_WeaponSetUpgrade01
TriggeredBy = Upgrade_ChinaOverlordGattlingCannon
ConflictsWith = Upgrade_ChinaOverlordPropagandaTower Upgrade_ChinaOverlordBattleBunker
End
Behavior = ObjectCreationUpgrade ModuleTag_08
UpgradeObject = OCL_OverlordPropagandaTower
TriggeredBy = Upgrade_ChinaOverlordPropagandaTower
ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordBattleBunker
End
Behavior = ObjectCreationUpgrade ModuleTag_09
UpgradeObject = OCL_OverlordBattleBunker
TriggeredBy = Upgrade_ChinaOverlordBattleBunker
ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordPropagandaTower
End
Behavior = ProductionUpdate ModuleTag_10
MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
End
Behavior = CommandSetUpgrade ModuleTag_11
CommandSet = ChinaTankOverlordGattlingCannonCommandSet
TriggeredBy = Upgrade_ChinaOverlordGattlingCannon
ConflictsWith = Upgrade_ChinaOverlordPropagandaTower Upgrade_ChinaOverlordBattleBunker
End
Behavior = CommandSetUpgrade ModuleTag_12
CommandSet = ChinaTankOverlordPropagandaTowerCommandSet
TriggeredBy = Upgrade_ChinaOverlordPropagandaTower
ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordBattleBunker
End
Behavior = CommandSetUpgrade ModuleTag_13
CommandSet = ChinaTankOverlordBattleBunkerCommandSet
TriggeredBy = Upgrade_ChinaOverlordBattleBunker
ConflictsWith = Upgrade_ChinaOverlordGattlingCannon Upgrade_ChinaOverlordPropagandaTower
End

Behavior = PhysicsBehavior ModuleTag_14
Mass = 50.0
End



; Smoke for a bit then explode
; Behavior = SlowDeathBehavior
;; ProbabilityModifier = 25
; DestructionDelay = 1500
; DestructionDelayVariance = 500
; FX = INITIAL FX_OverlordSmoke
; OCL = FINAL OCL_ChinaTankOverlordDebris
; FX = FINAL FX_GenericTankDeathExplosion
; End

; Catch fire, and explode death
; Behavior = SlowDeathBehavior
;; ProbabilityModifier = 25
; DestructionDelay = 2000
; DestructionDelayVariance = 300
; FX = INITIAL FX_CrusaderCatchFire
; OCL = FINAL OCL_ChinaTankOverlordDebris
; FX = FINAL FX_GenericTankDeathExplosion
; End

; Just explode death
Behavior = SlowDeathBehavior ModuleTag_16
ProbabilityModifier = 25
DestructionDelay = 200
DestructionDelayVariance = 100
OCL = FINAL OCL_ChinaTankOverlordDebris
FX = FINAL FX_OverlordExplosionOneFinal
End
Behavior = CreateCrateDie ModuleTag_17
CrateData = SalvageCrateData
;CrateData = EliteTankCrateData
;CrateData = HeroicTankCrateData
End

Behavior = TransitionDamageFX ModuleTag_18
ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_OverlordDamageTransition
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 = 26.0
GeometryMinorRadius = 13.0
GeometryHeight = 15.0
GeometryIsSmall = No
Shadow = SHADOW_VOLUME
ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaTankOverlordFireBaseTower

  ; *** ART Parameters ***
  SelectPortrait         = SNGatTower_L
  ButtonImage            = SNGatTower
  
  ;UpgradeCameo1 = Upgrade_Nationalism
  UpgradeCameo1 = Upgrade_ChinaUraniumShells
  UpgradeCameo2 = Upgrade_ChinaNuclearTanks
  ;UpgradeCameo4 = NONE
  UpgradeCameo5 = Upgrade_ChinaOverlordGattlingCannon
  
  
  Draw                    = W3DDependencyModelDraw ModuleTag_01
    OkToChangeModelColor  = Yes
    AttachToBoneInContainer = FIREPOINT01

    DefaultConditionState
      Model               = AVOvrlrd_F
      Turret              = TurretMS01
      TurretPitch         = TURRETEL
      WeaponFireFXBone    = PRIMARY Muzzle0101
      WeaponMuzzleFlash   = PRIMARY Muzzle0101
      WeaponFireFXBone    = SECONDARY Muzzle0101
      WeaponMuzzleFlash   = SECONDARY Muzzle0101
    End


    ConditionState        = REALLYDAMAGED 
      Model               = AVOvrlrd_FD
      Turret              = TurretMS01
      TurretPitch         = TURRETEL
      WeaponFireFXBone    = PRIMARY Muzzle0101
      WeaponMuzzleFlash   = PRIMARY Muzzle0101
      WeaponFireFXBone    = SECONDARY Muzzle0101
      WeaponMuzzleFlash   = SECONDARY Muzzle0101
      ParticleSysBone     = Smoke01 SmokeFactionMedium
      ParticleSysBone     = Smoke02 SmokeFactionMedium
      ParticleSysBone     = Smoke03 SmokeFactionMedium
      ParticleSysBone     = SparkM01 SparksMedium
      ParticleSysBone     = SparkM02 SparksMedium
    End

  End

  ; ***DESIGN parameters ***
  Side             = America
  EditorSorting    = SYSTEM
  TransportSlotCount = 1
  WeaponSet
    Conditions          = None 
    Weapon              = PRIMARY   FireBaseHowitzerGun
    ;Weapon              = SECONDARY GattlingBuildingGunAir
    ;PreferredAgainst    = SECONDARY BALLISTIC_MISSILE AIRCRAFT
  End
  
  ArmorSet
    Conditions     = None
    Armor          = InvulnerableAllArmor ; We can't be hurt on the field.  We share damage from the Overlord with his damage module
  End
  VisionRange     = 200

  ; *** AUDIO Parameters ***
  UnitSpecificSounds
    TurretMoveStart = NoSound
    TurretMoveLoop  = NoSound ;TurretMoveLoop
    VoiceRapidFire  = NoSound
  End

  ; *** ENGINEERING Parameters ***
  KindOf            = PRELOAD PORTABLE_STRUCTURE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CLICK_THROUGH IGNORED_IN_GUI
    Body            = StructureBody ModuleTag_02
    MaxHealth       = 100.0
    InitialHealth   = 100.0
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      ControlledWeaponSlots = PRIMARY SECONDARY
      TurretTurnRate      = 60   // turn rate, in degrees per sec
      TurretPitchRate     = 60
      AllowsPitch         = Yes
    End
    AutoAcquireEnemiesWhenIdle = Yes 
  End

  Behavior             = DestroyDie ModuleTag_04
    ;nothing
  End

  Behavior = WeaponBonusUpgrade ModuleTag_05
    TriggeredBy = Upgrade_AmericaTankOverlordFireBaseTower
  End

  Behavior = StealthDetectorUpdate ModuleTag_06
    DetectionRate   = 500   ; how often to rescan for stealthed things in my sight (msec)
    ;DetectionRange = ??? ;   Defaults to VisionRange
    CanDetectWhileContained   = Yes
  End

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

End

;------------------------------------------------------------------------------

Edited by CCCD, 12 November 2009 - 22:23.
Quote

Mbob61's Photo Mbob61 12 Nov 2009

Well, your code looks as if it will work but i thought you wanted both to work from the same upgrade.
If that is what you want you don't need to create the unique upgrade but make everything happen from the gattling cannon upgrade.
You just add that to the commandset and make the new weapon appear by the purchase of the single upgrade in places like the overlord contain and weaponset changes.
If you need more help just type in here or pm me and i will help more. I'll probably write some demo code for you to follow.

Mike

edit - A quick thing to help, everywhere you have put the new upgrade, just replace that with the gattling cannon upgrade and it should work. 1 upgrade causing multiple things to happen.
Edited by Mbob61, 12 November 2009 - 23:28.
Quote

cccdfern's Photo cccdfern 15 Nov 2009

Yeah the demo might make a bit more sense, sorry but you seem to have lost me.

This is how I think I see it, may not be correct:

Two overlords:
-Normal one for china
-New flamer one for USA with an arty upgrade

Each tank uses and upgrade, but they both get the arty, when I just want the chinese tank to upgrade
normally.


Is this easier to understand my logic or are we lost by each others tellings. ok ignore that.
Quote

Mbob61's Photo Mbob61 15 Nov 2009

Ill write out some code some time and either post it here or pm it :cool:

Mike
Quote

Mbob61's Photo Mbob61 19 Nov 2009

Sorry for double post but I thought I'd tell you the code is coming :)
I'm working on it right now.
I'll post it both in here and in a pm to you :sly: I'll edit my post when it is finished.

Mike

Ok, first the single upgrade and its commandbutton

Upgrade Upgrade_TankSpecs
  DisplayName		= UPGRADE:TankSpecs
  BuildTime		  = 60.0
  BuildCost		  = 2000
  ButtonImage		= SSCompositeArmor
  ResearchSound	  = CrusaderTankVoiceUpgradeCompositeArmor
End

CommandButton Command_UpgradeTankSpecs
  Command	   = PLAYER_UPGRADE
  Upgrade	   = Upgrade_TankSpecs
  TextLabel	 = CONTROLBAR:UpgradeAmericaCompositeArmor
  ButtonImage   = SSCompositeArmor
  ButtonBorderType		= UPGRADE; Identifier for the User as to what kind of button this is
  DescriptLabel		   = CONTROLBAR:TooltipUSAUpgradeCompositeArmor
End

Now i will add it to the warfactories of America and China. For China it replaces Chain Guns.

CommandSet AmericaWarFactoryCommandSet
  1  = Command_ConstructAmericaTankCrusader
  2  = Command_ConstructAmericaVehicleTomahawk
  3  = Command_ConstructAmericaVehicleHumvee
  4  = Command_ConstructAmericaVehicleMedic
  5  = Command_ConstructAmericaVehiclePaladin
  6  = Command_ConstructAmericaVehicleSentryDrone
  7  = Command_ConstructAmericaVehicleAvenger
  8  = Command_ConstructAmericaVehicleMicrowave
  9  = Command_UpgradeAmericaSentryDroneGun
  10 = Command_UpgradeTankSpecs
  11 = Command_UpgradeAmericaTOWMissile
  13 = Command_SetRallyPoint
  14 = Command_Sell
End


CommandSet ChinaWarFactoryCommandSet
  1  = Command_ConstructChinaTankBattleMaster
  2  = Command_ConstructChinaTankOverlord
  3  = Command_ConstructChinaVehicleTroopCrawler
  4  = Command_ConstructChinaVehicleListeningOutpost
  5  = Command_ConstructChinaTankGattling
  6  = Command_UpgradeTankSpecs
  7  = Command_ConstructChinaTankDragon
  8  = Command_UpgradeChinaBlackNapalm
  9  = Command_ConstructChinaVehicleInfernoCannon
  10 = Command_ConstructChinaVehicleNukeLauncher
  11 = Command_ConstructChinaTankECM
  12 = Command_UpgradeChinaMines
  13 = Command_SetRallyPoint
  14 = Command_Sell
End


Ok, so now the effects. Firstly the Crusader for USA. I've made the upgrade give the Crusader a massively better locomotor. I will put in bold all relevent parts in the unit code.

;------------------------------------------------------------------------------
Locomotor UberCrusaderLocomotor
  Surfaces			= GROUND
  Speed			   = 1000  ; in dist/sec
  SpeedDamaged		= 25  ; in dist/sec
  TurnRate			= 180 ;90  ; in degrees/sec
  TurnRateDamaged	 = 180 ;60  ; in degrees/sec
  Acceleration		= 1000;240;30  ; in dist/(sec^2)
  AccelerationDamaged = 1000;120 ; in dist/(sec^2)
  Braking			 = 1000;50 ; in dist/(sec^2)
  MinTurnSpeed		= 0  ; in dist/sec
  ZAxisBehavior	   = NO_Z_MOTIVE_FORCE
  Appearance		  = TREADS

  AccelerationPitchLimit = 5			 ; Angle limit how far chassis will lift or roll from acceleration.
  DecelerationPitchLimit = 5			 ; Angle limit how far chassis will dip from deceleration.
  PitchStiffness = 0.05				  ;  stiffness of the "springs" in the suspension forward & back.
  RollStiffness = 0.025				  ;  stiffness of the "springs" in the suspension side to side.
  PitchDamping = 0.8					 ;  How fast it damps.  0=perfect spring, bounces forever.  1=glued to terrain.
  RollDamping = 0.3					  ;  How fast it damps.  0=perfect spring, bounces forever.  1=glued to terrain.
  ForwardAccelerationPitchFactor = 0.3   ; How much acceleration will cause the front to lift, or dip for stops.
  LateralAccelerationRollFactor = 0.33   ;  How much cornering will cause the chassis to roll.
End

;------------------------------------------------------------------------------
Object AmericaTankCrusader

 ; *** ART Parameters ***
  SelectPortrait		 = SACLeopard_L
  ButtonImage			= SACLeopard
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_AmericaCompositeArmor
  
  Draw = W3DTankDraw ModuleTag_01
	DefaultConditionState
	  Model			   = AVLeopard
	  Turret			  = Turret
	  WeaponFireFXBone	= PRIMARY TurretMS
	  WeaponRecoilBone	= PRIMARY Barrel
	  WeaponMuzzleFlash   = PRIMARY TurretFX
	  WeaponLaunchBone = PRIMARY TurretMS
	End
	ConditionState	   = REALLYDAMAGED
	  Model			  = AVLeopard_D
	End
	ConditionState	   = RUBBLE
	  Model			  = AVLeopard_D
	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.
	OkToChangeModelColor = Yes
  End

 ; ***DESIGN parameters ***
  DisplayName	  = OBJECT:Crusader
  Side				   = America
  EditorSorting		  = VEHICLE
  TransportSlotCount	 = 3
  WeaponSet
	Conditions		   = None 
	Weapon			   = PRIMARY CrusaderTankGun
   ; Uncomment this when we want the crusader to have a machine too again
   ;Weapon			   = SECONDARY CrusaderMachineGun
  End
  ArmorSet
	Conditions		   = None
	Armor				= TankArmor
	DamageFX			 = TankDamageFX
  End
 ;ArmorSet
 ;  Conditions		   = PLAYER_UPGRADE
 ;  Armor				= UpgradedTankArmor
 ;  DamageFX			 = TankDamageFX
 ;End
  BuildCost			  = 900
  BuildTime			  = 10.0		 ;in seconds	
  VisionRange			= 150
  ShroudClearingRange = 300
  Prerequisites
	Object = AmericaWarFactory
  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			 = AmericaTankCrusaderCommandSet
  
 ; *** AUDIO Parameters ***
  VoiceSelect		   = CrusaderTankVoiceSelect
  VoiceMove			 = CrusaderTankVoiceMove
  VoiceGuard			= CrusaderTankVoiceMove
  VoiceAttack		   = CrusaderTankVoiceAttack
  SoundMoveStart		= CrusaderTankMoveStart
  SoundMoveStartDamaged = CrusaderTankMoveStart
  UnitSpecificSounds
   ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
	VoiceCreate		 = CrusaderTankVoiceCreate
	VoiceEnter			 = CrusaderTankVoiceMove
	TurretMoveStart	 = NoSound
	TurretMoveLoop	  = TurretMoveLoop
	SoundEject		  = PilotSoundEject
	VoiceEject		  = PilotVoiceEject
	VoiceCrush		  = CrusaderTankVoiceCrush
  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	   = 480
	InitialHealth   = 480

   ; 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 = 960
	SubdualDamageHealRate = 500
	SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
	Turret
	  TurretTurnRate	   = 180;60   // turn rate, in degrees per sec
	  ControlledWeaponSlots= PRIMARY
	End
	AutoAcquireEnemiesWhenIdle = Yes
  End
[b]  Locomotor			= SET_NORMAL CrusaderLocomotor
  Locomotor			= SET_NORMAL_UPGRADED UberCrusaderLocomotor

Behavior = LocomotorSetUpgrade ModuleTag_07
	TriggeredBy = Upgrade_TankSpecs
  End[/b]

  Behavior = PhysicsBehavior ModuleTag_04
	Mass				 = 50.0
  End

  Behavior = ObjectCreationUpgrade ModuleTag_05
	UpgradeObject = OCL_AmericanBattleDrone
	TriggeredBy   = Upgrade_AmericaBattleDrone
	ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_06
	UpgradeObject = OCL_AmericanScoutDrone
	TriggeredBy   = Upgrade_AmericaScoutDrone
	ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_20
	UpgradeObject = OCL_AmericanHellfireDrone
	TriggeredBy   = Upgrade_AmericaHellfireDrone
	ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End
  Behavior = ProductionUpdate ModuleTag_07
	MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_08
	TriggeredBy   = Upgrade_AmericaAdvancedTraining
	AddXPScalar   = 1.0;Increases experience gained by an additional 100%
  End
  Behavior = MaxHealthUpgrade ModuleTag_09
	TriggeredBy   = Upgrade_AmericaCompositeArmor
	AddMaxHealth  = 100.0
	ChangeType	= ADD_CURRENT_HEALTH_TOO  ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

 ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_10
	DeathTypes = ALL -CRUSHED -SPLATTED
	ProbabilityModifier  = 50
	DestructionDelay  = 500
	DestructionDelayVariance  = 100
	FX  = INITIAL  FX_GenericTankDeathEffect
	OCL = MIDPOINT OCL_GenericTankDeathEffect
	FX  = FINAL	FX_GenericTankDeathExplosion
	OCL = FINAL	OCL_CrusaderTurret
  End

 ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_11
	DeathTypes = ALL -CRUSHED -SPLATTED
	ProbabilityModifier  = 50
	DestructionDelay  = 2000
	DestructionDelayVariance  = 300
	FX  = INITIAL  FX_CrusaderCatchFire
	OCL = FINAL	OCL_GenericTankDeathEffect  
	FX  = FINAL	FX_GenericTankDeathExplosion
  End

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

  Behavior = DestroyDie ModuleTag_13
	DeathTypes = NONE +CRUSHED +SPLATTED
  End

 ; A crushing defeat
  Behavior = FXListDie ModuleTag_14
	DeathTypes = NONE +CRUSHED +SPLATTED
	DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_15
	DeathTypes = NONE +CRUSHED +SPLATTED
	CreationList = OCL_CrusaderTank_CrushEffect
  End

  Behavior					= CreateCrateDie ModuleTag_CratesChange
   CrateData			 = SalvageCrateData
  ;CrateData			 = EliteTankCrateData
  ;CrateData			 = HeroicTankCrateData
  End

  Behavior = EjectPilotDie ModuleTag_17
	GroundCreationList = OCL_EjectPilotOnGround
	AirCreationList = OCL_EjectPilotViaParachute
	ExemptStatus = HIJACKED
	VeterancyLevels =  ALL -REGULAR;only vet+ gives pilot
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
	TriggeredBy   = Upgrade_AmericaCompositeArmor
	AddMaxHealth  = 100.0
	ChangeType	= ADD_CURRENT_HEALTH_TOO  ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  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	= 15.0
  GeometryMinorRadius	= 10.0
  GeometryHeight		 = 10.0	 
  GeometryIsSmall		= Yes	
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45 ; minimum elevation angle above horizon. Used to limit shadow length

End


And for the Battlemaster I gave it much improved armour

Armor UberTankArmor
  Armor = CRUSH			  5%	 ;tanks are extra-hard to crush
  Armor = SMALL_ARMS		 2%
  Armor = GATTLING		   1%	 ;resistant to gattling tank
  Armor = COMANCHE_VULCAN	2%
  Armor = FLAME			  2%
  Armor = RADIATION		  5%	 ;Radiation does less damage to tanks. 
  Armor = MICROWAVE		  0%
  Armor = POISON			 2%	 ;Poison does a little damage, just for balance reasons.  
  Armor = SNIPER			  0%
  Armor = MELEE			   0%	 ;tanks don't generally take much damage other than paint damage from MELEE weapons
  Armor = LASER			   0%	 ;lasers are anti-personel and anti-projectile only (for point defense laser)
  Armor = HAZARD_CLEANUP	  0%	 ;Not harmed by cleaning weapons
  Armor = PARTICLE_BEAM	   1%	 ;
  Armor = KILL_PILOT		  1%	 ;Jarmen Kell uses against vehicles only.
  Armor = SURRENDER		   0%	 ;Capture type weapons are effective only against infantry.
  Armor = SUBDUAL_MISSILE	 0%
  Armor = SUBDUAL_VEHICLE	 1%
  Armor = SUBDUAL_BUILDING	0%
End

;------------------------------------------------------------------------------
Object ChinaTankBattleMaster

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

	TrackMarks			  = EXTnkTrack.tga
  End

 ; ***DESIGN parameters ***
  DisplayName	  = OBJECT:BattleMaster
  Side = China
  EditorSorting   = VEHICLE
  TransportSlotCount = 3				;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
	Conditions = None 
	Weapon = PRIMARY BattleMasterTankGun
  End

[b]  ArmorSet
	Conditions	  = None
	Armor		   = TankArmor
	DamageFX		= TankDamageFX
  End
[/b]
[b] ArmorSet
	Conditions		= PLAYER_UPGRADE
	Armor			 = UberTankArmor
	DamageFX		  = TankDamageFX
  End
  
  Behavior		= ArmorUpgrade ModuleTag_Armor01
	TriggeredBy   = Upgrade_TankSpecs
  End[/b]

  BuildCost	   = 800
  BuildTime	   = 10.0		 ;in seconds	
  VisionRange	 = 150
  ShroudClearingRange = 300
  Prerequisites
	Object = 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	   = ChinaVehicleBattleMasterCommandSet

 ; *** 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	   = 400.0
	InitialHealth   = 400.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 = 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 = 5			; 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 = VeterancyGainCreate ModuleVet_01
	StartingLevel = ELITE
	ScienceRequired = SCIENCE_BattlemasterTraining
  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


There you have it. A single upgrade performing 2 totally different functions for 2 different factions. you can apply what i have shown above to your particular problem.
Hope this help anyone else. Ask if your confused.

Mike
Edited by Mbob61, 19 November 2009 - 20:17.
Quote

cccdfern's Photo cccdfern 19 Nov 2009

so for It to work The upgrade needs to be bought at a structure. And the modules would be the same for a weapons set, good.
And thank you for all of your work.

Nope doesn't want to work, keeps crashing, in any case, instead, could we make a new upgrade instead?
Edited by CCCD, 20 November 2009 - 12:55.
Quote