Imperial_Steele

Villager
Member
Joined
Aug 22, 2021
Messages
14
Reaction score
6
First Language
English
Primarily Uses
RMMV
So, I'm ALMOST there with this, but figured I needed help with polish.

I've successfully implemented a Stealth mechanic in battle. The Actor becomes translucent (thanks to Mokusei Penguin), and gains a passive buff to Evasion, Critical Hit %, Attack, and a significantly lowered target rate. I set it to last for 2 turns, with the idea that it will cancel early if the actor attacks or is hit (50% chance), but more on that in a bit.

I've also made a Sneak Attack Skill that, if the Actor is not hidden, deals 50 damage; if he IS hidden, it deals 500. (I'll balance these numbers later, right now it's just proof of concept and debugging).

What I CAN'T seem to get done is to have the Sneak Attack (or any OTHER attack) cancel the Stealth after use. Either the stealth cancels before the attack hits (negating the buffs), OR, the damage ends up becoming 0 for some silly reason (probably because of where I'm putting a.removestate(11) in the damage formula).

So, how do I remove the Stealth state from the actor just after they attack (Sneak attack or any other attack)? I could just make Stealth last 1 turn, but it's conceivable that a player might want to stay stealthed for more than 1 turn without Sneak Attacking right away (say, to heal or because they don't have enough TP for SA), so I don't wanna do that unless absolutely necessary.

I'm also avoiding plugins until I'm more comfortable with what the program can do without them (it was hell in a handbasket getting the translucency plugin to work, because the author never mentioned you needed to make it a common event to work; either that, or they were unknowingly relying on other plugins to make it plug-and-play).

I tried this video: ,
but that relies on putting a state on a single enemy instead of the player, and he's using the yanfly plugin package, which, again, I'm trying to avoid for the moment.

Thanks in advance for any tips =)

EDIT: Finally got it sorted; here's the attack formula if anyone needs a tip in the future:

a.isStateAffected(11) ? (a.removeState(11), 500): 50;
 
Last edited:

Johnny_Ray

Also known as Toby Yasha
Veteran
Joined
Sep 11, 2019
Messages
166
Reaction score
242
First Language
English
Primarily Uses
RMMZ
You could use Yanfly's skill core for more precise stuff like this rather than doing everything in that small damage box.

<Post-Damage Eval>
user.removeState(11);
</Post-Damage Eval>
 

BombchuSquad

Villager
Member
Joined
Jan 25, 2022
Messages
17
Reaction score
4
First Language
English
Primarily Uses
RMMZ
So, I'm ALMOST there with this, but figured I needed help with polish.

I've successfully implemented a Stealth mechanic in battle. The Actor becomes translucent (thanks to Mokusei Penguin), and gains a passive buff to Evasion, Critical Hit %, Attack, and a significantly lowered target rate. I set it to last for 2 turns, with the idea that it will cancel early if the actor attacks or is hit (50% chance), but more on that in a bit.

I've also made a Sneak Attack Skill that, if the Actor is not hidden, deals 50 damage; if he IS hidden, it deals 500. (I'll balance these numbers later, right now it's just proof of concept and debugging).

What I CAN'T seem to get done is to have the Sneak Attack (or any OTHER attack) cancel the Stealth after use. Either the stealth cancels before the attack hits (negating the buffs), OR, the damage ends up becoming 0 for some silly reason (probably because of where I'm putting a.removestate(11) in the damage formula).

So, how do I remove the Stealth state from the actor just after they attack (Sneak attack or any other attack)? I could just make Stealth last 1 turn, but it's conceivable that a player might want to stay stealthed for more than 1 turn without Sneak Attacking right away (say, to heal or because they don't have enough TP for SA), so I don't wanna do that unless absolutely necessary.

I'm also avoiding plugins until I'm more comfortable with what the program can do without them (it was hell in a handbasket getting the translucency plugin to work, because the author never mentioned you needed to make it a common event to work; either that, or they were unknowingly relying on other plugins to make it plug-and-play).

I tried this video: ,
but that relies on putting a state on a single enemy instead of the player, and he's using the yanfly plugin package, which, again, I'm trying to avoid for the moment.

Thanks in advance for any tips =)

EDIT: Finally got it sorted; here's the attack formula if anyone needs a tip in the future:

a.isStateAffected(11) ? (a.removeState(11), 500): 50;
Thank you for this! I've been searching for DAYS trying to find this exact same thing! It worked for me!
 

Latest Threads

Latest Profile Posts

WHEEL3.gif
Ooker spookers and fun attack mechanics! What a Friday!
Not today... Not today...
I guess I should send my CV to Hasbro. I've made Monopoly cheaters edition more fun and challenging. I've developed custom cheats and chest/chance cards for it. And I've cleared many nightmares through my cards and rules.
I'm only missing 2 more bgms for my game but maaaaan, searching for these tracks is killing me. Can't find anything good to replace MZ's Theme 2 and Scene 5 I have as placeholders. Everything is too epic or too evil or too alarming. That 'scene 5' track in particular would fit nicely with my scene. Well, at least I finally figured what my last click-fest of a gameplay element will be like, so something positive :D
Finding new interesting stuff to make for the resource calendar becomes harder every year D:

Forum statistics

Threads
124,706
Messages
1,165,394
Members
163,518
Latest member
Vestrio
Top