Help - Search - Members - Calendar
Full Version: Forcibly Evacuating
SWR Productions Forum > Game Modding and Development > Generals/Zerohour Modding
GearsGoAwryMan
Hello again. I've been tinkering with a way to bring units from a garrison-able station to anywhere on the map using a plane. I made this work by having the plane drop a bomb/projectile which leaves a object which also acts like a tunnel network.

Now obviously, the weakness of this system is that you have to manually evacuate your units from the network.

Is it, however, possible to forcibly evacuate the units automatically? I've tried using the Troopcrawler weapon and variations thereupon, but that weapon only seems to degarrison the crawler when attacking an object, and does not accept ground-attack commands.
(USA)Bruce
Thats some wacky mechanic you got there buddy, your bombs spawns...Tunnels...

Well Im not actually great in the code but why not try the bunkerbuster code from zh? If you can get it to work on yourself the units inside would be force ejected out.
Shiro
Yeah, try the Bunker Buster logic by applying a weapon that uses its effect but otherwise deals no damage. In fact, there's a mod that uses this trick for its Chronosphere.
GearsGoAwryMan
Hm. The bunker buster weapons don't seem to be working either. I'll package the code soonish, but i suspect bunker busters don't work on tunnel networks at all.
GearsGoAwryMan
Right, bunker buster bombs should work, but it doesn't seem to.



This here below is the "tunnel" i'm using. It's created at the end of a planedrop and is supposed to ensure the units get on location.

CODE

;------------------------------------------------------------------------------
Object GoDeliverunitsBomb

; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
OkToChangeModelColor = Yes
DefaultConditionState
Model = EXAMine_A
ParticleSysBone = None InfernoTrail
End
End

; ***DESIGN parameters ***
DisplayName = OBJECT:ClusterMinesBomb
Side = GoChina
EditorSorting = SYSTEM
TransportSlotCount = 1 ;how many "slots" we take in a transport (0 == not transportable)
VisionRange = 0
ArmorSet
Conditions = None
Armor = InvulnerableAllArmor
DamageFX = None
End

; *** AUDIO Parameters ***

; *** ENGINEERING Parameters ***
KindOf = PROJECTILE SELECTABLE CAN_ATTACK STRUCTURE TRANSPORT FS_BASE_DEFENSE
Body = StructureBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0
End

; alas, this DOES need ai...
Behavior = AIUpdateInterface ModuleTag_03
End

Locomotor = SET_NORMAL None

Behavior = PhysicsBehavior ModuleTag_04
Mass = 75.0
AerodynamicFriction = 1 ; this is now friction-per-sec
ForwardFriction = 33 ; this is now friction-per-sec
CenterOfMassOffset = 2 ; Default of 0 means nothing tips as it falls. Positive tips forward, negative tips back
End
CommandSet = ChinaTroopCrawlerCommandSet

; Behavior = CaveContain ModuleTag_corndog

; CaveIndex = 1


; ; ; AllowInsideKindOf = [KindOfs]
; ; ; ForbidInsideKindOf = [KindOfs]
; End
Behavior = TunnelContain ModuleTag_28
TimeForFullHeal = 5000 ;(in milliseconds)
AllowAlliesInside = Yes
End

Behavior = FireWeaponUpdate ModuleTag_22
Weapon = GoEvacuatetunnelOCLWeapon ;GoButcheredCrawlerAssaultforparadropstuffsort
ExclusiveWeaponDelay = 0 ; If we fire a real weapon, we turn this module off for this long
End



Behavior = LifetimeUpdate ModuleTag_08
MinLifetime = 10000 ; min lifetime in msec
MaxLifetime = 10000 ; max lifetime in msec
End

Behavior = DestroyDie ModuleTag_07
;nothing
End

Geometry = SPHERE ;Collision geometry
GeometryMajorRadius = 1.0 ;Collision major radius
GeometryMinorRadius = 1.0 ;Collision minor radius
GeometryHeight = 1.0 ;Height for geometry
GeometryIsSmall = Yes ;Is small geometry

End



As you can see, it fires a weapon constantly. This weapon creates the bunker buster i tried using to evacuate the units.

CODE
Weapon GoEvacuatetunnelOCLWeapon

FireOCL = OCL_Gofakebunkerbuster

End



CODE

ObjectCreationList OCL_Gofakebunkerbuster
CreateObject
ObjectNames = Gofakebunkerbuster
Disposition = LIKE_EXISTING
End
End


And then this is the thing that is supposed to launch the bunker buster:

CODE

Object Gofakebunkerbuster

DisplayName = OBJECT:Missile
EditorSorting = SYSTEM
VisionRange = 0.0

ArmorSet
Conditions = None
Armor = ProjectileArmor
DamageFX = None
End

; *** ENGINEERING Parameters ***
KindOf = PRELOAD CAN_CAST_REFLECTIONS PROJECTILE
Body = ActiveBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.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.
; A projectile is not disabled, but instead loses target and scatters
SubdualDamageCap = 200
SubdualDamageHealRate = 100000
SubdualDamageHealAmount = 50
End

; Behavior = WeaponBonusUpgrade ModuleTag_99
; TriggeredBy = Upgrade_AmericaLaserMissiles
; End

; ; ---- begin Projectile death behaviors
; Behavior = InstantDeathBehavior DeathModuleTag_01
; DeathTypes = NONE +DETONATED
; ; we detonated normally.
; ; no FX, just quiet destroy ourselves
; End
; Behavior = InstantDeathBehavior DeathModuleTag_02
; DeathTypes = NONE +LASERED
; ; shot down by laser.
; FX = FX_GenericMissileDisintegrate
; OCL = OCL_GenericMissileDisintegrate
; End
; Behavior = InstantDeathBehavior DeathModuleTag_03
; DeathTypes = ALL -LASERED -DETONATED
; ; shot down by nonlaser.
; FX = FX_GenericMissileDeath
; End
; ---- end Projectile death behaviors

Behavior = BunkerBusterBehavior ModuleTag_04
; UpgradeRequired = Upgrade_AmericaBunkerBusters
DetonationFX = FX_BunkerBusterExplosion ; the big detonation kaboom at the bottom
CrashThroughBunkerFX = WeaponFX_BunkerBusterIntialImpact ; the crash bang crunch FX on the way through the bunker ceiling
CrashThroughBunkerFXFrequency = 0 ; msec... how often to play the crash bang crunch FX on the way through the bunker ceiling

SeismicEffectRadius = 200
SeismicEffectMagnitude = 5

ShockwaveWeaponTemplate = BunkerBusterShockwaveWeaponSmall
OccupantDamageWeaponTemplate = BunkerBusterAntiTunnelGarrisonWeaponWithABigName

End

Behavior = LifetimeUpdate ModuleTag_04
MinLifetime = 10 ; min lifetime in msec
MaxLifetime = 10 ; max lifetime in msec
End

Behavior = PhysicsBehavior ModuleTag_07
Mass = 1
End
; Behavior = MissileAIUpdate ModuleTag_08
; TryToFollowTarget = Yes
; FuelLifetime = 10000
; InitialVelocity = 75 ; in dist/sec
; IgnitionDelay = 30
; IgnitionFX = FX_JetMissileIgnition
; DetonateCallsKill = Yes
; KillSelfDelay = 2000 ;two seconds of crash bang crunch before we actually detonate
; End
; Locomotor = SET_NORMAL StealthJetMissileLocomotor


; Behavior = HeightDieUpdate ModuleTag_09
; TargetHeight = -20.0
; TargetHeightIncludesStructures = Yes
; End


Geometry = Sphere
GeometryIsSmall = Yes
GeometryMajorRadius = 1.0

End


It seems to work, since i'm getting the particles all over my screen (literally to lag-inducing proportions since i'm spawning one every so so milliseconds, but i digress. )

But of course, nothing is getting out of the "tunnel network".

Here's the code for the existing bunker buster weapons as they are used originally (and therefore too in my test-version).

CODE
;------------------------------------------------------------------------------
Weapon BunkerBusterAntiTunnelGarrisonWeaponWithABigName
PrimaryDamage = 400.0
PrimaryDamageRadius = 10.0
ScatterRadiusVsInfantry = 0.0 ;When this weapon is used against infantry, it can randomly miss by as much as this distance.
DamageType = PARTICLE_BEAM
DeathType = EXPLODED
WeaponSpeed = 99999.0
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
End

;------------------------------------------------------------------------------
Weapon BunkerBusterShockwaveWeaponSmall
PrimaryDamage = 10
PrimaryDamageRadius = 50.0
AttackRange = 30.0

ShockWaveAmount = 50 ; represents the shockwave amount. The larger the amount, the greater and more dramatic the shockwave effect
ShockWaveRadius = 50 ; should be no more than the primary/secondary damage radius, whichever is larger.
ShockWaveTaperOff = 0.3 ; 0.3 means at the shockwave edge, the shockwave amount is 30%.


DamageType = MELEE
DeathType = NORMAL
WeaponSpeed = 99999.0
ProjectileObject = NONE
RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
DelayBetweenShots = 99999 ; time between shots, msec
ClipSize = 1 ; how many shots in a Clip (0 == infinite)
ClipReloadTime = 2500 ; how long to reload a Clip, msec
AutoReloadsClip = No
End




Anyone spot any mistakes?


Stalker
There is an old trick to get units to auto-evacuate from a tunnel network.

It's used for the Chronosphere in Operation Firestorm or the Wormhole in Remix.

IIRC you have to put the TunnelContain behaviour in a Portable structure and put that portable structure into an OverlordContain module in the actual object.

It will evacuate when the object dies
Shiro
That's a glitch though and not recommended to use in most cases.
Stalker
It works 100% of times, so I don't see why it shouldn't be used.
GearsGoAwryMan
I'm abusing the game more with my infinite particle FX's then this kind of behaviour. it's worth a shot.
GearsGoAwryMan
Hm. the proposed interaction doesn't seem to be working. Here's the code i'm using:

CODE
;------------------------------------------------------------------------------
Object GoDeliverunitsBomb

; *** ART Parameters ***
Draw = W3DModelDraw ModuleTag_01
OkToChangeModelColor = Yes
DefaultConditionState
Model = EXAMine_A
ParticleSysBone = None InfernoTrail
End
End

; ***DESIGN parameters ***
DisplayName = OBJECT:SentryDrone
Side = GoChina
EditorSorting = SYSTEM
TransportSlotCount = 1 ;how many "slots" we take in a transport (0 == not transportable)
VisionRange = 0
ArmorSet
Conditions = None
Armor = InvulnerableAllArmor
DamageFX = None
End

; *** AUDIO Parameters ***

; *** ENGINEERING Parameters ***
KindOf = PROJECTILE SELECTABLE CAN_ATTACK STRUCTURE TRANSPORT FS_BASE_DEFENSE
Body = StructureBody ModuleTag_02
MaxHealth = 100.0
InitialHealth = 100.0
End

; alas, this DOES need ai...
Behavior = AIUpdateInterface ModuleTag_03
End

Locomotor = SET_NORMAL None

Behavior = PhysicsBehavior ModuleTag_04
Mass = 75.0
AerodynamicFriction = 1 ; this is now friction-per-sec
ForwardFriction = 33 ; this is now friction-per-sec
CenterOfMassOffset = 2 ; Default of 0 means nothing tips as it falls. Positive tips forward, negative tips back
End
CommandSet = ChinaTroopCrawlerCommandSet

; Behavior = CaveContain ModuleTag_corndog

; CaveIndex = 1


; ; ; AllowInsideKindOf = [KindOfs]
; ; ; ForbidInsideKindOf = [KindOfs]
; End


; Behavior = FireWeaponUpdate ModuleTag_22
; Weapon = GoEvacuatetunnelOCLWeapon ;GoButcheredCrawlerAssaultforparadropstuffsort
; ExclusiveWeaponDelay = 0 ; If we fire a real weapon, we turn this module off for this long
; End


Behavior = OverlordContain ModuleTag_OverlordContain
Slots = 1
DamagePercentToUnits = 100%
AllowInsideKindOf = PORTABLE_STRUCTURE
PassengersAllowedToFire = Yes
PayloadTemplateName = GoDeliverunitsBombEvacuationstructure
ExperienceSinkForRider = Yes ; I get the Exp for things my turret friend kills
End

Behavior = LifetimeUpdate ModuleTag_08
MinLifetime = 10000 ; min lifetime in msec
MaxLifetime = 10000 ; max lifetime in msec
End

Behavior = DestroyDie ModuleTag_07
;nothing
End

Geometry = SPHERE ;Collision geometry
GeometryMajorRadius = 1.0 ;Collision major radius
GeometryMinorRadius = 1.0 ;Collision minor radius
GeometryHeight = 1.0 ;Height for geometry
GeometryIsSmall = Yes ;Is small geometry

End



Object GoDeliverunitsBombEvacuationstructure


Draw = W3DDependencyModelDraw ModuleTag_01
DefaultConditionState
Model = None
; ParticleSysBone = None InfernoTrail
End
End


Side = GoChina
EditorSorting = SYSTEM
TransportSlotCount = 1

ArmorSet
Conditions = None
Armor = InvulnerableAllArmor ; We can't be hurt on the field. We share damage from the Avenger with his damage module
End

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 = TunnelContain ModuleTag_28
TimeForFullHeal = 5000 ;(in milliseconds)
AllowAlliesInside = Yes
End
Behavior = DestroyDie ModuleTag_05
;<No Data>
End

End
Stalker
I can't really see what's wrong.

Here's my code:

CODE
Object ChronoSphereExitObject
  KindOf = UNATTACKABLE NO_COLLIDE
  Behavior = OverlordContain Contain
    Slots                = 1
    AllowInsideKindOf    = PORTABLE_STRUCTURE
    PayloadTemplateName  = ChronoSphereEffects
  End
  
  Behavior = DeletionUpdate Deletion
    MinLifetime          = 2000
    MaxLifetime          = 2000
  End

End

Object ChronoSphereEffects
  KindOf                 = PORTABLE_STRUCTURE
  TransportSlotCount     = 1
  Scale                  = 2

  Behavior = TunnelContain Contain
  End

  Behavior = FXListDie EMPEffect
    DeathFX              = FX_ChronoSphere;FX_EMPPulseImpact
  End

  Behavior = LifetimeUpdate Lifetime
    MinLifetime          = 1500
    MaxLifetime          = 1500
  End

  Behavior = DestroyDie Destroy
  End
  Geometry               = SPHERE
  GeometryMajorRadius    = 50
  GeometryIsSmall        = No

End


I hope this helps
GearsGoAwryMan
Your code works flawlessly.

I think one of the kindof's i used completely botchered the glitch.

Regardless, this means i can now drop a big crate of units! (assuming i can somehow make it impossible to garrison the pad after the superpower starts. Would making it unselectable work for that?)
GDIZOCOM
For human players yes, they wouldn't be able to garrison it, but the AI still can (if you make them to)
GearsGoAwryMan
Considering how the AI stashes tunnel networks in advance usually that won't be much of a problem.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.