Jump to content


Photo

Editing How Units React ?

units react fear how

  • Please log in to reply
2 replies to this topic

#1 Rider of Rohan

Rider of Rohan

    The Lazy Modder

  • Division Leaders
  • 1,555 posts
  • Location:The Caribbean
  • Projects:Age of the Ring and the HD Editions
  •  Mathijs' Bug fix expert
  • Division:BFME
  • Job:T3A Leader

Posted 09 June 2012 - 11:35 PM

I am working on a BFME mod currently for 1 & 2 and was wondering how to edit how units react to mumakil and trolls because i would like to make units actually backup from their positions instead of staying in fear from trolls and mumakil if maybe more than than 2 of the monsters are present any help ??? Thanks in advance. :D

99dxc486ltde132zg.jpgh5je9noaofg3o26zg.jpg

No parent should have to bury their child - King Theoden


#2 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 10 June 2012 - 12:14 AM

That's controlled by their emotion states

AfraidOf					=	EMOTION_AFRAIDOF_OBJECTFILTER  ; mumakil and trolls in this filter
AlwaysAfraidOf				=	EMOTION_ALWAYS_AFRAIDOF_OBJECTFILTER

; ==============================================================================
; ==============================================================================
; FEAR

EmotionNugget FearIdle_Base
    Type                    =    FEAR
    IgnoreIfUnitBusy            =    Yes
    AIState                =    BACK_AWAY
    AILockDuration            =    4000
    ModelConditions            =    EMOTION_AFRAID
    InactiveDurationSameObject     =     10000
    StartFXList                =    FX_EmotionCower
    UpdateFXList            =    FX_EmotionCower
    EndFXList                =    FX_EmotionRegroup
End

EmotionNugget FearBusy_Base
    Type                    =    FEAR
    IgnoreIfUnitIdle            =    Yes
    AIState                =    AVOID_SCARER
    ModelConditions            =    EMOTION_AFRAID
    InactiveDurationSameObject    =    10000
    InactiveDurationSameType    =    5000
    ;StartFXList            =    FX_EmotionCowerBusy
    ;UpdateFXList            =    FX_EmotionCowerBusy
    ;EndFXList                =    FX_EmotionRegroup
End

; UNCONTROLLABLE_FEAR
EmotionNugget UncontrollableFear_Base
Type	 = UNCONTROLLABLE_FEAR
AIState	 = IDLE
ModelConditions	= EMOTION_AFRAID EMOTION_UNCONTROLLABLY_AFRAID
ModelConditionsClear = MOVING TURN_RIGHT TURN_LEFT TURN_RIGHT_HIGH_SPEED TURN_LEFT_HIGH_SPEED
Duration	= 15000 ;5000
StartFXList	= FX_EmotionCower
UpdateFXList	= FX_EmotionCower
EndFXList	= FX_EmotionRegroup
PreventPlayerCommands = Yes
End

EmotionNugget UncontrollableFear_Base_Evil
Type	 = UNCONTROLLABLE_FEAR
IgnoreIfUnitBusy   = No
AIState	 = BACK_AWAY
AILockDuration	= 15000 ;5000
ModelConditions	= EMOTION_AFRAID EMOTION_UNCONTROLLABLY_AFRAID
Duration	= 15000 ;5000
StartFXList	= FX_EmotionCower
UpdateFXList	= FX_EmotionCower
EndFXList	= FX_EmotionRegroup
PreventPlayerCommands = Yes
End

Some observations :
IgnoreIfUnitBusy = No
AIState = BACK_AWAY
ModelConditions = EMOTION_AFRAID EMOTION_UNCONTROLLABLY_AFRAID
ModelConditionsClear = MOVING TURN_RIGHT TURN_LEFT TURN_RIGHT_HIGH_SPEED TURN_LEFT_HIGH_SPEED

Perhaps its possible to have them backup instead of being set in spot
and even code in a weapon for the mumakil etc that gives enemies an emotion with a duration

Edited by JUS_SAURON, 10 June 2012 - 12:16 AM.


#3 Rider of Rohan

Rider of Rohan

    The Lazy Modder

  • Division Leaders
  • 1,555 posts
  • Location:The Caribbean
  • Projects:Age of the Ring and the HD Editions
  •  Mathijs' Bug fix expert
  • Division:BFME
  • Job:T3A Leader

Posted 10 June 2012 - 05:19 PM

Wow Thanks for pointing that out i got it working when two or more trolls arrive if they are out side the base they back up and won't move unless told to go to the base heres the how i changed the code

EmotionNugget FearIdle_Base
Type = FEAR
IgnoreIfUnitBusy = No ;Yes
AIState = BACK_AWAY
AILockDuration = 4000
ModelConditions = EMOTION_AFRAID
InactiveDurationSameObject = 10000
StartFXList = FX_EmotionCower
UpdateFXList = FX_EmotionCower
EndFXList = FX_EmotionRegroup
End

EmotionNugget FearBusy_Base
Type = FEAR
IgnoreIfUnitIdle = No ;Yes
AIState = BACK_AWAY ;AVOID_SCARER
ModelConditions = EMOTION_AFRAID
InactiveDurationSameObject = 10000
InactiveDurationSameType = 5000
End

EmotionNugget UncontrollableFear_Base
Type = UNCONTROLLABLE_FEAR
AIState = BACK_AWAY; IDLE
ModelConditions = EMOTION_AFRAID EMOTION_UNCONTROLLABLY_AFRAID
ModelConditionsClear = MOVING TURN_RIGHT TURN_LEFT TURN_RIGHT_HIGH_SPEED TURN_LEFT_HIGH_SPEED
Duration = 15000
StartFXList = FX_EmotionCower
UpdateFXList = FX_EmotionCower
EndFXList = FX_EmotionRegroup
End

EmotionNugget UncontrollableFear_Base_Evil
Type = UNCONTROLLABLE_FEAR
IgnoreIfUnitBusy = No
AIState = BACK_AWAY
AILockDuration = 15000
ModelConditions = EMOTION_AFRAID EMOTION_UNCONTROLLABLY_AFRAID
ModelConditionsClear = MOVING TURN_RIGHT TURN_LEFT TURN_RIGHT_HIGH_SPEED TURN_LEFT_HIGH_SPEED
Duration = 15000
StartFXList = FX_EmotionCower
UpdateFXList = FX_EmotionCower
EndFXList = FX_EmotionRegroup
End

EmotionNugget Terror_Base
Type = TERROR
AIState = RUN_AWAY_PANIC
ModelConditions = EMOTION_TERROR EMOTION_AFRAID
ModelConditionsClear = MOVING TURN_RIGHT TURN_LEFT TURN_RIGHT_HIGH_SPEED TURN_LEFT_HIGH_SPEED
AILockDuration = 15000
Duration = 10000
StartFXList = FX_EmotionTerror
UpdateFXList = FX_EmotionTerror
EndFXList = FX_EmotionRegroup
End

99dxc486ltde132zg.jpgh5je9noaofg3o26zg.jpg

No parent should have to bury their child - King Theoden





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users