MZ - Restricting Targets based on Actor/Enemy Property

● ARCHIVED · READ-ONLY
Started by Puppet Knight 7 posts View original ↗
  1. I am trying to figure out what function/script to use to restrict who can be targeted by certain attacks. Actors and Enemies have the property columnIndex that I want to use to determine who can target them. Effectively making the Actors and Enemies either Melee (columnIndex ===0) or Ranged (columnIndex === 1).

    Rawest basic example:

    Melee party members should not be able to target Ranged Enemies.

    So
    if (subject.columnIndex ===0) { if (target.columnIndex > 0){ return false; } else { return true; } }

    I'm just not sure what (if any) script or function I can hook into/overwrite to enable the logic above.


    As an FYI I am using VS Battle Core as well. So if theres a note tag I am overlooking here, let me know.
  2. bump
  3. Use <JS Targets>
  4. Trihan said:
    Use <JS Targets>
    Tried that,

    It seems to affect the resulting Targets, not who can be targeted upfront. What i'm looking for is an affect like @caethyril 's Cae_OnUseEffects <target filter:> note tag. However that conflicts weirdly with BattleCore when cancelling a selection where it starts highlighting whatever party member is at index 0 until targetting commences again.
  5. Bringing this over here in case it helps:
    Puppet Knight said:
    do you know of a function/script call to unselect any currently selected troops/party members
    To deselect, you could try:
    • $gameParty.select(null);
    • $gameTroop.select(null);
    Or hide the associated window (which by default also procs deselection):
    • SceneManager._scene._actorWindow.hide();
    • SceneManager._scene._enemyWindow.hide();
  6. caethyril said:
    To deselect, you could try:
    • $gameParty.select(null);
    • $gameTroop.select(null);
    These did exactly the job.

    Thank you so much Cae!
  7. This thread is being closed due to being solved. If you need it reopened, report it to let us know why. Thank you!