Target rate modification

Hi, I'd like to make a « Provoke » skill, but it doesn't work well.

I made a Provoke state setting Target rate (tgr) to 1000%, but ennemies keep attacking others party members.

I'd like to make ennemies always attack the character which has the bigger tgr score.

Here are the lines (Game_Unit line 59) :

def tgr_sum
alive_members.inject(0) {|r, member| r + member.tgr }
end

I don't know if this is the correct part of the script, tell me if I'm wrong.
Increasing the target rate should do what you want if you do it correctly.

Four party members, one with tgr 1000% and three with 100% should result in the one actor getting targeted 10/13 times and the other three getting targeted once in thirteen attacks.

If that doesn't happens, you did something wrong with the provoke skill.
If that happens but you want different probabilities, you need to change the values.
Increasing the target rate should do what you want if you do it correctly.

Four party members, one with tgr 1000% and three with 100% should result in the one actor getting targeted 10/13 times and the other three getting targeted once in thirteen attacks.

If that doesn't happens, you did something wrong with the provoke skill.
If that happens but you want different probabilities, you need to change the values.

Thanks for your answer.

By the way, I don't want to simply increase the chance of being targeted, but always be targeted.

Is there a way to rewrite the tgr script to make ennemies always target the character which has the bigger tgr score and ignore others ?
Hi,

Since you asked for a script rewrite a possible solution might be something like this:
Code:
class Game_Unit
 
  #--------------------------------------------------------------------------
  # Game_Unit#random_target (redefined)
  #   Only select targets with the highest TGR in their party.
  #--------------------------------------------------------------------------
  def random_target
    return alive_members.shuffle.max_by { |member| member.tgr }
  end
end

However, this would also affect random target attacks (since they use the same target selection strategy by default). I don't know if that would be an issue in your case.
Hi,

Since you asked for a script rewrite a possible solution might be something like this:
Code:
class Game_Unit
 
  #--------------------------------------------------------------------------
  # Game_Unit#random_target (redefined)
  #   Only select targets with the highest TGR in their party.
  #--------------------------------------------------------------------------
  def random_target
    return alive_members.shuffle.max_by { |member| member.tgr }
  end
end

However, this would also affect random target attacks (since they use the same target selection strategy by default). I don't know if that would be an issue in your case.

It works pretty well with some adjusting.

Thank you !

Original thread: https://forums.rpgmakerweb.com/threads/target-rate-modification.87326/