DoubleX RMMZ Targeting AI - DoubleX - 08-25-2020
Purpose
Lets you control some skills/items target selection AI behaviors by notetags
Introduction
Code: * 1. The default RMMZ only lets you control the targeting AI by tgr, which
* is probabilistic rather than deterministic
* 2. This plugin lets you use some notetags on actors, classes, learnt
* skills/skills in action list, usable skills, posessed items, usable
* items, weapons, armors, enemies and states, to control the targeting
* AI by specifying some deterministic target filters
* 3. Targets passing the filters will still be affected by the
* probabilitic tgr when there are more than 1 such targets
* 4. This plugin only works for skills/items having 1 target, and it
* doesn't work well 1 random target either
* 5. If a filter causes no target to pass, that filter will be discarded
* upon such use cases
Video
Games using this plugin
None so far
Parameters
Code: * @param notetagDataTypePriorities
* @type select[]
* @option Data of the actor
* @value actor
* @option Data of the current class
* @value class
* @option Data of learnt skills/action list(Shouldn't be used with Data of usable skills)
* @value skills
* @option Data of usable skills(Shouldn't be used with Data of learnt skills)
* @value usableSkills
* @option Data of possessed items(Shouldn't be used with Data of usable items)
* @value items
* @option Data of usable items(Shouldn't be used with Data of possessed items)
* @value usableItems
* @option Data of the latest skill/item being used(Can double-count with skills/items/usableSkills/usableItems)
* @value latestSkillItem
* @option Data of equipped weapons
* @value weapons
* @option Data of equipped armors
* @value armors
* @option Data of the enemy
* @value enemy
* @option Data of effective states
* @value states
* @desc Sets data type priorities of all notetags in this plugin
* You can use script calls/plugin commands to change this
* @default ["latestSkillItem","states","enemy","armors","weapons","class","actor"]
Notetags
Code: * ## Notetag Info
* 1. Among all the same notetag types in the same data, all can be
* effective
* 2. Each line can only have at most 1 notetag
* 3. The following is the structure of all notetags in this plugin:
* - <doublex rmmz targeting ai contents>
* - <targeting ai contents>
* Where contents are in the form of type suffixes: entries
* Either of the above can be used, but the 1st one reduce the chance
* of causing other plugins to treat the notetags of this plugin as
* theirs, while the 2nd one is more user-friendly
* - type is one of the following:
* 1. memWithAnyState
* 2. memWithAllStates
* 3. memWithoutAnyState
* 4. memWithoutAllStates
* 5. memWithAnyBuff
* 6. memWithAllBuffs
* 7. memWithoutAnyBuff
* 8. memWithoutAllBuffs
* 9. memWithAnyDebuff
* 10. memWithAllDebuffs
* 11. memWithoutAnyDebuff
* 12. memWithoutAllDebuffs
* 13. memWithAnySkill
* 14. memWithAllSkills
* 15. memWithoutAnySkill
* 16. memWithoutAllSkills
* 17. anyHighestStatMem
* 18. allHighestStatsMem
* 19. notAnyHighestStatMem
* 20. notAllHighestStatsMem
* 21. anyLowestStatMem
* 22. allLowestStatsMem
* 23. notAnyLowestStatMem
* 24. notAllLowestStatsMem
* 25. anyAboveStatMem
* 26. allAboveStatMem
* 27. anyBelowStatMem
* 28. allBelowStatMem
* (Advanced)29. or
* (Search tag: NOTE_TYPE)
* - suffixes is the list of suffixes in the form of:
* suffix1 suffix2 suffix3 ... suffixn
* Where each suffix is either of the following:
* val(The notetag value will be used as-is)
* switch(The value of the game switch with id as the notetag value
* will be used)
* var(The value of the game variable with id as the notetag value
* will be used)
* (Advanced)script(The value of the game variable with id as the
* notetag value will be used as the contents of
* the functions to be called upon using the
* notetag)
* - entries is the list of entries in the form of:
* entry1, entry2, entry3, ..., entryn
* Where entryi must conform with the suffixi specifications
*----------------------------------------------------------------------------
* # Actor/Class/Learnt Skills/Usable Skills/Posessed Items/Usable Items/
* Inputted Skill Or Item/Weapon/Armor/Enemy/States Notetags
* Notetags only apply to skills/items with Number as One in Scope
* Notetags causing the target list to be empty will be discard upon such
* use cases
* (Search tag: ALWAYS_HAS_TARGETS)
* 1. memWithAnyState condSuffix stateIdsSuffix: condEntry, stateIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAnyState(stateIds, mems)
* Where stateIds is the stateIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - stateIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of stateIdsEntry can be an Array of any natural number
* - If stateIdsSuffix is val, then stateIdsEntry should be written as
* stateId1|stateId2|stateId3|stateIdI|stateIdN
* - E.g.:
* <targeting ai memWithAnyState switch val: 1, 2|3> will restrict
* the list of targets to be those with state with id 2 or 3 if the
* game switch with id 1 is on
* 2. memWithAllStates condSuffix stateIdsSuffix: condEntry, stateIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAllStates(stateIds, mems)
* Where stateIds is the stateIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - stateIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of stateIdsEntry can be an Array of any natural number
* - If stateIdsSuffix is val, then stateIdsEntry should be written as
* stateId1|stateId2|stateId3|stateIdI|stateIdN
* - E.g.:
* <targeting ai memWithAllStates switch val: 1, 2|3> will restrict
* the list of targets to be those with state with id 2 and 3 if the
* game switch with id 1 is on
* 3. memWithoutAnyState condSuffix stateIdsSuffix: condEntry, stateIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAnyState(stateIds, mems)
* Where stateIds is the stateIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - stateIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of stateIdsEntry can be an Array of any natural number
* - If stateIdsSuffix is val, then stateIdsEntry should be written as
* stateId1|stateId2|stateId3|stateIdI|stateIdN
* - E.g.:
* <targeting ai memWithoutAnyState switch val: 1, 2|3> will
* restrict the list of targets to be those with state without id 2
* or 3 if the game switch with id 1 is on
* 4. memWithoutAllStates condSuffix stateIdsSuffix: condEntry, stateIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAllStates(stateIds, mems)
* Where stateIds is the stateIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - stateIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of stateIdsEntry can be an Array of any natural number
* - If stateIdsSuffix is val, then stateIdsEntry should be written as
* stateId1|stateId2|stateId3|stateIdI|stateIdN
* - E.g.:
* <targeting ai memWithoutAllStates switch val: 1, 2|3> will
* restrict the list of targets to be those with state without id 2
* and 3 if the game switch with id 1 is on
* 5. memWithAnyBuff condSuffix paramIdsSuffix: condEntry, paramIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAnyBuff(paramIds, mems)
* Where paramIds is the paramIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - paramIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of paramIdsEntry can be an Array of any natural number
* - If paramIdsSuffix is val, then paramIdsEntry should be written as
* paramId1|paramId2|paramId3|paramIdI|paramIdN
* - E.g.:
* <targeting ai memWithAnyBuff switch val: 1, 2|3> will restrict
* the list of targets to be those with atk or def buff if the game
* switch with id 1 is on
* 6. memWithAllBuffs condSuffix paramIdsSuffix: condEntry, paramIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAllBuffs(paramIds, mems)
* Where paramIds is the paramIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - paramIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of paramIdsEntry can be an Array of any natural number
* - If paramIdsSuffix is val, then paramIdsEntry should be written as
* paramId1|paramId2|paramId3|paramIdI|paramIdN
* - E.g.:
* <targeting ai memWithAllBuffs switch val: 1, 2|3> will restrict
* the list of targets to be those with atk and def buff if the game
* switch with id 1 is on
* 7. memWithoutAnyBuff condSuffix paramIdsSuffix: condEntry, paramIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAnyBuff(paramIds, mems)
* Where paramIds is the paramIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - paramIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of paramIdsEntry can be an Array of any natural number
* - If paramIdsSuffix is val, then paramIdsEntry should be written as
* paramId1|paramId2|paramId3|paramIdI|paramIdN
* - E.g.:
* <targeting ai memWithoutAnyBuff switch val: 1, 2|3> will
* the list of targets to be those without atk or def buff if the
* game switch with id 1 is on
* 8. memWithoutAllBuffs condSuffix paramIdsSuffix: condEntry, paramIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAllBuffs(paramIds, mems)
* Where paramIds is the paramIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - paramIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of paramIdsEntry can be an Array of any natural number
* - If paramIdsSuffix is val, then paramIdsEntry should be written as
* paramId1|paramId2|paramId3|paramIdI|paramIdN
* - E.g.:
* <targeting ai memWithoutAllBuffs switch val: 1, 2|3> will
* the list of targets to be those without atk and def buff if the
* game switch with id 1 is on
* 9. memWithAnyDebuff condSuffix paramIdsSuffix: condEntry, paramIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAnyDebuff(paramIds, mems)
* Where paramIds is the paramIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - paramIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of paramIdsEntry can be an Array of any natural number
* - If paramIdsSuffix is val, then paramIdsEntry should be written as
* paramId1|paramId2|paramId3|paramIdI|paramIdN
* - E.g.:
* <targeting ai memWithAnyDebuff switch val: 1, 2|3> will restrict
* the list of targets to be those with atk or def debuff if the
* game switch with id 1 is on
* 10. memWithAllDebuffs condSuffix paramIdsSuffix: condEntry, paramIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAllDebuffs(paramIds, mems)
* Where paramIds is the paramIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - paramIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of paramIdsEntry can be an Array of any natural
* number
* - If paramIdsSuffix is val, then paramIdsEntry should be written
* as paramId1|paramId2|paramId3|paramIdI|paramIdN
* - E.g.:
* <targeting ai memWithAllDebuffs switch val: 1, 2|3> will
* restrict the list of targets to be those with atk and def debuff
* if the game switch with id 1 is on
* 11. memWithoutAnyDebuff condSuffix paramIdsSuffix: condEntry, paramIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAnyDebuff(paramIds, mems)
* Where paramIds is the paramIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - paramIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of paramIdsEntry can be an Array of any natural
* number
* - If paramIdsSuffix is val, then paramIdsEntry should be written
* as paramId1|paramId2|paramId3|paramIdI|paramIdN
* - E.g.:
* <targeting ai memWithoutAnyDebuff switch val: 1, 2|3> will
* restrict the list of targets to be those without atk or def
* debuff if the game switch with id 1 is on
* 12. memWithoutAllDebuffs condSuffix paramIdsSuffix: condEntry, paramIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAllDebuffs(paramIds, mems)
* Where paramIds is the paramIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - paramIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of paramIdsEntry can be an Array of any natural
* number
* - If paramIdsSuffix is val, then paramIdsEntry should be written
* as paramId1|paramId2|paramId3|paramIdI|paramIdN
* - E.g.:
* <targeting ai memWithoutAllDebuffs switch val: 1, 2|3> will
* restrict the list of targets to be those without atk and def
* debuff if the game switch with id 1 is on
* 13. memWithAnySkill condSuffix skillIdsSuffix: condEntry, skillIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAnySkill(skillIds, mems)
* Where skillIds is the skillIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - skillIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of skillIdsEntry can be an Array of any natural
* number
* - If skillIdsSuffix is val, then skillIdsEntry should be written
* as skillId1|skillId2|skillId3|skillIdI|skillIdN
* - E.g.:
* <targeting ai memWithAnySkill switch val: 1, 2|3> will restrict
* the list of targets to be those with skill with id 2 or 3 if the
* game switch with id 1 is on
* 14. memWithAllSkills condSuffix skillIdsSuffix: condEntry, skillIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAllSkills(skillIds, mems)
* Where skillIds is the skillIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - skillIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of skillIdsEntry can be an Array of any natural
* number
* - If skillIdsSuffix is val, then skillIdsEntry should be written
* as skillId1|skillId2|skillId3|skillIdI|skillIdN
* - E.g.:
* <targeting ai memWithAllSkills switch val: 1, 2|3> will
* restrict the list of targets to be those with skill with id 2
* and 3 if the game switch with id 1 is on
* 15. memWithoutAnySkill condSuffix skillIdsSuffix: condEntry, skillIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAnySkill(skillIds, mems)
* Where skillIds is the skillIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - skillIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of skillIdsEntry can be an Array of any natural
* number
* - If skillIdsSuffix is val, then skillIdsEntry should be written
* as skillId1|skillId2|skillId3|skillIdI|skillIdN
* - E.g.:
* <targeting ai memWithoutAnySkill switch val: 1, 2|3> will
* restrict the list of targets to be those with skill without id 2
* or 3 if the game switch with id 1 is on
* 16. memWithoutAllSkills condSuffix skillIdsSuffix: condEntry, skillIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAllSkills(skillIds, mems)
* Where skillIds is the skillIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - skillIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of skillIdsEntry can be an Array of any natural
* number
* - If skillIdsSuffix is val, then skillIdsEntry should be written
* as skillId1|skillId2|skillId3|skillIdI|skillIdN
* - E.g.:
* <targeting ai memWithoutAllSkills switch val: 1, 2|3> will
* restrict the list of targets to be those with skill without id 2
* and 3 if the game switch with id 1 is on
* 17. anyHighestStatMem condSuffix statsSuffix: condEntry, statsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* anyHighestStatMem(stats, mems)
* Where stats is the statsEntry results and mems is the list of
* possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - E.g.:
* <targeting ai anyHighestStatMem switch val: 1, hp|mp> will
* restrict the list of targets to be those with highest hp or mp
* if the game switch with id 1 is on
* 18. allHighestStatsMem condSuffix statsSuffix: condEntry, statsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* allHighestStatsMem(stats, mems)
* Where stats is the statsEntry results and mems is the list of
* possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - E.g.:
* <targeting ai allHighestStatsMem switch val: 1, hp|mp> will
* restrict the list of targets to be those with highest hp and mp
* if the game switch with id 1 is on
* 19. notAnyHighestStatMem condSuffix statsSuffix: condEntry, statsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* notAnyHighestStatMem(stats, mems)
* Where stats is the statsEntry results and mems is the list of
* possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - E.g.:
* <targeting ai notAnyHighestStatMem switch val: 1, hp|mp> will
* restrict the list of targets to be those without highest hp or
* mp if the game switch with id 1 is on
* 20. notAllHighestStatsMem condSuffix statsSuffix: condEntry, statsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* notAllHighestStatsMem(stats, mems)
* Where stats is the statsEntry results and mems is the list of
* possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural
* number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - E.g.:
* <targeting ai notAllHighestStatsMem switch val: 1, hp|mp> will
* restrict the list of targets to be those without highest hp and
* mp if the game switch with id 1 is on
* 21. anyLowestStatMem condSuffix statsSuffix: condEntry, statsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* anyLowestStatMem(stats, mems)
* Where stats is the statsEntry results and mems is the list of
* possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - E.g.:
* <targeting ai anyLowestStatMem switch val: 1, hp|mp> will
* restrict the list of targets to be those with highest hp or mp
* if the game switch with id 1 is on
* 22. allLowestStatsMem condSuffix statsSuffix: condEntry, statsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* allLowestStatsMem(stats, mems)
* Where stats is the statsEntry results and mems is the list of
* possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - E.g.:
* <targeting ai allLowestStatsMem switch val: 1, hp|mp> will
* restrict the list of targets to be those with highest hp and mp
* if the game switch with id 1 is on
* 23. notAnyLowestStatMem condSuffix statsSuffix: condEntry, statsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* notAnyLowestStatMem(stats, mems)
* Where stats is the statsEntry results and mems is the list of
* possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - E.g.:
* <targeting ai notAnyLowestStatMem switch val: 1, hp|mp> will
* restrict the list of targets to be those without highest hp or
* mp if the game switch with id 1 is on
* 24. notAllLowestStatsMem condSuffix statsSuffix: condEntry, statsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* notAllLowestStatsMem(stats, mems)
* Where stats is the statsEntry results and mems is the list of
* possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural
* number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - E.g.:
* <targeting ai notAllLowestStatsMem switch val: 1, hp|mp> will
* restrict the list of targets to be those without highest hp and
* mp if the game switch with id 1 is on
* 25. anyAboveStatMem condSuffix statsSuffix valSuffix: condEntry, statsEntry, valEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* anyLowestStatMem(stats, val, mems)
* Where stats is the statsEntry results, val is the valEntry
* results, and mems is the list of possible targets of the
* skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - valSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - The result of valEntry can be any number
* - E.g.:
* <targeting ai anyAboveStatMem switch val var: 1, hp|mp, 2> will
* restrict the list of targets to be those with hp or mp above the
* value of the game variable with id 2 if the game switch with id
* 1 is on
* 26. allAboveStatMem condSuffix statsSuffix valSuffix: condEntry, statsEntry, valEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* allAboveStatMem(stats, val, mems)
* Where stats is the statsEntry results, val is the valEntry
* results, and mems is the list of possible targets of the
* skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - valSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - The result of valEntry can be any number
* - E.g.:
* <targeting ai allAboveStatMem switch val var: 1, hp|mp, 2> will
* restrict the list of targets to be those with hp and mp above
* the value of the game variable with id 2 if the game switch with
* id 1 is on
* 27. anyBelowStatMem condSuffix statsSuffix valSuffix: condEntry, statsEntry, valEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* anyLowestStatMem(stats, val, mems)
* Where stats is the statsEntry results, val is the valEntry
* results, and mems is the list of possible targets of the
* skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - valSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - The result of valEntry can be any number
* - E.g.:
* <targeting ai anyBelowStatMem switch val var: 1, hp|mp, 2> will
* restrict the list of targets to be those with hp or mp below the
* value of the game variable with id 2 if the game switch with id
* 1 is on
* 28. allBelowStatMem condSuffix statsSuffix valSuffix: condEntry, statsEntry, valEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* allBelowStatMem(stats, val, mems)
* Where stats is the statsEntry results, val is the valEntry
* results, and mems is the list of possible targets of the
* skill/item having this notetag
* - condSuffix can be val, switch or script
* - statsSuffix can be val, var or script
* - valSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of statsEntry can be an Array of any natural number
* - If statsSuffix is val, then statsEntry should be written as
* stat1|stat2|stat3|statI|statN
* - The result of valEntry can be any number
* - E.g.:
* <targeting ai allBelowStatMem switch val var: 1, hp|mp, 2> will
* restrict the list of targets to be those with hp and mp below
* the value of the game variable with id 2 if the game switch with
* id 1 is on
* (Advanced)29. or condSuffix: condEntry
* - Acts as the or operator among the list of effective notetags in
* this plugin upon making action targets
* - condSuffix can be val, switch or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - All filtered target groups separated by the or notetags will be
* joined by the set union operations
* - E.g.:
* If the battler has an effective state with the following
* effective notetags in this plugin:
* <targeting ai anyBelowStatMem switch val var: 1, hp|mp, 2>
* <targeting ai allBelowStatMem switch val var: 3, mhp|mmp, 4>
* <targeting ai or val: true>
* <targeting ai anyAboveStatMem switch val var: 5, atk|def, 6>
* <targeting ai allAboveStatMem switch val var: 7, mat|mdf, 8>
* <targeting ai or val: false>
* <targeting ai notAnyLowestStatsMem switch val: 9, agi|luk>
* <targeting ai notAllLowestStatsMem switch val: 10, hit|eva>
* And if that battler has the following effective notetags in this
* plugin:
* <targeting ai notAnyHighestStatsMem switch val: 11, cri|cev>
* <targeting ai notAllHighestStatsMem switch val: 12, mev|mrf>
* And if the inputted skill/item has the following effective
* notetags in this plugin:
* <targeting ai or val: true>
* <targeting ai anyHighestStatMem switch val: 13, cnt|hrg>
* <targeting ai allHighestStatMem switch val: 14, mrg|trg>
* Then if the notetag data type priorities are states, battler,
* latest skill/item, the inputted actions will select targets
* among those filtered by:
* <targeting ai anyBelowStatMem switch val var: 1, hp|mp, 2>
* <targeting ai allBelowStatMem switch val var: 3, mhp|mmp, 4>
* Or:
* <targeting ai anyAboveStatMem switch val var: 5, atk|def, 6>
* <targeting ai allAboveStatMem switch val var: 7, mat|mdf, 8>
* <targeting ai notAnyLowestStatsMem switch val: 9, agi|luk>
* <targeting ai notAllLowestStatsMem switch val: 10, hit|eva>
* <targeting ai notAnyHighestStatsMem switch val: 11, cri|cev>
* <targeting ai notAllHighestStatsMem switch val: 12, mev|mrf>
* Or:
* <targeting ai anyHighestStatMem switch val: 13, cnt|hrg>
* <targeting ai allHighestStatMem switch val: 14, mrg|trg>
* (v1.01a+)30. memWithAnyUsableSkill condSuffix skillIdsSuffix: condEntry, skillIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAnyUsableSkill(skillIds, mems)
* Where skillIds is the skillIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - skillIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of skillIdsEntry can be an Array of any natural
* number
* - If skillIdsSuffix is val, then skillIdsEntry should be written
* as skillId1|skillId2|skillId3|skillIdI|skillIdN
* - E.g.:
* <targeting ai memWithAnyUsableSkill switch val: 1, 2|3> will
* restrict the list of targets to be those with usable skill with
* id 2 or 3 if the game switch with id 1 is on
* (v1.01a+)31. memWithAllUsableSkills condSuffix skillIdsSuffix: condEntry, skillIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithAllUsableSkills(skillIds, mems)
* Where skillIds is the skillIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - skillIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of skillIdsEntry can be an Array of any natural
* number
* - If skillIdsSuffix is val, then skillIdsEntry should be written
* as skillId1|skillId2|skillId3|skillIdI|skillIdN
* - E.g.:
* <targeting ai memWithAllUsableSkills switch val: 1, 2|3> will
* restrict the list of targets to be those with usable skill with
* id 2 and 3 if the game switch with id 1 is on
* (v1.01a+)32. memWithoutAnyUsableSkill condSuffix skillIdsSuffix: condEntry, skillIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAnyUsableSkill(skillIds, mems)
* Where skillIds is the skillIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - skillIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of skillIdsEntry can be an Array of any natural
* number
* - If skillIdsSuffix is val, then skillIdsEntry should be written
* as skillId1|skillId2|skillId3|skillIdI|skillIdN
* - E.g.:
* <targeting ai memWithoutAnyUsableSkill switch val: 1, 2|3> will
* restrict the list of targets to be those with usable skill
* without id 2 or 3 if the game switch with id 1 is on
* (v1.01a+)33. memWithoutAllUsableSkills condSuffix skillIdsSuffix: condEntry, skillIdsEntry
* - Applies the following DoubleX RMMZ Unit Filters script call:
* memWithoutAllUsableSkills(skillIds, mems)
* Where skillIds is the skillIdsEntry results and mems is the list
* of possible targets of the skill/item having this notetag
* - condSuffix can be val, switch or script
* - skillIdsSuffix can be val, var or script
* - The result of condEntry can be anything as only whether it's
* truthy matters
* - If the result of condEntry is falsy, this notetag will be
* discarded upon such use cases
* - The result of skillIdsEntry can be an Array of any natural
* number
* - If skillIdsSuffix is val, then skillIdsEntry should be written
* as skillId1|skillId2|skillId3|skillIdI|skillIdN
* - E.g.:
* <targeting ai memWithoutAllUsableSkills switch val: 1, 2|3> will
* restrict the list of targets to be those with usable skill
* without id 2 and 3 if the game switch with id 1 is on
Script Calls
Code: * # Parameter manipulations
* 1. $gameSystem.setTargetingAIParam(param, val)
* - Sets the fully parsed value of the parameter param as val
* - param must be the name of a valid parameter of this plugin
* - val must be a valid new fully parsed value of the parameter param
* - Such parameter value changes will be saved
* - E.g.:
* $gameSystem.setTargetingAIParam("notetagDataTypePriorities", [
* "states",
* "armors",
* "weapons",
* "class",
* "actor",
* "enemy"
* ]) sets the fully parsed value of the parameter
* notetagDataTypePriorities as
* ["states", "armors", "weapons", "class", "actor", "enemy"]
* 2. $gameSystem.targetingAIParam(param)
* - Returns the fully parsed value of the parameter param
* - param must be the name of a valid parameter of this plugin
* - E.g.:
* $gameSystem.targetingAIParam("notetagDataTypePriorities") returns
* the fully parsed value of the parameter
* notetagDataTypePriorities, which should be
* ["states", "armors", "weapons", "class", "actor", "enemy"] if it
* uses its default parameter value
Plugin Commands
Code: * 1. setTargetingAIParam param val
* - Applies the script call
* $gameSystem.setTargetingAIParam(param, val)
Author Notes
Code: * 1. All notetags of this plugins are just applying script calls in
* DoubleX RMMZ Unit Filters unit manipulation script calls, so you're
* highly encouraged and recommended to have a basic knowledge on what
* they do in general, even though it's not strictly needed to use
* this plugin
Prerequisites
Plugins:
1. DoubleX RMMZ Enhanced Codebase
DoubleX RMMZ Enhanced Codebase
2. DoubleX RMMZ Unit Filters
DoubleX RMMZ Unit Filters
Abilities:
1. Nothing special for most ordinary cases
2. Little RMMZ plugin development proficiency to fully utilize this(Elementary Javascript exposures being able to write beginner codes up to 300LoC scale)
Terms Of Use
Code: * 1. Commercial use's always allowed and crediting me's always optional.
* 2. You shall keep this plugin's Plugin Info part's contents intact.
* 3. You shalln't claim that this plugin's written by anyone other than
* DoubleX or my aliases. I always reserve the right to deny you from
* using any of my plugins anymore if you've violated this.
* 4. If you repost this plugin directly(rather than just linking back),
* you shall inform me of these direct repostings. I always reserve
* the right to request you to edit those direct repostings.
* 5. CC BY 4.0, except those conflicting with any of the above, applies
* to this plugin, unless you've my permissions not needing follow so.
* 6. I always reserve the right to deny you from using this plugin
* anymore if you've violated any of the above.
Contributors
Code: * Authors:
* 1. DoubleX
* Plugin Development Collaborators:
* - None So Far
* Bug Reporters:
* - None So Far
* Compatibility Issue Raisers:
* - None So Far
* Feature Requesters:
* - None So Far
Changelog
Code: * { codebase: "1.1.0", plugin: "v1.01b" }(2020 Dec 2 GMT 0400):
* 1. You no longer have to edit the value of
* DoubleX_RMMZ.Targeting_AI.PLUGIN_NAME when changing this plugin
* file name
* { codebase: "1.0.0", plugin: "v1.01a" }(2020 Aug 28 GMT 0100):
* 1. Added the following notetags -
* - memWithAnyUsableSkill
* - memWithAllUsableSkills
* - memWithoutAnyUsableSkill
* - memWithoutAllUsableSkills
* { codebase: "1.0.0", plugin: "v1.00a" }(2020 Aug 25 GMT 0400):
* 1. 1st version of this plugin finished
Download Link
Download Link
Demo Link
Demo Link
RE: DoubleX RMMZ Targeting AI - DoubleX - 08-28-2020
Updates
Code: * { codebase: "1.0.0", plugin: "v1.01a" }(2020 Aug 28 GMT 0100):
* 1. Added the following notetags -
* - memWithAnyUsableSkill
* - memWithAllUsableSkills
* - memWithoutAnyUsableSkill
* - memWithoutAllUsableSkills
Note that you've to update DoubleX RMMZ Unit Filters to v1.01a as well :)
RE: DoubleX RMMZ Targeting AI - DoubleX - 09-22-2020
Updates
Added the Demo Link:
Demo Link
RE: DoubleX RMMZ Targeting AI - DoubleX - 12-02-2020
Updates
Code: * { codebase: "1.1.0", plugin: "v1.01b" }(2020 Dec 2 GMT 0400):
* 1. You no longer have to edit the value of
* DoubleX_RMMZ.Targeting_AI.PLUGIN_NAME when changing this plugin
* file name
|