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

Status
Not open for further replies.

jcmtexas01

Unbreakable Bond
Veteran
Joined
Aug 14, 2019
Messages
48
Reaction score
2
First Language
English
Primarily Uses
RMMV
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.
 

Attachments

  • Stealth Skill.jpg
    Stealth Skill.jpg
    80.8 KB · Views: 3
  • Assassination Skill.jpg
    Assassination Skill.jpg
    102.1 KB · Views: 2
  • Stealth State.jpg
    Stealth State.jpg
    85 KB · Views: 2
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,269
Reaction score
14,269
First Language
English
Primarily Uses
RMMV

I've moved this thread to JS/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

jcmtexas01

Unbreakable Bond
Veteran
Joined
Aug 14, 2019
Messages
48
Reaction score
2
First Language
English
Primarily Uses
RMMV

I've moved this thread to JS/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

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!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,269
Reaction score
14,269
First Language
English
Primarily Uses
RMMV
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.
 

jcmtexas01

Unbreakable Bond
Veteran
Joined
Aug 14, 2019
Messages
48
Reaction score
2
First Language
English
Primarily Uses
RMMV
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!
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
879
Reaction score
557
First Language
English
Primarily Uses
RMMV
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.
 

jcmtexas01

Unbreakable Bond
Veteran
Joined
Aug 14, 2019
Messages
48
Reaction score
2
First Language
English
Primarily Uses
RMMV
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!
 

jcmtexas01

Unbreakable Bond
Veteran
Joined
Aug 14, 2019
Messages
48
Reaction score
2
First Language
English
Primarily Uses
RMMV
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.
 

Attachments

  • Assassination Skill.jpg
    Assassination Skill.jpg
    102.1 KB · Views: 3
  • Stealth State.jpg
    Stealth State.jpg
    85 KB · Views: 3
Last edited:

STARFALL

Core of the Stars
Veteran
Joined
Jul 6, 2020
Messages
153
Reaction score
36
First Language
spanish
Primarily Uses
RMMV
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
 

jcmtexas01

Unbreakable Bond
Veteran
Joined
Aug 14, 2019
Messages
48
Reaction score
2
First Language
English
Primarily Uses
RMMV
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!!!
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
879
Reaction score
557
First Language
English
Primarily Uses
RMMV
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>
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,140
Reaction score
5,378
First Language
Dutch
Primarily Uses
RMXP

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.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

@Shaz needs to make a website for his plugins. (it can be done easily for free with google sites.) I can't find a database of them anywhere!
Dion2.jpg

testing #2
Got fired from my job because they found someone more "Professional" and "Better" then me so I had more time to work on a tower defense prototype for a friend, I will upload tutorials on how to make it yourself once it's finished.
Added a modern day fridge sprite to my thread. Empty, full, and rotten versions :) enjoy

Forum statistics

Threads
109,126
Messages
1,042,337
Members
141,621
Latest member
cjbh2
Top