Lycan abs - Making enemies flee on sight
#1
I hope I posted this in the correct section.

I want to modify the cowardice setting in Lycan abs so that enemies with cowardice will flee upon detecting an enemy, rather than fleeing upon losing a member of their party.

Correct me if I'm wrong but I believe this is what I need to modify.

Code:
#--------------------------------------------------------------------------
 # * Frame Update ( for enemy - Checking Running Cowardly Enemies)
 #--------------------------------------------------------------------------
 def update_enemy_test_coward
   return if @enemies == {}
   return if @enemies_alive == {}
   return if @enemies.size == @enemies_alive.size
   # Set Dead Enemy ID
   dead_enemy = 0
   # Cycle through cloned Enemy range
   for enemy in @enemies_alive.values
     # Set dead enemy by ID unless the enemy is also in the active list
     dead_enemy = enemy.enemy_id unless @enemies.has_value?(enemy)
   end
   # Cycle through the enemies
   for enemy in @enemies.values
     # Set the coward timer for matching enemies
     update_enemy_test_coward_set(enemy, dead_enemy)
   end
 end  
 #--------------------------------------------------------------------------
 # * Frame Update ( for enemy - Setting Coward Timer for Enemies)
 #    enemy      : enemy object
 #    dead_enemy : comparison enemy object
 #--------------------------------------------------------------------------
 def update_enemy_test_coward_set(enemy, dead_enemy)
   # Exit unless the enemy has the coward flag
   return unless enemy.personality.include?(4)
   # Exit unless the enemy has a comrade recently slain
   return unless enemy.ally_group.include?(dead_enemy)
   # Activate his cowardice timer
   enemy.cowardice_timer = 40 * enemy.cowardice
 end

Although so far my attempts to modify it (e.g removing aspects that involve detecting if another is dead) haven't worked.
Reply }
#2
Thanks for the idea, and be sure the next upgrade for Lycan will have your username in it. Happy

If you just want the cowardice setting to make enemies just run from those in their hate group, paste this below the Lycan system and let the new code take over. BUT, this will later be put into action as some other behavior feature... a Phobia system.
Coward to Phobia Patch

Any other questions you have may end up in the Lycan help file too. Laughing
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   A Skill that throws enemies? Bennerdeben 10 927 10-08-2024, 05:12 PM
Last Post: Bennerdeben
   Actors & enemies without Morale Bennerdeben 4 2,206 07-15-2023, 06:21 PM
Last Post: Bennerdeben
Question  Lycan ABS - Weapon display Jetboy 4 7,180 07-14-2015, 06:02 AM
Last Post: DerVVulfman
   Jumping Enemies? Bounty Hunter Lani 2 5,263 01-17-2015, 06:58 AM
Last Post: Bounty Hunter Lani
   Ahzoh's Lycan ABS On/Off queries Ahzoh 9 13,357 12-22-2014, 04:10 AM
Last Post: DerVVulfman
   Lycan ABS + GPlats? swickster 5 9,540 09-16-2014, 04:44 AM
Last Post: DerVVulfman
   Making Forest Maps with the Random Map Generator ShadowIce 16 22,005 02-02-2014, 08:18 PM
Last Post: ShadowIce
   Need Help on Making Battle Status Window riou 4 10,894 03-22-2011, 06:04 AM
Last Post: Victor Sant
   2 or more drops from enemies -Luke- 12 14,141 03-12-2010, 02:57 AM
Last Post: fgsfds
   Help Making Random Maps ShadowIce 0 3,263 02-02-2010, 03:28 PM
Last Post: ShadowIce



Users browsing this thread: 1 Guest(s)