Need help with making 'Thief Vision' common event.

fearjunkie

Villager
Member
Joined
Jul 20, 2014
Messages
13
Reaction score
0
First Language
English
Primarily Uses
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
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
 

fearjunkie

Villager
Member
Joined
Jul 20, 2014
Messages
13
Reaction score
0
First Language
English
Primarily Uses
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
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.
 

shockra

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
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).
 

fearjunkie

Villager
Member
Joined
Jul 20, 2014
Messages
13
Reaction score
0
First Language
English
Primarily Uses
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!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,584
Latest member
Faustus2501
Top