Jump to content


Photo

Ai opens castel gates

bfme2 rotwk casteal gate ai open close

  • Please log in to reply
4 replies to this topic

#1 grunshac

grunshac
  • Members
  • 149 posts

Posted 04 January 2016 - 11:22 AM

I'm tring to make the Ai on castel maps to close the castel gate when im approaching. I managed to do this by scripting the map but the AI tries to attack me and the gate is opening and closing constantly. I dont know how to make him guarding the gate instead of attacking. I tried every relevant script but same result.

 

 

PLS HELP !!!!!!!!!!!!!!!



#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,837 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 04 January 2016 - 11:13 PM

Well I'm not entirely sure how you expect us to help, this is more or less a moment when you should try to do several scripts, although I think the hard coded AI will keep conflicting with the gate.

Maybe it's possible to remove the part from the ini of the gate that makes him automatically open it?

What does the ini of the gate look like?


Ridder Geel

#3 grunshac

grunshac
  • Members
  • 149 posts

Posted 05 January 2016 - 11:07 AM

Object MinisGateDoor

SelectPortrait = BPCMinasTirithGate

  ; *** ART Parameters ***
    Draw = W3DScriptedModelDraw ModuleTag_Draw
    OkToChangeModelColor  = Yes
    UseStandardModelNames = Yes

    DefaultModelConditionState  
      Model = GBCASTGATE
    End


    ModelConditionState   = ACTIVELY_BEING_CONSTRUCTED
        Model             = GBCASTGATE_A
        ParticleSysBone   = DUSTBONE BuildingContructDust
    End;
    AnimationState        = ACTIVELY_BEING_CONSTRUCTED
        StateName                = BeingConstructed
            Animation           = GBCASTGATE_A
                AnimationName   = GBCASTGATE_A.GBCASTGATE_A
                AnimationMode   = MANUAL
            End
        Flags                    = START_FRAME_FIRST
    End



    ModelConditionState  = RUBBLE DOOR_1_OPENING USER_1
      Model         = GBCASTGATE_UD4  
    End
    AnimationState = RUBBLE DOOR_1_OPENING USER_1
        Animation = Open
            AnimationName    =    GBCASTGATE_UD4.GBCASTGATE_UD4
            AnimationMode    =    ONCE
        End
    End

    ModelConditionState  = RUBBLE DOOR_1_OPENING
      Model         = GBCASTGATE_D4  
    End
    AnimationState = RUBBLE DOOR_1_OPENING
        Animation = Open
            AnimationName    =    GBCASTGATE_D4.GBCASTGATE_D4
            AnimationMode    =    ONCE
        End
    End
       
    ModelConditionState  = RUBBLE USER_1
      Model         = GBCASTGATE_UD3
      ParticleSysBone NONE CatapultDestroyDebris
      ParticleSysBone NONE PCTMediumDust
    End
     AnimationState = RUBBLE USER_1
        Animation = Open
            AnimationName    =    GBCASTGATE_UD3.GBCASTGATE_UD3
            AnimationMode    =    ONCE
        End
    End
       
    ModelConditionState  = RUBBLE
      Model         = GBCASTGATE_D3
      ParticleSysBone NONE CatapultDestroyDebris
      ParticleSysBone NONE PCTMediumDust
    End
     AnimationState = RUBBLE
        Animation = Open
            AnimationName    =    GBCASTGATE_D3.GBCASTGATE_D3
            AnimationMode    =    ONCE
        End
    End
    
    AnimationState = DOOR_1_OPENING
        StateName = STATE_Open   
        Animation = Open
            AnimationName    =    GBCASTGATE.GBCASTGATE
            AnimationMode    =    ONCE
            AnimationBlendTime = 0
        End
        Flags = START_FRAME_LAST
        BeginScript
            Prev = CurDrawablePrevAnimationState()
            if Prev == "STATE_Closed" then CurDrawableSetTransitionAnimState("TRANS_Closed_To_Open") end
        EndScript
    End
    TransitionState = TRANS_Closed_To_Open
        Animation = Open
            AnimationName    =    GBCASTGATE.GBCASTGATE
            AnimationMode    =    ONCE
        End
    End
        
    AnimationState = DOOR_1_CLOSING
        StateName = STATE_Closed
        Animation = Close
            AnimationName    =    GBCASTGATE.GBCASTGATE
            AnimationMode    =    ONCE_BACKWARDS
            AnimationBlendTime = 0
        End
        Flags = START_FRAME_FIRST
        BeginScript
            
            Prev = CurDrawablePrevAnimationState()
            if Prev == "STATE_Open" then CurDrawableSetTransitionAnimState("TRANS_Open_To_Closed") end
        EndScript
    End
    TransitionState = TRANS_Open_To_Closed
        Animation = Open
            AnimationName    =    GBCASTGATE.GBCASTGATE
            AnimationMode    =    ONCE_BACKWARDS
        End
        Flags = START_FRAME_LAST
    End
    
    ModelConditionState = USER_1
        Model = GBCastGate_U
    End

  End

    
  ; *** AUDIO Parameters ***

    VoiceSelect        = GateSelect

    SoundOnDamaged        = BuildingLightDamageStone
    SoundOnReallyDamaged    = BuildingHeavyDamageStone


  ; ***DESIGN parameters ***

  DisplayName        = OBJECT:MTDoor
  EditorSorting        = STRUCTURE
  BuildCost            = M_MONUMENT_FORTRESS_GATE_BUILDCOST

  ArmorSet
    Conditions        = None
    Armor             = DefaultWallArmor
    DamageFX          = None
  End
    CommandSet = CastleGateCommandSet_NoSell

  ; *** ENGINEERING Parameters ***  
  KindOf                = STRUCTURE SELECTABLE IMMOBILE BLOCKING_GATE IGNORE_FOR_VICTORY WALL_GATE  
  RadarPriority            = STRUCTURE
  KeepSelectableWhenDead = Yes

  Body                  = ActiveBody ModuleTag_02
    MaxHealth            = 50000.0
    MaxHealthDamaged        = 25000.0
    MaxHealthReallyDamaged    = 10000.0
    
  End

  Behavior            = GettingBuiltBehavior GetBuiltBehaviorTag
        SelfBuildingLoop            = BuildingConstructionLoop        ; Only played if we DON'T spawn a worker
        SelfRepairFromDamageLoop    = NoSound                        ; This doesn't cause an animation, so don't bother playing a sound
        SelfRepairFromRubbleLoop    = BuildingConstructionLoop
        SpawnTimer                    = -1.0                            ; Negative means no 'autoheal'
        RebuildTimeSeconds            = 40
    End

  Behavior = AIUpdateInterface ModuleTag_AI
    AILuaEventsList    =    MinisTirithGateFunctions
  End

    ClientBehavior = AnimationSoundClientBehavior ModuleTag_AnimAudioBehavior
        MaxUpdateRangeCap = 800
        AnimationSound = Sound: MinisTirithGateDie Animation:GBMgatedoorSKL.GBMgatedoorA3 Frames: 1
    End



    Behavior = TransitionDamageFX ModleTag_hideBustedDoors
        PristineShowSubObject        RBCASTDRR RBCASTDRL
        PristineHideSubObject        RBCASTDRR_D1 RBCASTDRR_D2 RBCASTDRL_D1 RBCASTDRL_D2
        DamagedShowSubObject        RBCASTDRR_D1 RBCASTDRL_D1
        DamagedHideSubObject        RBCASTDRR_D2 RBCASTDRL_D2 RBCASTDRR RBCASTDRL
        ReallyDamagedShowSubObject    RBCASTDRR_D2 RBCASTDRL_D2
        ReallyDamagedHideSubObject  RBCASTDRR_D1  RBCASTDRL_D1 RBCASTDRR RBCASTDRL
        DamagedFXList1 = Loc: X:0 Y:0 Z:0            FXList:FX_BasicSevereScreenShake
         ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0        FXList:FX_BasicSevereScreenShake
         RubbleFXList1 = Loc: X:0 Y:0 Z:0            FXList:FX_HelmsDeepGateRubble
    End

  ; Note that structures with "RUBBLE" states should not use DestroyDie; such buildings are
  ; never truly destroyed, even when reduced to zero health. Also note that garrisonable
  ; buildings automatically stick around because GarrisonContain has it's own DieModule
  Behavior = KeepObjectDie ModuleTag_IWantRubble
  End

  ; Death weapon when door blows open
  Behavior = FireWeaponWhenDeadBehavior FireWeaponWhenDeadBehaviorModuleTag_01
    StartsActive = Yes
    DelayTime = 0
    DeathWeapon = MinisGateDoorExplosion
    WeaponOffset = X:-40 Y:0 Z:0
  End

    Behavior = GateOpenAndCloseBehavior ModuleTag_GATE
        ResetTimeInMilliseconds = 10500;must be longer than animation to avoid ->pop<-
        OpenByDefault = Yes
        PercentOpenForPathing = 50
        SoundOpeningGateLoop = GateOpenStart
        SoundClosingGateLoop = GateCloseStart
        SoundFinishedOpeningGate = GateOpenEnd
        SoundFinishedClosingGate = GateCloseEnd
        TimeBeforePlayingOpenSound = 9500
        TimeBeforePlayingClosedSound = 9500
    End

   Behavior = CastleMemberBehavior ModuleTag_CMB
        CountsForEvaCastleBreached = Yes
   End

    ;MinasGateDoor
    ;Geometry              = BOX
    ;GeometryMajorRadius   = 6.0
    ;GeometryMinorRadius   = 50.0
    ;GeometryHeight        = 56.0
    ;GeometryRotationAnchorOffset = X:987.2 Y:0.0
    ;GeometryName          = Closed
    ;GeometryIsSmall       = No
    
    Geometry              = BOX
    GeometryMajorRadius   = 7.2
    GeometryMinorRadius   = 58.4
    GeometryHeight        = 61.0
    GeometryIsSmall       = No
    GeometryRotationAnchorOffset = X:987.2 Y:0.0
    GeometryName          = Closed

    AdditionalGeometry    = BOX
    GeometryMajorRadius   = 25.0
    GeometryMinorRadius   = 3.0
    GeometryHeight        = 61.0    
    GeometryOffset          = X:12 Y:56 Z:0
    GeometryName          = OpenLeft
    
    AdditionalGeometry    = BOX
    GeometryMajorRadius   = 25.0
    GeometryMinorRadius   = 3.0
    GeometryHeight        = 61.0    
    GeometryOffset          = X:12 Y:-56 Z:0
    GeometryName          = OpenRight
    
    GeometryContactPoint = X:27 Y:-56 Z:0 Ram
    GeometryContactPoint = X:14 Y:-56 Z:60
    GeometryContactPoint = X:0  Y:-56 Z:0
    GeometryContactPoint = X:0  Y:-25 Z:60
    GeometryContactPoint = X:3  Y:  0 Z:1 Ram
    GeometryContactPoint = X:0  Y: 25 Z:60
    GeometryContactPoint = X:0  Y: 56 Z:0
    GeometryContactPoint = X:14 Y: 56 Z:60
    GeometryContactPoint = X:27 Y: 56 Z:0 Ram   

  Shadow                = SHADOW_VOLUME
End
 



#4 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,837 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 12 January 2016 - 06:24 PM

Hm... well the GateOpenAndCloseBehavior is obviously the one conflicting with whatever you scripted. So I don't really think there is a way to fix this...

The AI in BFME 2, unlike in BFME 1, is much less scripted and more hardcoded, so the door opening and closing would most likely be something that you can not 'teach' the AI to do correctly without having to completely script the AI somehow and turning off any automated movement (which i'm not even sure is possible at all...)


Ridder Geel

#5 grunshac

grunshac
  • Members
  • 149 posts

Posted 14 January 2016 - 01:52 PM

ok thx for the time :)







Also tagged with one or more of these keywords: bfme2 rotwk, casteal, gate, ai, open, close

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users