logo   login
right
Home Forums Downloads Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Forum Info
Forum Members: 18,679
Total Threads: 8,804
Posts: 95,885

Administrators:
DeeZire, Redemption

There are currently 16 users online.
Partner Links

Free Credit Repair

Learn the Ticket Broker Secrets
Advertisements


Generals & Zero Hour Editing Discuss any modding related issues to do with Generals and Zero Hour here.

Reply
 
LinkBack Thread Tools
Old 11-24-2005, 03:38 PM   #1 (permalink)
Senior Member
 
Join Date: Jul 2004
Location: London, UK
Posts: 376
Send a message via MSN to AntiSocialKindaGuy
Default AI Garrison Logic

For some reason, enemy AI is refusing to garrison the building with code below. They are happy to garrison the other civ buildings such as farm houses, but refusing to play ball with my trenches.

The AI script is pretty simple; below is the subroutine:

If True {
Team <This Team> will move towards the nearest CivTrenchBlock07 within area [Skirmish]MyOuterPerimeter.
Team <This Team> garrison a nearby building.
}

The actual trench code is found below:

Code:
  ; ***DESIGN parameters ***
  DisplayName       = OBJECT:Trench
  Side              = TGTWCivilian
  EditorSorting     = STRUCTURE
  BuildCost        = 1000
  BuildTime        = 1.0           ; in seconds
  EnergyProduction = 0
  WeaponSet
    Conditions          = None 
    Weapon              = PRIMARY     None
  End
  VisionRange    = 360.0           ; Shroud clearing distance AND targeting range
  ShroudClearingRange = 360
  ArmorSet
    Conditions      = None
    Armor           = TrenchArmour
    DamageFX        = StructureDamageFXNoShake
  End
  CommandSet        = CivTrenchLargeCommandSet
  ExperienceValue     = 200 200 200 200  ; Experience point value at each level

  ; *** AUDIO Parameters ***
  VoiceSelect = FireBaseSelect
  SoundOnDamaged        = BuildingDamagedStateLight
  SoundOnReallyDamaged  = BuildingDestroy

  UnitSpecificSounds
    UnderConstruction     = UnderConstructionLoop
  End

  UnitSpecificSounds
  ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    TurretMoveStart = NoSound
    TurretMoveLoop = NoSound ;These aren't playing properly, will revisit (mp) TurretMoveLoopLoud
  End

  ; *** ENGINEERING Parameters ***
  IsBridge            = Yes
  RadarPriority       = STRUCTURE
  KindOf              = PRELOAD LANDMARK_BRIDGE STRUCTURE SELECTABLE IMMOBILE SPAWNS_ARE_THE_WEAPONS SCORE IMMUNE_TO_CAPTURE 

GARRISONABLE_UNTIL_DESTROYED 
  Body                = HiveStructureBody ModuleTag_BodyOverride
    MaxHealth       = 2000.0
    InitialHealth   = 2000.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 = 1200
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 100
    ;**Careful with these damage types -- because area damage types will already
    ;**damage slaves.
    PropagateDamageTypesToSlavesWhenExisting = NONE +SNIPER ;+SMALL_ARMS +POISON +RADIATION +SURRENDER
    ;SwallowDamageTypesIfSlavesNotExisting = NONE +SNIPER +POISON +SURRENDER; Take no damage if no one to pass this to
  End

 
  Behavior = BaseRegenerateUpdate ModuleTag_05
    ;No data
  End 
  Behavior = AIUpdateInterface ModuleTag_06
    AutoAcquireEnemiesWhenIdle = Yes ;ATTACK_BUILDINGS; defensive weapon
    MoodAttackCheckRate        = 250
  End

  Behavior = GarrisonContain ModuleTag_07
    ContainMax                    = 8
    EnterSound                    = GarrisonEnter
    ExitSound                     = GarrisonExit
    ImmuneToClearBuildingAttacks  = Yes
    DamagePercentToUnits          = 5%
    IsEnclosingContainer          = No

  End

  Behavior = DestroyDie ModuleTag_08
    ;nothing
  End

  Behavior             = FXListDie ModuleTag_10
    DeathFX       = FX_StructureMediumDeath
  End

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

  Behavior                  = CreateObjectDie ModuleTag_13
    CreationList       = OCL_LargeStructureDebris
  End

  Behavior = TransitionDamageFX ModuleTag_14
    ;-------------DESIGNED FOR TINY SIZED FACTION BUILDING TRANSITIONS-------------------
    DamagedParticleSystem1       = Bone:None RandomBone:No PSys:StructureTransitionTinySmoke
    ;---------------------------------------------------------------------------------------
    ReallyDamagedParticleSystem1 = Bone:None RandomBone:No PSys:StructureTransitionTinySmoke
    ReallyDamagedParticleSystem2 = Bone:None RandomBone:No PSys:StructureTransitionTinyExplosion
    ReallyDamagedParticleSystem3 = Bone:None RandomBone:No PSys:StructureTransitionTinyShockwave
  End


  Behavior                = BridgeBehavior ModuleTag_br
    LateralScaffoldSpeed  = 100.0
    VerticalScaffoldSpeed = 70.0
  End

  Geometry            = BOX
  GeometryMajorRadius = 110.0
  GeometryMinorRadius = 70.0
  GeometryHeight      = 20.0
  GeometryIsSmall     = No

End
Am I missing something fundamental that dictates what can and cannot be garrisoned by AI?
AntiSocialKindaGuy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-25-2005, 01:56 AM   #2 (permalink)
Senior Member
 
Join Date: Dec 2003
Posts: 217
Default

Are you definate that the script is being called from another script sequentially?
sc4freak is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-25-2005, 08:59 AM   #3 (permalink)
Senior Member
 
Join Date: Jul 2004
Location: London, UK
Posts: 376
Send a message via MSN to AntiSocialKindaGuy
Default

Ah - so perhaps I should set a flag on that script that upon completion, which activates a second script with the garrison. I assumed that if the scripts were in that order they WOULD be done sequentially.

I'll give it a shot.
AntiSocialKindaGuy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-25-2005, 07:55 PM   #4 (permalink)
Senior Member
 
Join Date: Dec 2003
Posts: 217
Default

No, you need to specifically set it to run another script sequentially. Normally, a script activates all of its commands at once in the same frame. A sequential script waits before the previous action is completed before starting the next.
sc4freak is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 11-26-2005, 08:50 AM   #5 (permalink)
Senior Member
 
Join Date: Jul 2004
Location: London, UK
Posts: 376
Send a message via MSN to AntiSocialKindaGuy
Default

Aye, this I noticed after posting ( through looking at the Attack Centre Sequentially script ). And it works. So cheers. ^_^
AntiSocialKindaGuy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I garrison Tank bunkers in FA2 1.02 Editor? spud81277 Red Alert 2 & Yuri's Revenge Editing 43 10-20-2005 10:17 AM
Garrison abilities for other buildings goblinsleez Generals & Zero Hour Editing 4 02-28-2005 06:51 PM
Veterancy and garrison bonuses schtoogie Generals & Zero Hour Editing 3 12-22-2004 06:11 PM
Garrison Building Upgraades. Waspo Generals & Zero Hour Editing 7 11-08-2003 03:13 PM
Garrison Questions? Oldfaq Generals & Zero Hour Editing 14 10-29-2003 03:44 AM


All times are GMT -4. The time now is 02:57 AM.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.