ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
943
Reaction score
589
First Language
English
Primarily Uses
RMMV
Hey all. I just made a quick and dirty little script to add TGR as a valid param for Yanfly's BattleAICore.


What it does:

  • Allows the option of using TGR to determine a target, when using the param option.
  • Enemies using this param will target the actor with the TGR that matches the param check. (highest or lowest)
  • I'm not sure if enemies have a TGR rate, so if it's used to determine an ally, it might not work



How to use it:

  • When you are setting a target for an action in the AI, use either highest or lowest, and TGR (as if you were doing HP or MP, or another parameter).

Example:


TGR.PNG


In the above example, if the random check doesn't pass, it will always attack the target with the lowest TGR.


What is TGR, and why do I care?

  • TGR is RMMV's built in 'threat' system. A higher value makes you more likely to be targeted by the default AI.
  • Without an ability to take TGR into account, the only way to use it is to have the enemy randomly attack through the AI plugin.
  • This addon allows you to get it to function more like it was originally intended. You can set 'dumb' enemies to target your high TGR tank, while smarter enemies may target lowest TGR support characters. Attacks that don't specify a target will, by default use TGR to determine the target, as the default AI would in the same situation.



Terms of use:

  • Abide by the terms of yanfly's plugins.



View attachment YEP_X_BattleAITGRAddon.js
 
Last edited by a moderator:

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,569
First Language
PT - EN
Primarily Uses
RMMV
So this is a kind of Enmity like system, right?
 


But now i have those questions:

How can i ncrease TGR during combat?
Will it reset at the end of combat?
If not, how do i clear it up?
 
Last edited by a moderator:

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
943
Reaction score
589
First Language
English
Primarily Uses
RMMV
This is a very basic enmity system. Enemies will still act randomly, so there will be occasions where they don't attack the highest TGR actor, using the default AI, anyway. But using this add-on, you can set them to always attack the highest TGR actor as a default, so it could be used pretty well for a tank/threat/enmity system.


TGR is an SP-Parameter that all actors have a default value of 1 (or 100%). Traits on classes or actors can increase or decreases this value by multiplying it's base value by a percentage. If the trait gives TGR + 150% the value will be 1.5 or 150% for example. States can also modify this, and you can use it with yanfly's autopassive states plugin to set passive abilities that increase TGR on the actor who knows them, or you can make custom states that increase the value over time.


Depending on how long these states last, the effect could also be removed after battle, of course.


You can also make use of something like action sequences, to possibly add TGR rate to an actor after an attack, or add states that do that. There's a lot you can do with TGR that hasn't really been touched before, as far as I can tell.
 

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,569
First Language
PT - EN
Primarily Uses
RMMV
It would be good if you add this in the help section of your plugin and a basic formula of how to make skill add TGR cuz i'm still figuring out how to do it :<

I think many people will feel lost too since they may not have a good experience with formulas.


I know i can use a.gaintgr for this, but dunno if i can reset it at the end of battle :v
 
Last edited by a moderator:

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
943
Reaction score
589
First Language
English
Primarily Uses
RMMV
It would be good if you add this in the help section of your plugin and a basic formula of how to make skill add TGR cuz i'm still figuring out how to do it :<

I think many people will feel lost too since they may not have a good experience with formulas.


I know i can use a.gaintgr for this, but dunno if i can reset it at the end of battle :v

You already know more about using it than I do. All I really knew about it was that I was using it for a passive state on my tank classed actors to make enemies more likely to hit them. When I started using yanfly's AI plugin, that stopped happening, so I made made this add-on to give me back that functionality. Any other uses for it are something to developer will have to come up with themselves.
 

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,569
First Language
PT - EN
Primarily Uses
RMMV
I was checking some plugins here and i've found that TGR is related to TP Regen


TGR.jpg
 

whoami

Villager
Member
Joined
Feb 3, 2014
Messages
14
Reaction score
7
Primarily Uses
Thanks for the plugin, ramza. I didn't realize I needed this, but now it seems really useful!


@kovak You may want to read the "How To Set Traits" section of the MV manual. You can create a state that raises TGR (Target Rate), and have a skill that inflicts that state in battle. Hit F1 when running MV to access the manual.


TGR (TarGet Rate) is different from TRG (Tp ReGen). You've already found Yanfly's excellent documentation on ex-parameters , but you might also want to read Yanfly's explanation of sp-parameters.
 

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,569
First Language
PT - EN
Primarily Uses
RMMV
It's confusing D:


TGR, TRG...looking for the help file didn't helped me at all :v

I've made a state, but i can't make it stack lel

 
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

so... I decided since a park was an area in my game... here's an enemy that's slide with a hand behind it. cause why not.
Hot chocolate and music make studying and note-taking much easier :kaoluv:
Until my hand cramps up from writing too much!
Doing RPG Maker News for 21st September 2021


Malak is still waiting for Dark Deception Chapter 4... This was him yesterday after another sugar crash.
Again, he's fine. He's just bored at this point, considering he's exhausted his entire vacation bucket list.
Am I the only one who files custom resources under specific folders to remember who to credit? :kaoswt2:
1632263519730.png

Forum statistics

Threads
115,269
Messages
1,088,477
Members
149,873
Latest member
DeadlightBC
Top