Opacity State

Levolpehh

Veteran
Veteran
Joined
Nov 17, 2018
Messages
87
Reaction score
78
First Language
English
Primarily Uses
RMMV
Trying to make a stealth state that changes the users opacity.. can't seem to figure out how to do it. Been trying to use the <Custom Apply Effect> and <Custom Leave Effect> tags from Buffs & States core and have tried all kinds of combinations of this/user/battler/gameActor.actors(...) etc.. & .opacity/.alpha/._opacity/._alpha/.setOpacity()

...but I think I'm just misunderstanding how Yanfly's tags work tbh. I don't think this needs a plugin request thread and can be solved by finding the proper code. I can achieve this through Action Sequences but seemed silly having to attach a piece of code to every sequence to reset opacity.

If anyone could help that'd be great!
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
The relevant property is opacity, but it's on the sprite object (Sprite_Battler), not the actor/enemy (Game_Battler). By default the sprites are set up to check their battler and update themselves; the battler does not directly have access to its "own" sprite. Yanfly's Battle Engine Core adds a battler() lookup function on Game_Battler though (or you could implement your own lookup loop), in which case you could something like:
Code:
user.battler().opacity = 128;  // 50%
Not sure whether that'll be sufficient by itself (there are other factors that alter sprite opacity) but it's worth a try~! :kaojoy:

In case it helps as a reference, here's a little plugin I wrote to adjust opacity with notetags: Cae_BattlerOpacity
 

Levolpehh

Veteran
Veteran
Joined
Nov 17, 2018
Messages
87
Reaction score
78
First Language
English
Primarily Uses
RMMV
Ahh, user.battler! I never tried that one... :kaoeh:

Thank you!
 

BlueBomber000

Veteran
Veteran
Joined
Dec 23, 2018
Messages
31
Reaction score
14
First Language
English
Primarily Uses
RMMV
I just wanted to say thanks for this, caethyril. I've been agonizing over this myself for months (most decidedly NOT a dev, over here), so I appreciate it!
 

VincentValerian

Newbie User
Member
Joined
Oct 30, 2019
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Yo, I was wondering if there is a continuation of this. I've done this but I'm wanting to use skill 'stealth' out of battle and enter into battle with it still active and the character still in lower opacity
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,847
Messages
1,016,972
Members
137,561
Latest member
JaCrispy85
Top