06-06-2016, 09:55 PM
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.
Although so far my attempts to modify it (e.g removing aspects that involve detecting if another is dead) haven't worked.
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
endAlthough so far my attempts to modify it (e.g removing aspects that involve detecting if another is dead) haven't worked.



![[Image: QrnbKlx.jpg]](https://i.imgur.com/QrnbKlx.jpg)
![[Image: sGz1ErF.png]](https://i.imgur.com/sGz1ErF.png)
![[Image: liM4ikn.png]](https://i.imgur.com/liM4ikn.png)
![[Image: fdzKgZA.png]](https://i.imgur.com/fdzKgZA.png)
![[Image: sj0H81z.png]](https://i.imgur.com/sj0H81z.png)
![[Image: QL7oRau.png]](https://i.imgur.com/QL7oRau.png)
![[Image: uSqjY09.png]](https://i.imgur.com/uSqjY09.png)
![[Image: GAA3qE9.png]](https://i.imgur.com/GAA3qE9.png)
![[Image: 2Hmnx1G.png]](https://i.imgur.com/2Hmnx1G.png)
![[Image: BwtNdKw.png%5B]](https://i.imgur.com/BwtNdKw.png%5B)