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
30,400
Reaction score
7,222
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
30,400
Reaction score
7,222
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
437
Reaction score
195
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

Finally did a test of sorts for the opening of my game... ... including this shot here.
My current status!?
It might be... QUAKE!!! :o
At least that was true several hours ago. :p
Quexp wrote on Shaz's profile.
I absolutely love your profile/pic! :kaoluv:
Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
I made a battle results screen for my minigame.. any feedback? :)

Forum statistics

Threads
100,686
Messages
978,418
Members
132,310
Latest member
hnhat
Top