Untargetable State

I desire a script which allows a dev to disable targeting on an actor or enemy based on their state. I don't want the target of this state to be invincible by any means, this is mostly a counter of single-target skills. Area of effect skills that target all enemies should still work, so long as there is another target available.

I've tested this script already: http://himeworks.com/2013/05/untargetable-state/, but there's a number of problems with it. For one, it makes the target of the state invincible, and it disallows self-targeting which is an issue for toggle skills. Also, it doesn't seem to actually stop the enemy from targeting the player, I noticed that they still attack the player even when there's only 1 actor in battle.

I think a true untargetable state would be pretty useful to more than just myself. I personally want to use it for a stealth skill.

Any assistance with this matter would be greatly appreciated.

Edit: On second thought, I think Hime's Untargetable States script would work if there was an exception for all enemies target skills, self targeting, and maybe also random targeted skills. It's not idea, but those exceptions would be acceptable.
If i didn't misread what you meant, the game original engine already supports what you want.

Simply add "Target Rate 0%" to a state and apply the state to that actor should do the trick.

Only works when there's another party member in the battle with Target Rate(aka hate) higher than that actor.

And AoE will still effects him/her.

If you want to do something like a "sneak/stealth" to prevent battle.

Apply the state, for your events that trigger battle, do a condition check for state, and only trigger battle when the state isn't on.
I desire a script which allows a dev to disable targeting on an actor or enemy based on their state. I don't want the target of this state to be invincible by any means, this is mostly a counter of single-target skills. Area of effect skills that target all enemies should still work, so long as there is another target available.

I've tested this script already: http://himeworks.com/2013/05/untargetable-state/, but there's a number of problems with it. For one, it makes the target of the state invincible, and it disallows self-targeting which is an issue for toggle skills. Also, it doesn't seem to actually stop the enemy from targeting the player, I noticed that they still attack the player even when there's only 1 actor in battle.

I think a true untargetable state would be pretty useful to more than just myself. I personally want to use it for a stealth skill.

Any assistance with this matter would be greatly appreciated.

Edit: On second thought, I think Hime's Untargetable States script would work if there was an exception for all enemies target skills, self targeting, and maybe also random targeted skills. It's not idea, but those exceptions would be acceptable.


I'm pretty sure MeowFace explained everything that could happen

If you want to prevent random encounter's all together, while an actor has that state, I would suggest trying a common event that checks for the state, and if it returns true (the state is inflicted) then (((This Next Part Might Not Work I haven't tried it))) go to script and enter

@encounter_count = 0

this would in theory prevent all encounters until you change encounter_count again.

NOTE: The default I believe is @encounter_count = rand(n) + rand(n) + 1
If you want to prevent random encounter's all together, while an actor has that state, I would suggest trying a common event that checks for the state, and if it returns true (the state is inflicted) then (((This Next Part Might Not Work I haven't tried it))) go to script and enter

@encounter_count = 0

this would in theory prevent all encounters until you change encounter_count again.

NOTE: The default I believe is @encounter_count = rand(n) + rand(n) + 1
You can disable encounter in state setting alone, don't need a script call for that, simply add the party special settings and there's Halves current Encounter or No Encounter. So as long as the state is applied, normal map encounter will not happen. What i suggested is, when his enemies are event based, he will need that condition check to avoid the battle being triggered.
You can disable encounter in state setting alone, don't need a script call for that, simply add the party special settings and there's Halves current Encounter or No Encounter. So as long as the state is applied, normal map encounter will not happen. What i suggested is, when his enemies are event based, he will need that condition check to avoid the battle being triggered.
Ah, I completely forgot about  those special settings. Haha, looks like I was going to do this in a way more complicated way than necessary.
This was nearly a month ago, and I sorta forgot about this thread. I do thank you all for the replies though.  Anyway, this had nothing to with map encounters, so lets just disregard that part. By 'untargetable', I meant unable to be selected for attack, yet still able to receive damage. I set up an aggression system where enemies will attack an actor based on a comparison of variables that are increased upon receiving damage from actors and vice-versa . Even if I did use TGR and set it to 0%, enemies can and will continue to select that actor for attack.

I decided to compromise by giving the state 100% evade and magic evade, then having it removed by receiving damage or attacking. The idea is that only 'Accurate' (Certain Hit) skills will be able to affect a target in stealth, forcing them out of it. I'd like it if area of effect skills automatically forced an enemy out of stealth so that the skill isn't so overpowered. However, I realize RPG Maker doesn't really have AoE, it's just 'Target All Enemies'. I'm currently in the process of balancing the skills of each of the classes I've made, but since there's over skills 300 to modify, it'll probably be awhile before I get around to the stealth issue again. Hopefully I would have found a solution by then.
Is there a certain battle system ur using this for?

If not then try this one out BD

http://www.rpgmakervxace.net/topic/6870-est-enemy-actor-position-v-32-scope-condition/
Is there a certain battle system ur using this for?

If not then try this one out BD

http://www.rpgmakervxace.net/topic/6870-est-enemy-actor-position-v-32-scope-condition/
That's actually not a bad Idea. I've encountered that script before, but never thought of using it for something like this. I'll definitely check it out when I have a chance.
Yep! I think it might work on what ur actually lookin for. Any particular BS ur using?
Yep! I think it might work on what ur actually lookin for. Any particular BS ur using?
YSA Classical ATB and a few moghunter scripts for visual appeal.
I don't know how well this will help you, but in the Warrior Cats fangame I'm making, I have a mechanic that might do what you're looking for, or at least point you in the right direction.

You mentioned that instead of using Target Rate, you're using some sort of aggro/threat system that determines who the enemies will attack. For my game, I'm using the "Euphoria Threat System" that was posted here. I don't think you need to overhaul your whole game to include this, just as long as the threat value for your game is set as an "attr_accessor" or whatever, that you can change in damage formulas and stuff.

One of my characters, Dustwing, is half-spirit, which among several other things, means that she has the ability to vanish from sight whenever she wants. Gameplay-wise, she has very strong attacks, but she draws lots of threat, and is quite frail. She also has a skill called "Vanish", which makes her disappear from the view of enemies. However, if she uses a move that does damage while she has vanished, she will become visible again. She also has buff moves, so my recommended strategy in game is to half Dustwing attack enemies a bunch, then to have her vanish once she's drawn too much threat and to buff the rest of the party until it's safe to attack again. Players will probably find a few strategies they can use, though.

To accomplish this, I had to use Yanfly's Lunatic States. (There may or may not be a place to create effects in the Lunatic States script itself, but I just got the Protection Package as well and added in my effects there.)

The move "Vanish" sets Dustwing's Threat level to 0 (although maybe I should fiddle with the scripts and change that to -1) and applies the "Vanish" state to her.

The Vanish state uses these custom effects:

when /NO THREAT/i
      return if @result.hp_damage > 0
      self.threat = 0
     

when /NO VANISH/i
      if @result.hp_damage > 0
        self.remove_state(37)
        end
I set them as "while effects", so they'll run after every move you make. You could also set them as "react effects" if you want to remove the state when they take damage.

Anyway, the first one, No Threat, checks to see if Dustwing's most recent action dealt damage. If it didn't, then it reduces her threat level to 0. The second one, No Vanish, does the same test, and removes the Vanish state if she did deal damage. (I'm using the Yanfly Battle Engine as well, though, which clears "@result.hp_damage", so to make it work, I had to go into that script and put "$game_variables[27] = @result.hp_damage" right before it cleared to save the value. Then in the effect, I had it test "$game_variables[27]" instead of "@result.hp_damage".)

I don't know how much this will help, because even with Vanish, enemies will target you if you only have one party member. However, when there are multiple party members, then a Vanished character will not be targeted, but can still be hit by AoE attacks.

I hope it does point you in the right direction, though!
After a couple of months of reworking the combat system, I've finally arrived at the stealth issue again. It seems this issue resolved itself a while back once I opted to use dodger451's Threat System. I can simply set TGR to 0% and the enemy will not attack that actor in a group, and their single-target skills will not work on that actor when alone in battle. Skills that target all actors will still hit a character in stealth whether they're alone or not. It's not exactly as I wanted, but it's close enough to handle any game balancing issues.
Well I think there might be a way to fix that problem using a sort of "Substitute" sort of state though I'm not very sure on it. 

Original thread: https://forums.rpgmakerweb.com/threads/untargetable-state.43774/