Posted by: NOP - Sunday, July 24, 2011 3:28:54 AM
Hey all! Im trying to make a forcefield for the USA power plant... So far I can upgrade the powerplants to have blue semi-transparent spheres around them that look like shields... The shields are actually drones... It all looks pretty good, but the shields dont work right... I'm having 2 problems with them that I hope someone can help me with... 1: Units and missiles can pass right through them 2:They dont die when the powerplant dies, though I can kill them afterwards. Here are the codes: Added to the powerplant: [code] Behavior = ObjectCreationUpgrade ModuleTag_41 UpgradeObject = OCL_Shields TriggeredBy = Upgrade_Shields ; ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone End[/code] Here is the drone code: [code]Object TestBubble ; *** ART Parameters *** SelectPortrait = SAScout_L ButtonImage = SAScout UpgradeCameo1 = Upgrade_AmericaDroneArmor ;UpgradeCameo2 = NONE ;UpgradeCameo3 = NONE ;UpgradeCameo4 = NONE ;UpgradeCameo5 = NONE Draw = W3DModelDraw ModuleTag_01 OkToChangeModelColor = Yes ConditionState = NONE Model = TestBubble ; Animation = AVScoutDr.AVScoutDr ; AnimationMode = LOOP End ConditionState = REALLYDAMAGED Model = TestBubble ; Animation = AVScoutDr_d.AVScoutDr_d ; AnimationMode = LOOP End End ; ***DESIGN parameters *** DisplayName = OBJECT:ScoutDrone Side = America EditorSorting = VEHICLE TransportSlotCount = 0 ;how many "slots" we take in a transport (0 == not transportable) ArmorSet Conditions = None Armor = StructureArmor DamageFX = SmallTankDamageFX End BuildCost = 400 BuildTime = 10.0 ;in seconds VisionRange = 10000 ShroudClearingRange = 10000 IsTrainable = No ;Can gain experience ; *** AUDIO Parameters *** VoiceSelect = NoSound VoiceMove = NoSound VoiceAttack = NoSound SoundMoveStart = NoSound UnitSpecificSounds ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs TurretMoveStart = NoSound TurretMoveLoop = TurretMoveLoop End ; *** ENGINEERING Parameters *** RadarPriority = UNIT KindOf = PRELOAD STRUCTURE IMMOBILE CAN_CAST_REFLECTIONS DRONE NO_SELECT ;SELECTABLE Body = ActiveBody ModuleTag_02 MaxHealth = 1000.0 InitialHealth = 1000.0 End Behavior = AIUpdateInterface ModuleTag_03 Turret TurretTurnRate = 60 // turn rate, in degrees per sec ControlledWeaponSlots = PRIMARY End AutoAcquireEnemiesWhenIdle = Yes End Locomotor = SET_NORMAL DroneLocomotor Behavior = StealthDetectorUpdate ModuleTag_04 DetectionRate = 500 ; how often to rescan for stealthed things in my sight (msec) ;DetectionRange = ??? ;Dustin, enable this for independant balancing! CanDetectWhileGarrisoned = No ;Garrisoned means being in a structure that you units can shoot out of. CanDetectWhileContained = No ;Contained means being in a transport or tunnel network. End Behavior = PhysicsBehavior ModuleTag_05 Mass = 50.0 KillWhenRestingOnGround = yes ; No AllowBouncing = No End Behavior = SlavedUpdate ModuleTag_06 GuardMaxRange = 0 ;How far away from master I'm allowed when master is idle (doesn't wander) GuardWanderRange = 0 ;How far away I'm allowed to wander from master while guarding. AttackRange = 0 ;How far away from master I'm allowed when master is attacking a target. AttackWanderRange = 0 ;How far I'm allowed to wander from target. ScoutRange = 0 ;How far away from master I'm allowed when master is moving. ScoutWanderRange = 0 ;How far I'm allowed to wander from scout point. DistToTargetToGrantRangeBonus = 0 ;How close I have to be to the master's target in order to grant master a range bonus. StayOnSameLayerAsMaster = Yes End ; Behavior = MaxHealthUpgrade ModuleTag_07 ; TriggeredBy = Upgrade_AmericaDroneArmor ; AddMaxHealth = 50.0 ; ChangeType = ADD_CURRENT_HEALTH_TOO ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH ; End Behavior = DestroyDie ModuleTag_08 DeathTypes = ALL End Behavior = CreateObjectDie ModuleTag_09 DeathTypes = ALL CreationList = OCL_AmericaScoutDroneExplode End Behavior = FXListDie ModuleTag_10 DeathTypes = ALL DeathFX = FX_AmericaScoutDroneExplode End Behavior = TransitionDamageFX ModuleTag_11 ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01 ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleDroneDamageTransitionSmall End Behavior = UpgradeDie ModuleTag_12 ;This frees the object based upgrade for the producer object. DeathTypes = ALL UpgradeToRemove = Upgrade_Shields 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 = SPHERE GeometryMajorRadius = 100.0 GeometryIsSmall = No Shadow = SHADOW_VOLUME ShadowSizeX = 89 ; minimum elevation angle above horizon. Used to limit shadow length End[/code]

Posted by: NOP - Monday, July 25, 2011 6:18:54 AM
I've edited the code a lot but there are no changes in game... Same 2 problems as in first post... The new Forcefield code: [code]Object TestBubble ; *** ART Parameters *** SelectPortrait = SAScout_L ButtonImage = SAScout Draw = W3DModelDraw ModuleTag_01 OkToChangeModelColor = Yes ConditionState = NONE Model = TestBubble End ConditionState = REALLYDAMAGED Model = TestBubble End End ; ***DESIGN parameters *** DisplayName = OBJECT:ScoutDrone Side = America EditorSorting = STRUCTURE TransportSlotCount = 0 ;how many "slots" we take in a transport (0 == not transportable) ArmorSet Conditions = None Armor = StructureArmorTough DamageFX = SmallTankDamageFX End BuildCost = 400 BuildTime = 10.0 ;in seconds EnergyProduction = -1 VisionRange = 0 ShroudClearingRange = 0 IsTrainable = No ;Can gain experience ; *** AUDIO Parameters *** VoiceSelect = NoSound VoiceMove = NoSound VoiceAttack = NoSound SoundMoveStart = NoSound ; *** ENGINEERING Parameters *** RadarPriority = STRUCTURE KindOf = PRELOAD STRUCTURE IMMOBILE CAN_CAST_REFLECTIONS NO_SELECT DRONE;SELECTABLE Body = StructureBody ModuleTag_02 MaxHealth = 1000.0 InitialHealth = 1000.0 End Behavior = AIUpdateInterface ModuleTag_03 End Behavior = SlavedUpdate ModuleTag_06 GuardMaxRange = 0 ;How far away from master I'm allowed when master is idle (doesn't wander) GuardWanderRange = 0 ;How far away I'm allowed to wander from master while guarding. AttackRange = 0 ;How far away from master I'm allowed when master is attacking a target. AttackWanderRange = 0 ;How far I'm allowed to wander from target. ScoutRange = 0 ;How far away from master I'm allowed when master is moving. ScoutWanderRange = 0 ;How far I'm allowed to wander from scout point. DistToTargetToGrantRangeBonus = 0 ;How close I have to be to the master's target in order to grant master a range bonus. StayOnSameLayerAsMaster = Yes End Behavior = DestroyDie ModuleTag_08 DeathTypes = ALL End Behavior = UpgradeDie ModuleTag_12 ;This frees the object based upgrade for the producer object. DeathTypes = ALL UpgradeToRemove = Upgrade_Shields End Geometry = SPHERE GeometryMajorRadius = 100.0 GeometryIsSmall = No Shadow = SHADOW_VOLUME End[/code]

Posted by: Annihilationzh - Monday, July 25, 2011 7:09:50 AM
Depends on how you want to do it. I can't remember how to do it the normal way. Personally, I'd give it a super fast invisible point-defence laser that uses the death type detonated so that missiles will explode on contact. As for the units passing through, you could make units fly backwards from the forcefield by using a shock wave in a fireweaponupdate with the same radius as the forcefield.

Posted by: NOP - Tuesday, July 26, 2011 1:34:56 PM
Where might I clone a shock wave from?

Posted by: Annihilationzh - Tuesday, July 26, 2011 11:23:47 PM
MOAB, nuke mig, etc.

Posted by: NOP - Wednesday, July 27, 2011 2:57:07 AM
ok.... How do I make the drone die when the powerplant dies? Do I attach it to the model itself and just hide it until an upgrade has been purchased?

Posted by: Annihilationzh - Wednesday, July 27, 2011 5:08:02 AM
Use a power plant death weapon. Or just restore the usual drone death method.

Posted by: NOP - Wednesday, July 27, 2011 2:54:34 PM
Got it working now... I modified all the different renders of the power-plant to have the shield, then added a hide object line, then an upgrade to upgrade the armor of the building and show the shield, so now it works in all the different states... DONE!!!