Dagesh
  • Dagesh
  • 54.5% (Neutral)
  • Private Topic Starter
14 years ago
Hi all,
New to modding for Generals and I have been messing around with stuff here and there.

I am trying to get a plane to pick up ground units (fly down, land, pick up units, take off with units inside). I have the airfield and the plane being created at the airfield. The plane will take off and will only fly around in circles (Locomotion or whatever it's called). I can't get it to land back at the airfield or to pick up units on the ground. Any help is appreciated. Thanks!

Plane Object Code

Object Slth_AircraftCessna

  ; *** ART Parameters ***
  SelectPortrait         = SAAurora_L
  ButtonImage            = SAAurora

  UpgradeCameo1 = Upgrade_GLAJunkRepair
  ;UpgradeCameo2 = Upgrade_GLAJunkRepair
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
 

  Draw                   = W3DModelDraw ModuleTag_01
 
    OkToChangeModelColor = Yes

 
   ConditionState = NONE
      Model = CVCESSNA
    End
    
    ConditionState = REALLYDAMAGED
      Model = CVCESSNA_D
    End
    
    ConditionState = RUBBLE
      Model = CVCESSNA_D
    End

  End

  ; ***DESIGN parameters ***
  DisplayName             = OBJECT:GLAPlane
  EditorSorting           = VEHICLE
  Side                    = GLAStealthGeneral
  TransportSlotCount      = 0 ;how many "slots" we take in a transport (0 == not transportable)

  VisionRange             = 200.0 
  ShroudClearingRange     = 200

  Prerequisites
    Object                = Slth_Hangar
  End

   WeaponSet 
    Conditions        = None 
    Weapon            = PRIMARY     NONE
  End

  WeaponSet
    Conditions = CARBOMB
    Weapon = PRIMARY  SuicideCarBomb
  End

  ArmorSet
    Conditions      = None
    Armor           = AirplaneArmor
    DamageFX        = None
  End

  BuildCost               = 0 ;500
  BuildTime               = 0; 10
  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrusherLevel            = 1
  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CrushableLevel          = 2

  CommandSet              = Slth_GLAVehicleCessnaCommandset

  ; *** AUDIO Parameters ***
 
  SoundAmbient = CivPropPlaneAmbientLoop
  
  UnitSpecificSounds
    StartDive  = A10ThunderboltDive
  End

  ; *** ENGINEERING Parameters ***

  RadarPriority          = UNIT
  KindOf                 = PRELOAD CAN_CAST_REFLECTIONS CAN_ATTACK SELECTABLE VEHICLE SCORE AIRCRAFT TRANSPORT
  
  Body                   = ActiveBody ModuleTag_02
    MaxHealth            = 100.0
    InitialHealth        = 100.0
  End

  Behavior                          = JetSlowDeathBehavior ModuleTag_03
    FXOnGroundDeath                 = FX_JetOnGroundDeath
    OCLOnGroundDeath                = OCL_RaptorDeathFinalBlowUp
    DestructionDelay                = 99999999; destruction will happen when we
    RollRate                        = 0.2
    RollRateDelta                   = 100% ;each frame, rollrate = rollrate * rollrateDelta
    PitchRate                       = 0.0
    FallHowFast                     = 110.0%    ;Bigger is faster (can be over 100%,it's a fraction of gravity)
    FXInitialDeath                  = FX_JetDeathInitial
    OCLInitialDeath                 = None
    DelaySecondaryFromInitialDeath  = 500       ; in milliseconds
    FXSecondary                     = FX_JetDeathSecondary
    ;OCLSecondary                    = OCL_ToxinPlaneDeath
    FXHitGround                     = FX_JetDeathHitGround
    DelayFinalBlowUpFromHitGround   = 200       ; in milliseconds
    FXFinalBlowUp                   = FX_JetDeathFinalBlowUp
  End
  
  Behavior               = PhysicsBehavior ModuleTag_04
    Mass                 = 500.0
  End

  Behavior                 = TransitionDamageFX ModuleTag_05
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes Psys:SmokeSmallContinuous01
    ReallyDamagedFXList1         = Loc: X:0 Y:0 Z:0 FXList:FX_MIGDamageTransition
  End

  Behavior = JetAIUpdate ModuleTag_06
    OutOfAmmoDamagePerSecond  = 0% 
; amount of damage to take per SEC (not per frame) when out of ammo
; note that it's expressed as a percent of max health, not an absolute
    TakeoffDistForMaxLift     = 100%   
; smaller numbers give more lift sooner when taking off
    TakeoffPause              = 100
    MinHeight                 = 1
    ParkingOffset             = 3
; scooch it a little forward so the tail doesn't hit the doors
    ;ReturnToBaseIdleTime      = 10000         
; if idle for this long, return to base, even if not out of ammo
  End


  Locomotor = SET_NORMAL TerrorPlaneLocomotor
  Locomotor = SET_TAXIING BasicJetTaxiLocomotor


  Behavior = WeaponSetUpgrade ModuleTag_07
    ; the Toxin Tractor gets this upgrade if we either buy the upgrade,
    ; or if it gets HEROIC status
    TriggeredBy   = Upgrade_GLAAnthraxBeta Upgrade_Veterancy_HEROIC
  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

  Behavior = AutoHealBehavior ModuleTag_08
    HealingAmount = 2
    HealingDelay = 500 ; msec
    TriggeredBy = Upgrade_GLAJunkRepair
  End

  Behavior = TransportContain  ModuleTag_09
    PassengersAllowedToFire = Yes
    Slots             = 4
    DamagePercentToUnits = 100%
    AllowInsideKindOf  = INFANTRY
    ExitDelay = 250
    NumberOfExitPaths = 0 ; 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
    WeaponBonusPassedToPassengers = Yes
    DelayExitInAir = Yes
    ArmedRidersUpgradeMyWeaponSet = Yes
  End

  Geometry = Cylinder
  GeometryIsSmall          = Yes
  GeometryMajorRadius      = 10.0
  GeometryMinorRadius      = 10.0
  GeometryHeight           = 10.0
  Shadow                   = SHADOW_VOLUME
  ShadowSizeX = 89  ; minimum elevation angle above horizon. Used to limit shadow length.

End


Airfield Object Code


;------------------------------------------------------------------------------
Object Slth_Hangar

  ; *** ART Parameters ***
  Draw = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes
  
    ExtraPublicBone = Runway1Parking1 
    ExtraPublicBone = Runway1Parking2 
    ExtraPublicBone = Runway2Parking1 
    ExtraPublicBone = Runway2Parking2 
    ExtraPublicBone = Runway1Park1Han
    ExtraPublicBone = Runway1Park2Han
    ExtraPublicBone = Runway2Park1Han
    ExtraPublicBone = Runway2Park2Han 
    ExtraPublicBone = Runway1Prep1 
    ExtraPublicBone = Runway1Prep2 
    ExtraPublicBone = Runway2Prep1 
    ExtraPublicBone = Runway2Prep2 
    ExtraPublicBone = RunwayStart1 
    ExtraPublicBone = RunwayStart2 
    ExtraPublicBone = RunwayEnd1 
    ExtraPublicBone = RunwayEnd2

------- snipped model info for faster scrolling -----------

  PlacementViewAngle = 225
  
    ; *** AUDIO Parameters ***
  SoundOnDamaged        = BuildingDamagedStateLight
  SoundOnReallyDamaged  = BuildingDestroy

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:NONE
  Side             = GLAStealthGeneral
  EditorSorting    = STRUCTURE

  BuildCost           = 500
  BuildTime           = 1 ;12.0           ; in seconds
  EnergyProduction    = 0

  CommandSet       = Slth_GLAHangarCommandSet

  VisionRange         = 200.0           ; Shroud clearing distance
  ShroudClearingRange = 200

  ArmorSet
    Conditions        = None
    Armor             = StructureArmor
    DamageFX          = StructureDamageFXNoShake
  End

  ExperienceValue     = 150 150 150 150  ; Experience point value at each level

  ; *** ENGINEERING Parameters ***  

  RadarPriority       = STRUCTURE
  KindOf              = PRELOAD STRUCTURE SELECTABLE REBUILD_HOLE IMMOBILE  GARRISONABLE_UNTIL_DESTROYED SCORE CAPTURABLE FS_FACTORY MP_COUNT_FOR_VICTORY AUTO_RALLYPOINT
  Body                = HiveStructureBody ModuleTag_04
    MaxHealth         = 800.0
    InitialHealth     = 800.0
  End
  
  Behavior = ParkingPlaceBehavior ModuleTag_05
    HealAmountPerSecond   = 10
    NumRows               = 1
    NumCols               = 1
    HasRunways            = Yes
    ApproachHeight        = 30
  End

  Behavior = ProductionUpdate ModuleTag_06
    NumDoorAnimations            = 1
    DoorOpeningTime              = 2000  ;in mSeconds
    DoorWaitOpenTime             = 3000  ;in mSeconds
    DoorCloseTime                = 2000  ;in mSeconds
    ConstructionCompleteDuration = 1000  ;in mSeconds
  End

  Behavior        = RebuildHoleExposeDie ModuleTag_07
    HoleName      = GLAHoleStingerSite
    HoleMaxHealth = 500.0
  End

  Behavior = BaseRegenerateUpdate ModuleTag_08
    ;No data
  End 

  Behavior = GarrisonContain ModuleTag_09
    ContainMax                    = 1
    EnterSound                    = GarrisonEnter
    ExitSound                     = GarrisonExit 
    ImmuneToClearBuildingAttacks  = Yes   
  End

  Behavior = DestroyDie ModuleTag_10
    ;nothing
  End


  Behavior        = FXListDie ModuleTag_12
    DeathFX       = FX_StructureMediumDeath
  End

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

  Behavior = TransitionDamageFX ModuleTag_14
    ;-------------DESIGNED FOR MEDIUM SIZED FACTION BUILDING TRANSITIONS-------------------
    DamagedParticleSystem1       = Bone:None RandomBone:No PSys:StructureTransitionMediumSmoke
    ;---------------------------------------------------------------------------------------
    ReallyDamagedParticleSystem1 = Bone:None RandomBone:No PSys:StructureTransitionMediumSmoke
    ReallyDamagedParticleSystem2 = Bone:None RandomBone:No PSys:StructureTransitionMediumExplosion
    ReallyDamagedParticleSystem3 = Bone:None RandomBone:No PSys:StructureTransitionMediumShockwave
  End

  Geometry            = BOX
  Scale = 1.0                            ;Scaling
  GeometryMajorRadius = 32.0
  GeometryMinorRadius = 32.0
  GeometryHeight      = 10.0
  GeometryIsSmall     = No
  FactoryExitWidth    = 40
  Shadow          = SHADOW_VOLUME
  BuildCompletion = PLACED_BY_PLAYER

End

edit: Cut out some of the modeling code to shrink down the code a bit.
Sponsor
NewNightmare
14 years ago
your idea is hmm.. unclear to me, how do you want to make the transport? enter when the plane is on the airfield, and then exit when it's still in the same placE? planes are assigned to specific slots on specific airfields, so I don't think it's possible to make a plane as a transport that just drops off the units on the floor, or nearest airfield, or, if it is, it's gonna be a hell of a challange.
The only way I see it, is to give that plane production ability, and allow him to build upgrades, that would insert some units inside it, and then make a weird OCL that would allow you to make these units drop off with a parachute and re-place the plane 'like-existing' so it can be reused (since upgrades can't be purchased multiple times), or use a special power instead of and OCL.
Not sure if I'll be able to come up with the code.
precision_bomber
14 years ago
Getting Units in the Cessna is I think easy enough. Since you have to make it a Transport.

KindOf = TRANSPORT

You can I think extract the code as well from the Chinook.

Then, of course you want to drop units.

How do you want it? Via Parachute, or the plane lands and gets off like a plane?

If Via Parachute...
Then I probably can't help you there... Try referring to I think, the Contra Mod.

If other thing with the landing...
I think you can set a Locomotor that makes it act like a Chinook. While at mid-flight you can make it land while it waits for the units to come in.

Other ways, I can't think of some other things.
Death Label:
Reduced back to 3 main factions(and a couple of extras).
Each faction can choose a(or all of them) tech-tree via General's Powers.
Angel Wings: Jets and Anti-Air, Helicopters and Missiles, Hovercraft and Lasers
Red Skulls: Armor Division, Mecha Armada, Drone Swarm
Earth's Saviors: Air Raid, Homeworld Security, Stealth
Dagesh
  • Dagesh
  • 54.5% (Neutral)
  • Private Topic Starter
14 years ago

your idea is hmm.. unclear to me, how do you want to make the transport? enter when the plane is on the airfield, and then exit when it's still in the same placE? planes are assigned to specific slots on specific airfields, so I don't think it's possible to make a plane as a transport that just drops off the units on the floor, or nearest airfield, or, if it is, it's gonna be a hell of a challange.
The only way I see it, is to give that plane production ability, and allow him to build upgrades, that would insert some units inside it, and then make a weird OCL that would allow you to make these units drop off with a parachute and re-place the plane 'like-existing' so it can be reused (since upgrades can't be purchased multiple times), or use a special power instead of and OCL.
Not sure if I'll be able to come up with the code.

newnightmare wrote:




This option is fine by me.

-Pick up at airfield A and, if possible, drop off at airfield A.

The trouble I am running into at this point specifically is that infantry will not enter the plane while it is in the hangar. I get the three vertical green arrows for entry and when I send a unit to enter the vehicle they run to the hangar and sit outside of it. If I could get that done I think I would be content. Thanks for your quick responses and your help!
NewNightmare
14 years ago
Try editing the TransportContain module, disabling some of the lines.
  Behavior = TransportContain  ModuleTag_09
    PassengersAllowedToFire = Yes
    Slots             = 4
    DamagePercentToUnits = 100%
    AllowInsideKindOf  = INFANTRY
    ExitDelay = 250
    NumberOfExitPaths = 0 ; 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
    WeaponBonusPassedToPassengers = Yes
    DelayExitInAir = Yes
    ArmedRidersUpgradeMyWeaponSet = Yes
  End[/code]Should they be able to fire from the plane? like battlechinook? or just transport like the standard one? copy it's code.
these 3 seem pointless for transport only unit:
[code]PassengersAllowedToFire = Yes
WeaponBonusPassedToPassengers = Yes
ArmedRidersUpgradeMyWeaponSet = Yes
1st - do you have fireport bones?
2nd - not needed if they are not meant to fire in first place...
3rd - do you have upgradable weaponset? do you have a weaponset at all?
   WeaponSet 
    Conditions        = None 
    Weapon            = PRIMARY     NONE
  End
Nope
I would also remove the CARBOMB weaponset, why is it even there? Why is there a weaponsetupgrade module when there's no Conditions = Player_upgrade weaponset?
besides, the airfield object has a stinger site GLAhole, make a hole for Airfield (I understand it's a temporary solution atm). The code looks to me like a bunch of modules from different units glued together. The best thing to do is copy the code from an already exisiting unit, closest to yours by design, and then add a module or 2 from different ones.
Dagesh
  • Dagesh
  • 54.5% (Neutral)
  • Private Topic Starter
14 years ago

Try editing the TransportContain module, disabling some of the lines.

  Behavior = TransportContain  ModuleTag_09
    PassengersAllowedToFire = Yes
    Slots             = 4
    DamagePercentToUnits = 100%
    AllowInsideKindOf  = INFANTRY
    ExitDelay = 250
    NumberOfExitPaths = 0 ; 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
    WeaponBonusPassedToPassengers = Yes
    DelayExitInAir = Yes
    ArmedRidersUpgradeMyWeaponSet = Yes
  End[/code]Should they be able to fire from the plane? like battlechinook? or just transport like the standard one? copy it's code.
these 3 seem pointless for transport only unit:
[code]PassengersAllowedToFire = Yes
WeaponBonusPassedToPassengers = Yes
ArmedRidersUpgradeMyWeaponSet = Yes
1st - do you have fireport bones?
2nd - not needed if they are not meant to fire in first place...
3rd - do you have upgradable weaponset? do you have a weaponset at all?
   WeaponSet 
    Conditions        = None 
    Weapon            = PRIMARY     NONE
  End
Nope
I would also remove the CARBOMB weaponset, why is it even there? Why is there a weaponsetupgrade module when there's no Conditions = Player_upgrade weaponset?
besides, the airfield object has a stinger site GLAhole, make a hole for Airfield (I understand it's a temporary solution atm). The code looks to me like a bunch of modules from different units glued together. The best thing to do is copy the code from an already exisiting unit, closest to yours by design, and then add a module or 2 from different ones.

newnightmare wrote:



The problem I am seeking help with is getting infantry into the plane itself. I am toying with the option to fire from inside the plane. The weapon upgrade needs to be deleted. The carbomb option is there in case a terrorist climbs inside the plane. The original cessna is a civilian vehicle that drove along the ground (car locomotor). I appreciate help with the other issues but they are not relevant to my main question.

How do I get the infantry to enter the plane? The hangar can garrison as well. Is that the problem (I can't test that problem at this time)? As said above, they plane does give the option and the buttons are all set however, when the infantry person goes to enter the plane while it is in the hangar, they do not enter the plane. They simply stop moving and stand outside the hangar. Thank you again for your patience and help.
Dagesh
  • Dagesh
  • 54.5% (Neutral)
  • Private Topic Starter
14 years ago
Okay, I think I found the issue.

I did not set the hangar as FS_AIRFIELD in KindOf: For some reason it made the hangar impassable for infantry units. It also allows the plane to land at the hangar once again. Not sure how I missed it before but it was a good learning point.


Thanks for the help!
NewNightmare
14 years ago
FS_AIRFIELD
It originally allows pilots to pass through, so yeah, it was required, never looked at hangar code though
Dagesh
  • Dagesh
  • 54.5% (Neutral)
  • Private Topic Starter
14 years ago
Is there a wiki to find what the different parts of code mean, for example that the "Kind of"s are and what they do? I know it mostly comes down to reading code for what works and processing from there but a wiki that sorts out the behaviors, Kind of, Condition States, and all of that stuff would make coding a whole lot simpler.
NewNightmare
14 years ago
doubt that, Generals wasn't a 'Mega anticipated product of the next 30 decades!' kind of game, unlike Generals 2 will probably be.
Gen/ZH is 7+ years old with not many places where ppl talk about it left. In fact, I think this forum is much more alive than the official forum on www.commandandconquer.com 🙂
Dagesh
  • Dagesh
  • 54.5% (Neutral)
  • Private Topic Starter
14 years ago
Thanks nightmare!