I want to implement a mechanic that lets the player hit a key that causes the screen to turn sepia and makes hidden objects visible, kinda like Eagle Vision in Assassin's Creed or Detective Vision in the Arkham Asylum games. I've got Yanfly's Button Common Events installed, so when the player hits the 'T' key, this common event runs:
Text:
: Thief Vision activated
Control Switches: #0002 ThiefVisionActive = ON
Tint Screen : (34,-34,-68,170), 300 frames
Control Switches: #0002 ThiefVisionActive = OFF
Tint Screen : (0,0,0,0), 300 frames
I then set up a couple of events to test the hidden object reveal: 3 events, all the same. The first event page is totally blank with no sprite, and the second event page is activated while the ThiefVisionActive switch is on, with a barrel for the sprite. However, when I press 'T', almost nothing happens- no screen tinting, no barrels getting revealed. But I do get the 'Thief Vision activated' text box, so I'm 100% certain that the common event is running.
What am I doing wrong here?
Need help with making 'Thief Vision' common event.
● ARCHIVED · READ-ONLY
-
-
Show us Screenshots of your event.
Most likely you forgot the correct Waits - if you really made those commands, it'll take the engine six seconds to complete the tint commands with very small changes over the 600 frames -
I deliberately didn't put in Waits for the tint, as I want the player to be able to move around while Thief Vision is active. Gimme a couple minutes for screenshots.Show us Screenshots of your event.
Most likely you forgot the correct Waits - if you really made those commands, it'll take the engine six seconds to complete the tint commands with very small changes over the 600 frames -
Waits do not automatically stop player movement - they only do that if placed in an autorun.
In fact if a parallel process is used, Waits are required to help with player movement.
But that's why I asked for Screenshots - your description was missing too much info. -
I think the problem is that there is no check for if Thief Vision is on or off. The code seen above turns it on, then back off before a change is even visible. I would try something like this:
if (2nd Switch is OFF)
Control Switches: #0002 ThiefVisionActive = ON
Tint Screen : (34,-34,-68,170), 300 frames
Text:
: Thief Vision activated
else
Control Switches: #0002 ThiefVisionActive = OFF
Tint Screen : (0,0,0,0), 300 frames
Text:
: Thief Vision deactivated
That way, running the common event checks if Thief Vision is active, then runs the code to turn it on (or off, if it's already on). -
I think the problem is that there is no check for if Thief Vision is on or off. The code seen above turns it on, then back off before a change is even visible. I would try something like this:
if (2nd Switch is OFF)
Control Switches: #0002 ThiefVisionActive = ON
Tint Screen : (34,-34,-68,170), 300 frames
Text:
: Thief Vision activated
else
Control Switches: #0002 ThiefVisionActive = OFF
Tint Screen : (0,0,0,0), 300 frames
Text:
: Thief Vision deactivated
That way, running the common event checks if Thief Vision is active, then runs the code to turn it on (or off, if it's already on).
Works like a charm! Thanks!