MV RMMV YEP_BuffsStatesCore "Stealth" State JavaScript Assistance (SOLVED)

Anyone willing to help,

In my game, I currently have a "Scout" class that can learn a "Stealth skill" (screen-shot attached), which causes a "Stealth state" (screen-shot attached) to be applied to the user. During stealth, the user cannot move or perform any action for a random number of turns (3 - 5) and cannot be physically attacked by the enemy due to a massive evasion increase.

The Scout class has subclass: Assassin, which I'm trying to create several skills that can only be utilized from a stealth state, and NO OTHER actions can be performed during stealth other than certain "stealth-skills." Ideally, the player as an example could utilize the "Assassination" skill (screen-shot attached) from stealth from a choice of subclass/stealth-specific skills, which would be otherwise "grayed out" if not in stealth state.

The player would be removed from the stealth state right before the attack is executed (utilizing Yanfly's Action Sequence; I'm using several Yanfly plugins such as Skill Core and Buffs/States to try to get the skills working); then, the Assassination skill would deal heavy damage and have a chance to perform instant death on the enemy.

I realize this is a tall order, but I'm trying to build versatility and fun around the Stealth skill and make it more than just a defensive posture for the select subclass. I wondered if utilizing Yanfly Action Sequences and Skill Core or Buffs/States, or if it's possible via JavaScript or other means to create "Stealth-skills" as mentioned above. Thanks!

---UPDATE---

Require assistance with the "Stealth" state. Please read below. The end state would have any action other than Guard would take the user out of "Stealth" state via JavaScript utilizing YEP_BuffsStatesCore plugin. SEE ATTACHED Stealth State screen-shot, which shows current script.
Moved to: JS/Plugin Support
Moved to: JS/Plugin Support
Shaz,

Is there a way to edit this post to make it more plausible that someone might be willing to help me write a script? Maybe too wordy? Thanks!
I'm not familiar with those plugins, but there's a lot of text there, and I'm having trouble figuring out the actual request. Can you format it as "these are the relevant plugins, this is what it's doing, this is what I'd like it to do instead" and keep it as brief as possible (how much of that backstory and trailer stuff is relevant to the request)?

There are a few people around with experience with Yanfly's plugins. You're okay to bump if there's been no response in 72 hours.

You might also find some useful stuff here to help improve the post.
I'm not familiar with those plugins, but there's a lot of text there, and I'm having trouble figuring out the actual request. Can you format it as "these are the relevant plugins, this is what it's doing, this is what I'd like it to do instead" and keep it as brief as possible (how much of that backstory and trailer stuff is relevant to the request)?

There are a few people around with experience with Yanfly's plugins. You're okay to bump if there's been no response in 72 hours.

You might also find some useful stuff here to help improve the post.
I will edit this shortly. You are awesome, thank you!
You can use a note tag from SkillCore to make a skill only usable when the user is affected by the stealth state:
Code:
<Custom Requirement>
   if (user.isStateAffected(x)) {
     value = true;
   } else {
     value = false;
   }
</Custom Requirement>
Having the stealth state prevent movement and other abilities is more difficult, because how would the user get the chance to use a stealth skill if they cannot act? Perhaps making it so that using any action other than guard would remove stealth?

Code:
<Custom Confirm Effect>
if (this.item().id != 2) {
 $gameActors.actor(id).removeState(stateId)
}
</Custom Confirm Effect>
That would allow stealth skills to be used, but using them would immediately remove you from stealth, meaning you wouldn't be able to use another one without first going stealth-mode again. You could modify the if check in the confirm condition to add other skills that wouldn't take you out of stealth by adding an or case, or you could change it to something else, like only having physical skills take you out of stealth.
Bump
You can use a note tag from SkillCore to make a skill only usable when the user is affected by the stealth state:
Code:
<Custom Requirement>
   if (user.isStateAffected(x)) {
     value = true;
   } else {
     value = false;
   }
</Custom Requirement>
Having the stealth state prevent movement and other abilities is more difficult, because how would the user get the chance to use a stealth skill if they cannot act? Perhaps making it so that using any action other than guard would remove stealth?

Code:
<Custom Confirm Effect>
if (this.item().id != 2) {
$gameActors.actor(id).removeState(stateId)
}
</Custom Confirm Effect>
That would allow stealth skills to be used, but using them would immediately remove you from stealth, meaning you wouldn't be able to use another one without first going stealth-mode again. You could modify the if check in the confirm condition to add other skills that wouldn't take you out of stealth by adding an or case, or you could change it to something else, like only having physical skills take you out of stealth.
Awesome! I'll take a look at this, thanks!
You can use a note tag from SkillCore to make a skill only usable when the user is affected by the stealth state:
Code:
<Custom Requirement>
   if (user.isStateAffected(x)) {
     value = true;
   } else {
     value = false;
   }
</Custom Requirement>
Having the stealth state prevent movement and other abilities is more difficult, because how would the user get the chance to use a stealth skill if they cannot act? Perhaps making it so that using any action other than guard would remove stealth?

Code:
<Custom Confirm Effect>
if (this.item().id != 2) {
$gameActors.actor(id).removeState(stateId)
}
</Custom Confirm Effect>
That would allow stealth skills to be used, but using them would immediately remove you from stealth, meaning you wouldn't be able to use another one without first going stealth-mode again. You could modify the if check in the confirm condition to add other skills that wouldn't take you out of stealth by adding an or case, or you could change it to something else, like only having physical skills take you out of stealth.

I added the codes as you suggested. The Assassination Skill being only usable via Stealth worked perfectly, but the "any action other than Guard" code posted inside of Stealth state didn't work. Basically, nothing removes the user from Stealth other than the "Turn end" feature.

I would troubleshoot, but I'm not so good at Java 🙁

I added the new Assassination Screen-shot & Stealth State screen-shot.
Bump
I have a similar class in my game, they enter a state called shadow and once in it they attract less attention and increase the evacuation, in addition to new techniques appear that like your class can only be used while in this state, use pluigin de yep to do this but in the same way that the skills appear, it can make the others disappear while in this state and once this state is removed the common skills will appear again and the "Shadow" skills will disappear until the user be in that state again.

if you think it is acceptable you should use Yep Skill Core and add the following:

Put this on every skill in the Stealth state
Code:
  <Custom Show Eval>
  if (user.isStateAffected(Number of your State)) {
    visible = true;
  } else {
    visible = false;
  }
  </Custom Show Eval>

And this in each other of that class

Code:
  <Custom Show Eval>
 if (!user.isStateAffected(Number of your State)) {
    visible = true;
  } else {
    visible = false;
  }
  </Custom Show Eval>

I hope it helps you on something
I have a similar class in my game, they enter a state called shadow and once in it they attract less attention and increase the evacuation, in addition to new techniques appear that like your class can only be used while in this state, use pluigin de yep to do this but in the same way that the skills appear, it can make the others disappear while in this state and once this state is removed the common skills will appear again and the "Shadow" skills will disappear until the user be in that state again.

if you think it is acceptable you should use Yep Skill Core and add the following:

Put this on every skill in the Stealth state
Code:
  <Custom Show Eval>
  if (user.isStateAffected(Number of your State)) {
    visible = true;
  } else {
    visible = false;
  }
  </Custom Show Eval>

And this in each other of that class

Code:
  <Custom Show Eval>
if (!user.isStateAffected(Number of your State)) {
    visible = true;
  } else {
    visible = false;
  }
  </Custom Show Eval>

I hope it helps you on something
Awesome! I'll take a look at this again this weekend. Thank you!

You can use a note tag from SkillCore to make a skill only usable when the user is affected by the stealth state:
Code:
<Custom Requirement>
   if (user.isStateAffected(x)) {
     value = true;
   } else {
     value = false;
   }
</Custom Requirement>
Having the stealth state prevent movement and other abilities is more difficult, because how would the user get the chance to use a stealth skill if they cannot act? Perhaps making it so that using any action other than guard would remove stealth?

Code:
<Custom Confirm Effect>
if (this.item().id != 2) {
$gameActors.actor(id).removeState(stateId)
}
</Custom Confirm Effect>
That would allow stealth skills to be used, but using them would immediately remove you from stealth, meaning you wouldn't be able to use another one without first going stealth-mode again. You could modify the if check in the confirm condition to add other skills that wouldn't take you out of stealth by adding an or case, or you could change it to something else, like only having physical skills take you out of stealth.
Ramza or anyone else willing to assist,

I got the code to work for Stealth state, and also utilizing STARFALL's codes I have almost achieved the desired end-state.

Last question: currently the state effect only works on Actor 2, how do I get this to apply to actors 2, 3, 4, & 5? They're my main characters, and all of them have class change abilities and can utilize that class/skill.

What I tried didn't work for all the actors, just the first one (2):

<Custom Confirm Effect>
if (this.item().id != 2) {
$gameActors.actor(2, 3, 4, 5).removeState(15)
}
</Custom Confirm Effect>

Thanks!

I figured it out!:

<Custom Confirm Effect>
if (this.item().id != 2) {
user.removeState(15)
}
</Custom Confirm Effect>

SOLVED!!!
bump
Your confirm effect should be removing the state from the user, not from a specific actor.
Code:
<Custom Confirm Effect>
if (this.item().id != 2) {
user.removeState(15)
}
</Custom Confirm Effect>

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-yep_buffsstatescore-stealth-state-javascript-assistance-solved.131569/