View Single Post
Old 09-17-2006, 05:22 PM   #1 (permalink)
Matt23
Junior Member
 
Join Date: Apr 2006
Posts: 8
Default Problems with upgrade

I want to make my humvee start out as like a transport jeep and then have it to be able to upgrade to a 50 caliber or a tow launcher.
Although it doesn't work
Heres my code

AmericaVehicleINI
Code:
;------------------------------------------------------------------------------
Object AmericaVehicleHumvee

  ; *** ART Parameters ***
  SelectPortrait         = Humvee50cal_l
  ButtonImage            = Humvee50cal_S
  
  ;UpgradeCameo1 = Upgrade_AmericaBattleDrone
  ;UpgradeCameo2 = Upgrade_AmericaScoutDrone
  ;UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  UpgradeCameo3 = Upgrade_50Cal
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_TOWMissile
  
  Draw = W3DTruckDraw ModuleTag_01
    OkToChangeModelColor = Yes

    ConditionState = NONE
      Model = HUMVEE50
      HideSubObject = Turret02 Turret01 MAN
    End

    ConditionState = REALLYDAMAGED
      Model = HUMVEE50
      HideSubObject = Turret01 Turret02 MAN
    End

    TrackMarks = EXTireTrack.tga

    Dust = RocketBuggyDust
    DirtSpray = RocketBuggyDirtSpray
    PowerslideSpray = RocketBuggyDirtPowerSlide

    ; These parameters are only used if the model has a separate suspension, 
    ; and the locomotor has HasSuspension = Yes.
    LeftFrontTireBone = Tire01
    RightFrontTireBone = Tire02
    LeftRearTireBone = Tire03
    RightRearTireBone = Tire04
    TireRotationMultiplier = 0.2   ; this * speed = rotation.
    PowerslideRotationAddition = 1.25   ; This speed is added to the rotation speed when powersliding.

  End

  ; ***DESIGN parameters ***
  DisplayName           = OBJECT:Humvee
  Side                  = America
  EditorSorting         = VEHICLE
  TransportSlotCount    = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  ArmorSet
    Conditions      = None
    Armor           = HumveeArmor
    DamageFX        = TruckDamageFX
  End
  BuildCost       = 700
  BuildTime       = 1.0          ;in seconds    
  VisionRange     = 150
  ShroudClearingRange = 320
  Prerequisites
    Object = AmericaWarFactory
  End
  ExperienceValue = 50 50 100 150   ;Experience point value at each level
  ExperienceRequired = 0 100 150 300  ;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      = AmericaVehicleHumveeCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect = HumveeVoiceSelect
  VoiceMove = HumveeVoiceMove
  VoiceGuard = HumveeVoiceMove
  VoiceAttack = HumveeVoiceAttack
  VoiceAttackAir = HumveeVoiceAttackTOW
  SoundMoveStart = HumveeMoveStart
  SoundMoveStartDamaged = HumveeMoveStart
  SoundEnter = HumveeEnter
  SoundExit = HumveeExit

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    ;TurretMoveStart    = NoSound
    VoiceCreate         = HumveeVoiceCreate
    TurretMoveLoop      = TurretMoveLoop
    SoundEject          = PilotSoundEject
    VoiceEject          = PilotVoiceEject
    VoiceCrush          = HumveeVoiceCrush
  ; Required for the W3DTruckDraw module
    TruckLandingSound = RocketBuggyLand
    TruckPowerslideSound = RocketBuggyPowerslide
    VoiceUnload = HumveeVoiceUnload
    VoiceEnter = HumveeVoiceMove
  End


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

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 240.0
    InitialHealth   = 240.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 = 480
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End
  Behavior = TransportAIUpdate ModuleTag_03
    Turret
      TurretTurnRate = 180
      RecenterTime = 5000   ; how long to wait during idle before recentering
      ControlledWeaponSlots = PRIMARY SECONDARY TERTIARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
    MoodAttackCheckRate        = 250
  End
  Locomotor = SET_NORMAL HumveeLocomotor

  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End

  Behavior = TransportContain  ModuleTag_05
    PassengersAllowedToFire = No
    Slots             = 6
;    EnterSound          = GarrisonEnter
;    ExitSound           = GarrisonExit
    DamagePercentToUnits = 100% ;10%
    AllowInsideKindOf  = INFANTRY
    ExitDelay = 250
    NumberOfExitPaths = 3 ; Defaults to 1.  Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
    GoAggressiveOnExit = Yes ; AI Will tell people to set their mood to Aggressive on exiting
  End

  Behavior = ObjectCreationUpgrade ModuleTag_07
    UpgradeObject = OCL_TOWMissile
    TriggeredBy   = Upgrade_TOWMissile
    ConflictsWith = Upgrade_50Cal
  End

  Behavior = WeaponSetUpgrade ModuleTag_WeaponSetUpgrade01
    TriggeredBy = Upgrade_TOWMissile
    ConflictsWith = Upgrade_50Cal
  End

  Behavior = ObjectCreationUpgrade ModuleTag_08
    UpgradeObject = OCL_50Cal
    TriggeredBy   = Upgrade_50Cal
    ConflictsWith = Upgrade_TOWMissile
  End

  Behavior = WeaponSetUpgrade ModuleTag_WeaponSetUpgrade09
    TriggeredBy = Upgrade_50Cal
    ConflictsWith = Upgrade_TOWMissile
  End

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

  Behavior = SlowDeathBehavior ModuleTag_11
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 25
    DestructionDelay = 1
    OCL = INITIAL  OCL_InitialHumveeDebris
    FX  = FINAL    FX_BattleMasterExplosionOneFinal
    OCL = FINAL    OCL_FinalHumveeDebris
  End

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

  Behavior = FXListDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CommandSetUpgrade ModuleTag_14
    CommandSet = AmericaVehicleHumveeTOWCommandSet
    TriggeredBy   = Upgrade_TOWMissile
    ConflictsWith = Upgrade_50Cal
  End

  Behavior = CommandSetUpgrade ModuleTag_15
    CommandSet = AmericaVehicleHumvee50CalCommandSet
    TriggeredBy   = Upgrade_50Cal
    ConflictsWith = Upgrade_TOWMissile
  End

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

; This is commented out per hotlist request 10/9 ML
;  Behavior = CreateObjectDie ModuleTag_15
;    DeathTypes = ALL -CRUSHED -SPLATTED
;    CreationList = OCL_AmericanRangerDebris01
;    ExemptStatus = HIJACKED
;  End

  Behavior = EjectPilotDie ModuleTag_16
    DeathTypes = ALL -CRUSHED -SPLATTED
    ExemptStatus = HIJACKED
    ; The following added out per hotlist request 10/9 as above ML
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
  End

  Behavior = TransitionDamageFX ModuleTag_17
    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 = 14.0
  GeometryMinorRadius = 7.0
  GeometryHeight = 11.5     
  GeometryIsSmall = Yes 
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End


;------------------------------------------------------------------------------
Object HumveeTOWMissile

  ; *** ART Parameters ***
  SelectPortrait         = TOW_l
  ButtonImage            = TOW_S
  
  ;UpgradeCameo1 = Upgrade_AmericaBattleDrone
  ;UpgradeCameo2 = Upgrade_AmericaScoutDrone
  ;UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  ;UpgradeCameo3 = Upgrade_50Cal
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_TOWMissile
  
  Draw = W3DTruckDraw ModuleTag_01
    OkToChangeModelColor = Yes

    ConditionState = NONE
      Model = HUMVEE50
      Turret = Turret02
      HideSubObject = Turret01
      WeaponFireFXBone = PRIMARY TOW01
      WeaponMuzzleFlash = PRIMARY TOW01
    End


    ConditionState = REALLYDAMAGED
      Model = HUMVEE50
      Turret = Turret02
      HideSubObject = Turret01
      WeaponFireFXBone = PRIMARY TOW01
      WeaponMuzzleFlash = PRIMARY TOW01
    End


  ; ***DESIGN parameters ***
  Side                  = America
  EditorSorting         = SYSTEM
  TransportSlotCount    = 1                ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions          = None 
    Weapon              = PRIMARY   HumveeMissileWeapon
  End
  ArmorSet
    Conditions      = None
    Armor           = HumveeArmor
    DamageFX        = TruckDamageFX
  End

  VisionRange      = 300
End

  ; *** 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 
      TurretTurnRate      = 60   // turn rate, in degrees per sec
      TurretPitchRate     = 60
      AllowsPitch         = Yes
    End
    AutoAcquireEnemiesWhenIdle = Yes 
  End

  Behavior             = DestroyDie ModuleTag_04
    ;nothing
  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

;------------------------------------------------------------------------------
Object Humvee50Cal

  ; *** ART Parameters ***
  SelectPortrait         = 50Cal_l
  ButtonImage            = 50Cal_S
  
  ;UpgradeCameo1 = Upgrade_AmericaBattleDrone
  ;UpgradeCameo2 = Upgrade_AmericaScoutDrone
  ;UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  UpgradeCameo3 = Upgrade_50Cal
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  ;UpgradeCameo5 = Upgrade_TOWMissile
  
  Draw = W3DTruckDraw ModuleTag_01
    OkToChangeModelColor = Yes

    ConditionState = NONE
      Model = HUMVEE50
      Turret = Turret01
      HideSubObject = Turret02
      WeaponFireFXBone = PRIMARY MUZZLE01
      WeaponMuzzleFlash = PRIMARY MUZZLE01
    End


    ConditionState = REALLYDAMAGED
      Model = HUMVEE50
      Turret = Turret01
      HideSubObject = Turret02
      WeaponFireFXBone = PRIMARY MUZZLE01
      WeaponMuzzleFlash = PRIMARY MUZZLE01
    End

  ; ***DESIGN parameters ***
  Side                  = America
  EditorSorting         = SYSTEM
  TransportSlotCount    = 1               ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions          = None 
    Weapon              = PRIMARY   HumveeGun
  End
  ArmorSet
    Conditions      = None
    Armor           = HumveeArmor
    DamageFX        = TruckDamageFX
  End
  VisionRange      = 250


  ; *** 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 
      TurretTurnRate      = 60   // turn rate, in degrees per sec
      TurretPitchRate     = 60
      AllowsPitch         = Yes
    End
    AutoAcquireEnemiesWhenIdle = Yes 
  End

  Behavior             = DestroyDie ModuleTag_04
    ;nothing
  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
UpgradeINI
Code:
;-----------------------------
;Humvee Upgrades
;-----------------------------

Upgrade Upgrade_50Cal 
  DisplayName        = UPGRADE:50CAL
  Type               = OBJECT
  BuildTime          = 1.0
  BuildCost          = 400  ; 1200
  ButtonImage        = 50Cal_S
End

Upgrade Upgrade_TOWMissile 
  DisplayName        = UPGRADE:TOWMissile
  Type               = OBJECT
  BuildTime          = 1.0
  BuildCost          = 800  ; 1200
  ButtonImage        = TOW_S
  ResearchSound      = HumveeVoiceUpgradeTowMissiles
End
ObjectCreationListINI
Code:
; ------------------------------------------------
ObjectCreationList OCL_TOWMissile
  CreateObject
    ObjectNames       = HumveeTOWMissile
    Count             = 1
    ContainInsideSourceObject = Yes
  End
End

; ------------------------------------------------
ObjectCreationList OCL_50Cal
  CreateObject
    ObjectNames       = Humvee50Cal
    Count             = 1
    ContainInsideSourceObject = Yes
  End
End
CommandButtonINI
Code:
CommandButton Command_UpgradeTOWMissile
  Command       = OBJECT_UPGRADE
  Upgrade       = Upgrade_TOWMissile
  Options       = OK_FOR_MULTI_SELECT NOT_QUEUEABLE
  TextLabel     = CONTROLBAR:UpgradeAmericaTOWMissile
  ButtonImage   = TOW_S
  ButtonBorderType        = UPGRADE ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:TooltipUSAUpgradeTOW
End

CommandButton Command_Upgrade50Cal
  Command       = OBJECT_UPGRADE
  Upgrade       = Upgrade_50Cal
  Options       = OK_FOR_MULTI_SELECT NOT_QUEUEABLE
  TextLabel     = CONTROLBAR:UpgradeAmericaTOWMissile
  ButtonImage   = 50Cal_S
  ButtonBorderType        = UPGRADE ; Identifier for the User as to what kind of button this is
  DescriptLabel           = CONTROLBAR:TooltipUSAUpgradeTOW
End
CommandSetINI
Code:
CommandSet AmericaVehicleHumveeCommandSet
  1 = Command_UpgradeTOWMissile
  2 = Command_Upgrade50Cal
  3 = Command_TransportExit
  4 = Command_TransportExit
  5 = Command_TransportExit
  6 = Command_TransportExit
  7 = Command_TransportExit
  8 = Command_TransportExit
  9 = Command_Evacuate 
  14 = Command_Stop
End

CommandSet AmericaVehicleHumveeTOWCommandSet
  1 = Command_TransportExit
  2 = Command_TransportExit
  3 = Command_TransportExit
  4 = Command_TransportExit
  9 = Command_Evacuate
  11 = Command_AttackMove
  13 = Command_Guard 
  14 = Command_Stop
End

CommandSet AmericaVehicleHumvee50CalCommandSet
  1 = Command_TransportExit
  2 = Command_TransportExit
  3 = Command_TransportExit
  4 = Command_TransportExit
  9 = Command_Evacuate
  11 = Command_AttackMove
  13 = Command_Guard 
  14 = Command_Stop
End


If anyone has any solutions please reply or pm
Thanks
Matt23 is offline   Reply With Quote