Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,718
Reaction score
16,527
First Language
Filipino
Primarily Uses
RMMZ
Advanced AI Conditions
Version 1.0c
 ​
What is this?
This script allows the developper to exert better control on how the AI handles the enemies' action patterns.
Script configuration is almost entirely made via noteboxes and no RGSS3 knowledge is required to use it.
 
Features and Instructions

qwuXSOl.png
PART 1: DEFAULT AI CONFIGURATION
 
- TGR settings
TGR determine the frequency a target will be chosen during random targeting rolls. The configuration module below allows you to set how damage and healing affects TGR to make a character more threatening to the eyes of the AI.
 
- Skill settings
Every skill can be given default AI *targeting* conditions all enemies will use. To do it, you have to create an "AI block" in the skill's notebox.
 
Notetags explanation:

<ai_conditions>Explanation: You always start the block with this one. target_hpgt: nExplanation: The target HP must be greater or equal to n%. target_hplt: nExplanation: The target HP must be lesser or equal to n%. target_states: n, n...Explanation: The target must have the specified states already inflicted. target_states_not: n, n...Explanation: The target must NOT have the specified states already inflicted. only_if_targetExplanation: If no suitable target is found, the skill won't be used AT ALL. </ai_conditions>Explanation: You always end the block with this one.PART 2: ENEMY AI CONFIGURATION
 
On top on a default AI, you can setup individual AI conditions for every different enemy. In case of conflict with the default targeting AI, these settings will take precedence.
All these settings make use of the enemy's notebox.
 
NOTE: the term "action index" refers to the order of the action pattern you enter for enemies in the database. For instance, if your list is like this:
 
Attack
Fire II
Poison
 
Attack will be index 1, Fire II will be index 2 and Poison index 3. And so on.
 
Notetags explanation:

<ai_conditions: n, n...>Explanation: One way of starting an AI block. n must be an action index and if you put more than one (separated by comma), the conditions will be applied to each of them. <ai_conditions: n, n...> use_idExplanation: Same as above, but instead of the action index, the skill ID will be used. n must be a valid skill ID in this case. switches: n, n...Condition: designated switches are ON. variables: x, y, x, y...Condition: the variables x have the value y. states: n, n...Condition: acting enemy is under the every of the designated states. hpgt: nCondition: acting enemy has hp greater or equal than n%. hplt: nCondition: acting enemy has hp lesser or equal than n%. mpgt: nCondition: acting enemy has mp greater or equal than n%. mplt: nCondition: acting enemy has mp lesser or equal than n%. party_level: nCondition: party level is greater than n. turns_order: a+bxCondition: it's exactly like in the database condition for turns. target_hpgt: nCondition: The target HP must be greater or equal to n%. target_hplt: nCondition: The target HP must be lesser or equal to n%. target_states: n, n...Condition: The target must have the specified states already inflicted. target_states_not: n, n...Condition: The target must NOT have the specified states already inflicted. only_if_targetCondition: If no suitable target is found, the skill won't be used AT ALL. </ai_conditions> Explanation: You must end the block with this one. 
- Creating Turn Patterns
 
Turn patterns is a special AI setting which completely replace an action pattern with another one at the designated turns. During a turn pattern, the "normal" actions (the ones you entered into the database) won't be taken into consideration, ever. You need to create another block to make a Turn Pattern.

<turn_pattern: a+bx>Used to define the pattern. a is the first turn and b the number of turns after the first. skill: a, ba is the skill id and b the rating. </turn_pattern>End the pattern.  
NOTE 1: You can put as many skill tags as you want.
NOTE 2: In order to assign conditions to a skill inside a turn pattern, you have to create a new AI block with that skill's ID.
 
- Absolute Rating
 
The absolute rating is a special rating you assign to an action during databasing your enemy. An action with this rating will take absolute priority, ignoring all others (even higher ones) provided it can be used.
If you have several actions with an absolute rating, one will be chosen randomly.
 
Download and Terms of Use

  • Contact me for commercial usage.
  • I will not be giving support or fixing bugs for you. I don't have time for that.
  • Please do not distribute them in one huge zip/rar/.7z/whatever compression without my permission.
  • You may use or edit the code as you please as long as it has proper attribution. However, you cannot change the license for the script e.g. removing the permission to use for commercial projects.
  • Please add me in your credits either as Archeia Nessiah/Division Heaven. It can be in the ReadMe/Game Credits/etc.
  • I am not liable for any destructive behavior that the materials could have caused you, such as, but not limited to, computer damage, incontinence, explosion of user’s head, coma, death, and/or halitosis. So edit or use at your own risk.
 
Last edited by a moderator:

The Stranger

No Longer Active
Regular
Joined
Sep 14, 2012
Messages
3,687
Reaction score
24,520
First Language
-
Primarily Uses
N/A
This looks fantastic! I'm looking forward to designing complex encounters, now.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Regular
Joined
May 15, 2012
Messages
14,693
Reaction score
3,035
First Language
Tagalog
Primarily Uses
RMVXA
This is nice... not as extensive as a full RGSS3 powered AI setting as you're limited to what to use, but nonetheless good and easier to use. :3

One thing I notice though is that this kind of script somehow would work better if we add an accompanying target selection script...
 
Last edited by a moderator:

Jaymonius

Regular
Regular
Joined
Mar 22, 2012
Messages
257
Reaction score
81
First Language
English
Primarily Uses
RMVXA
Ooooooooooooooooooh!!! Now this looks like this will be a lot of fun to mess around with. I've always wanted to have smarter AI enemies and bosses without having to rely on events to get things done. Excellent! Good show. :D
 

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
Thank you for this awesomeness.
 

Kenen

Regular
Regular
Joined
Apr 3, 2012
Messages
545
Reaction score
952
First Language
English
Primarily Uses
RMMZ
The target states function here is very convenient. The same can be done with Yanfly's scripts, but that requires adjusting individual skills. This way, everything can be done in the enemy pane. Awesome!
 

Oddball

Regular
Regular
Joined
Sep 4, 2014
Messages
2,146
Reaction score
662
First Language
English
Primarily Uses
N/A
How do you make a group of enemies (Like wolves) target the actor with the lowest HP or the most negative states?
 

Ksi

~RTP Princess~
Restaff
Joined
Mar 13, 2012
Messages
2,089
Reaction score
1,694
First Language
English
How do you make a group of enemies (Like wolves) target the actor with the lowest HP or the most negative states?
Download and Terms of Use

  • Contact me for commercial usage.
  • I will not be giving support or fixing bugs for you. I don't have time for that.
  • Please do not distribute them in one huge zip/rar/.7z/whatever compression without my permission.
  • You may use or edit the code as you please as long as it has proper attribution. However, you cannot change the license for the script e.g. removing the permission to use for commercial projects.
  • Please add me in your credits either as Archeia Nessiah/Division Heaven. It can be in the ReadMe/Game Credits/etc.
  • I am not liable for any destructive behavior that the materials could have caused you, such as, but not limited to, computer damage, incontinence, explosion of user’s head, coma, death, and/or halitosis. So edit or use at your own risk.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Regular
Joined
May 15, 2012
Messages
14,693
Reaction score
3,035
First Language
Tagalog
Primarily Uses
RMVXA
@Oddball - This is a script to determine what Action an enemy will do, not for choosing who to target... Those are different things

which is also why on my first post, I said

One thing I notice though is that this kind of script somehow would work better if we add an accompanying target selection script...
 
Last edited by a moderator:

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,718
Reaction score
16,527
First Language
Filipino
Primarily Uses
RMMZ
It has target controls to some extent but you would want to combine it with TGR.

not very straightforward though but only does it through conditions.

target_hpgt: nCondition: The target HP must be greater or equal to n%.
 
target_hplt: n
Condition: The target HP must be lesser or equal to n%.
 
target_states: n, n...
Condition: The target must have the specified states already inflicted.
 
target_states_not: n, n...
Condition: The target must NOT have the specified states already inflicted.
 
only_if_target
Condition: If no suitable target is found, the skill won't be used AT ALL.
 
Last edited by a moderator:

Oddball

Regular
Regular
Joined
Sep 4, 2014
Messages
2,146
Reaction score
662
First Language
English
Primarily Uses
N/A
But none of those are what i wanted. I'm not going to use this anyway, but i was talking about it comparing the HP of ALL the actors and targeting the one with the lowest, so that predatory animals like wolves seem to behave like real wolves. Eating the one's that are most likely to catch and spread a disease to the rest

your script only checks if a certain actors HP is below/above a certain point
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,718
Reaction score
16,527
First Language
Filipino
Primarily Uses
RMMZ
Um no it doesn't? It checks EVERYONE's HP (the targets they can attack) IF you use this tag:

target_hpgt: nCondition: The target HP must be greater or equal to n%. target_hplt: nCondition: The target HP must be lesser or equal to n%.to find who has the lowest and who has it at a certain amount. I'm not sure what you're talking about. You can't even set actor IDs.

If you're talking about MAX HP then that's an entirely different thing and you might want to work around that by giving the lowest MAX HP character a state, so they would target it. It's not that complicated.

If you're not going to use it then I'm not sure what's the issue here. I'm only replying to Engr. Adiktuzmiko's comment about lack of target options (which is true to some extent but I don't know how much target control you'd want more).
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Regular
Joined
May 15, 2012
Messages
14,693
Reaction score
3,035
First Language
Tagalog
Primarily Uses
RMVXA
target_hpgt: nCondition: The target HP must be greater or equal to n%.
 
target_hplt: n
Condition: The target HP must be lesser or equal to n%.
Doesn't this just checks if the target HP is on a certain level? I think what he's asking is how to find the target with the LOWEST hp of them all
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,718
Reaction score
16,527
First Language
Filipino
Primarily Uses
RMMZ
Thus why I proposed a workaround using either states or TGR based on their conditions.

Actually I do have a TGR script that does increase or decrease the target's TGR based on the condition of their HP or if they have a state, I can release that one too hm.
 
Last edited by a moderator:

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
When I add:

<ai_conditions>

target_states_not: 49 <---- haste state id

</ai_conditions>

 

To a skill, I get the error message in the screenshot.

 

When I add the tag:

 

<ai_conditions 2>        action index 2, Skills: 1 = attack, 2 = haste

target_states_not: 49  <---- haste state id

</ai_conditions>

 

To an enemy, it still casts the buff on a target who has the state. What am I doing wrong?


1.png
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,718
Reaction score
16,527
First Language
Filipino
Primarily Uses
RMMZ
Check the instructions and/or screenshots. You got the syntax wrong.
 

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
I don't see what I am doing wrong. I realize your busy, but according to the screenshot and your instructions, it says you have to create an AI block in the skill's notebox. The ai block has to start with <ai_conditions> and end with </ai_conditions>. There is no screenshot showing this in action. I am assuming you can do multiple commands inbetween.

So:

<ai_conditions>

target_hpgt: 5

only_if_target

</ai_conditions>

 

This should work, however it gives the error like before, saying num isn't a method or w/e. What syntax do I have wrong? I copied exactly from this thread from the instructions.


Can you show me an example of how it's working on a skill in your project please? I really want to use this script!
 

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
Oh..... Sorry, as posted above:

- Skill settings

Every skill can be given default AI *targeting* conditions all enemies will use. To do it, you have to create an "AI block" in the skill's notebox.
 
I read this and saw that it said skill's notebox. Thanks for the clarification!

So then, in the enemy notebox:
 

<ai_conditions 1>

target_states_not: 49

</ai_conditions>

 

This should only cast the skill when the target doesn't have the state, as you can see in the video, it just repeats haste on the same target.

 
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,718
Reaction score
16,527
First Language
Filipino
Primarily Uses
RMMZ
SIIIIIIIIIIGHHHHHHHHHHHHHHHHHHHHHH.......................
 
Look at the instructions again and see what I have? The screenshot. I can't believe that you keep missing the  symbol. Here's an example use.

<ai_conditions: 4>target_hplt: 80target_states: 37only_if_target</ai_conditions>Are you using any other scripts? If you are test this first in a test project.
Like I said, I have to ask so many questions that I don't have time for support. Debug it first in an empty project and see if it still errors.
If it does then report, if it doesn't then check which script of yours is doing it.

But check the syntax like I said.
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

"Do this task for me, and you will be allowed to eat your weight in gold as a reward".
Hmm. Like. I do art things. But, every time I try to make a logo I keep thinking about how awesome it would be if I was not doing it. That may go into the outsource pile. :kaothx:
I put lights up in my living room! And, a stego with hats ^-^
20231130_131859.jpg
Yo, anybody seen this yet?
At what stage are you?

87shj5.jpg

Forum statistics

Threads
136,627
Messages
1,268,131
Members
180,305
Latest member
Tony_Waters
Top