Invisibility Code(Answered)

Hello. First time user of RPG maker here.
I wanted to make a script for my game where, when the plyaer has the Invisibility status, the game makes them transparent, which then turns off when they lose that status. The problem is I can't quite find a way to do so, as the event either just keeps them transparent forever, or just freezes them when I try to loop it. Any suggesstions?
oooo this is lot easier then you think : )

first make a status effect : ) and in the status effect make it 100% then dont do anything : )
go to common events and make a check to see if status effect is on player : )
under
IF status is on player
change actor to transparency lets make it 10% = that makes the actor 10% visible
under Else
make it so player is normal transparency if no invisible status is applied to player

have it set to auto run then a switch lets call the switch invisibility ON
NOW at first of your game : )

make an event and have the switch called invisibility ON
then exit or erase event after that
then place a self variable lets call it A
second page turn the variable A to on

This will allow no mater the map your on to auto check to see if you got the status on then it will auto change your character : )

let me know if this works for you : )
Have your invisibility triggered by a switch then do something like this
oooo this is lot easier then you think : )

first make a status effect : ) and in the status effect make it 100% then dont do anything : )
go to common events and make a check to see if status effect is on player : )
under
IF status is on player
change actor to transparency lets make it 10% = that makes the actor 10% visible
under Else
make it so player is normal transparency if no invisible status is applied to player

have it set to auto run then a switch lets call the switch invisibility ON
NOW at first of your game : )

make an event and have the switch called invisibility ON
then exit or erase event after that
then place a self variable lets call it A
second page turn the variable A to on

This will allow no mater the map your on to auto check to see if you got the status on then it will auto change your character : )

let me know if this works for you : )
I believe I actually managed to figure it out by myself like, 10 minutes after making this post lol.
BUT: I don't know how I can set invisibility to a certain percentage, it only gives me on or off for transparency. Where exactly would I set a specific level of transparency?
I believe I actually managed to figure it out by myself like, 10 minutes after making this post lol.
BUT: I don't know how I can set invisibility to a certain percentage, it only gives me on or off for transparency. Where exactly would I set a specific level of transparency?
Set Movement Route>Change Opacity
Set Movement Route>Change Opacity
Okay so two things:
1) I tried the code you posted, but it didn't quite work, as it removes the transparency when you are transferred, and I want it to be based on the status and not a timer.
That being said, whenever I try to use Change Opacity in the movement route section, it freezes the character, making them unable to move.
For reference, this is the code I have running now. It works fine, the only problem is of course being full transparent.
Ok, try this, but it's not clear how you're setting or removing the invisible state
That being said, whenever I try to use Change Opacity in the movement route section, it freezes the character, making them unable to move.
You need to provide screenshots of what you're doing that doesn't work, or we can't see what's wrong.

However, your functioning event is a bit odd - why on Earth is there a loop?

You need to not crop out other important information - what kind of event is it, how is it activated?

In addition to getting this situation figured out, you may want to revisit/look up some eventing tutorials, these forums and YouTube have plenty to choose from.
However, your functioning event is a bit odd - why on Earth is there a loop?
I put it in my example so it would set transparency and start a countdown timer. Without the loop the timer will keep resetting. The OP just edited my code without understanding it.
I put it in my example so it would set transparency and start a countdown timer. Without the loop the timer will keep resetting. The OP just edited my code without understanding it.
I realize that - I asked the question of the OP to make them think about what it was doing and what its purpose was 😛
You need to provide screenshots of what you're doing that doesn't work, or we can't see what's wrong.

However, your functioning event is a bit odd - why on Earth is there a loop?

You need to not crop out other important information - what kind of event is it, how is it activated?

In addition to getting this situation figured out, you may want to revisit/look up some eventing tutorials, these forums and YouTube have plenty to choose from.
My apologies
For some additional information: the code as is seems to work fine. Again, I just can't set a specific level of opacity on it, only set it from transparent to not.

As for activation: currently I just have a test event that sets the invisible status and switches the trigger switch on. In the future I plan to have items/skills that will do the same, such as an Invisbility potion or spell. They will work exactly like the test event basically.

I'll try Aqua's updated code as well and see if that works, thank you though.
And ya I was planning on finding some tutoriels and whatnot anyways. Like I said I am brand new so any reccomendations on channels or specific videos I should watch would be appreciated.
Ok, try this, but it's not clear how you're setting or removing the invisible state
Just tested the code out, works like a charm. Only thing I had to do was set a second opacity change after the loop, as it didn't seem to change back before once activated. Once I did it worked perfectly though. Thank you very much for your help.
Just tested the code out, works like a charm. Only thing I had to do was set a second opacity change after the loop, as it didn't seem to change back before once activated. Once I did it worked perfectly though. Thank you very much for your help.
The opacity won't change back on its own without an external event removing the invisible state, and you didn't want a timer to autoremove it, which why I said it was unclear how you're setting or removing the invisible state.
The opacity won't change back on its own without an external event removing the invisible state, and you didn't want a timer to autoremove it, which why I said it was unclear how you're setting or removing the invisible state.
Right ya my apologies; the invisible state is set to remove itself after 100 steps. I should have specified that earlier.

Original thread: https://forums.rpgmakerweb.com/threads/invisibility-code-answered.161122/