Enemy Targeting Chance

Hello everyone,


I couldn't find a good way to word the title, but I'll explain what I meant below-


I'm looking for a way to be able to modify the percentage chance of all enemies(unless specified otherwise within enemy notes, which is in the below example) hitting specific members of a party. Here's the gist of what I mean:


-----------------------------------


General/All Enemies


-----------------------------------


Actor A, B, C, D initiate battle with Enemy X


General Targeting Outline(within the plugin parameters):


-A has 30% chance of getting hit


-B has 10% chance of getting hit


-C has 10% chance of getting hit


-D has 50% chance of getting hit


X initiates an attack, and a hidden "roll" occurs, 1-100, following this outline(preferably a randomized "table" each "roll"(I don't believe this is the best method for rolling, but if it's just how it works, than fair enough)):


1-30 = A gets hit.


31-40 = B gets hit.


41-50 = C gets hit.


51-100 = D gets hit.


"Roll" ends up with an outcome of 42, thus C gets hit.


X initiates an attack, same as before.


"Roll" ends up with an outcome of 75, thus D gets hit.


-----------------------------------


Specific Enemy


-----------------------------------


Actor 0001, 0002, 0003, 0004 initiate battle with Enemy Y


Y has a specific chance outline in the Note Section, which is:


<tchance(0001): 70%>


<tchance(0002): 10%>


<tchance(0003): 10%>


<tchance(0004): 10%>


Y initiates an attack, and a hidden "roll" occurs, 1-100, following this outline(preferably a randomized "table" each "roll", if possible(I don't believe this is the best method for rolling, but if it's just how it works, than fair enough)):


1-70 = A gets hit.


71-80 = B gets hit.


81-90 = C gets hit.


91-100 = D gets hit.


"Roll" ends up with an outcome of 53, thus A gets hit.


Y initiates an attack, same as before.


"Roll" ends up with an outcome of 77, thus B gets hit.


<----------------------------------------------------------------------->


If there are any questions, I will answer them. I appreciate your time with looking at this, and I hope one of you would be willing to help me out.


Have a good week regardless!
You might be able to do this without a plugin, if you're willing to have the rates troop-based instead of enemy-based.


The target rate parameter already does what you want (determine which actor is hit with which probability), but because it is a trait and a general parameter, it can only be changed by states and will affect all enemies in a troop in the same way.


If you make several states with different changes to TGR, you can have them applied to the actor in a troop event on turn 0, setting the targeting chances for that troop to the values you choose.
You might be able to do this without a plugin, if you're willing to have the rates troop-based instead of enemy-based.


The target rate parameter already does what you want (determine which actor is hit with which probability), but because it is a trait and a general parameter, it can only be changed by states and will affect all enemies in a troop in the same way.


If you make several states with different changes to TGR, you can have them applied to the actor in a troop event on turn 0, setting the targeting chances for that troop to the values you choose.



I appreciate your reply, and I have been trying to find the target rate thing, but to no avail. Perhaps I'm just looking in the wrong spot. Also, assuming troop-based is what I think it is(the set-up of certain enemies in a battle encounter), I don't think that'd work out well in the end for what I'm needing.


Also, what is TGR? I'm honestly clueless as to the entire second(technically third) paragraph.


At the end of the day, I want to be able to do it nice, neat, and organized.
TGR is a special parameter in the traits tab. It's stands for targeting rate. Essentially, the higher TGR on an actor increases the chances of an enemy attacking that actor. 
Also, what is TGR? I'm honestly clueless as to the entire second(technically third) paragraph.



That is the abbrevation used in scripts and in the program for target rate.


More details on how it works can be found in the help file and in this:




Just for your info: due to technical programming, the target rate is listed as a percentage in the traits/feature list (it's an SP-Parameter) and if you apply several TGR-Features they're multiplied for the final actor TGR, but the comparison who to target between different actors then uses it as a weight number, not as a percentage.

Original thread: https://forums.rpgmakerweb.com/threads/enemy-targeting-chance.64788/