Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Enchart on Thu 25/06/2015 15:07:38

Title: Question about darkening the room
Post by: Enchart on Thu 25/06/2015 15:07:38
I've been expecting some problems when I reach this point. Shortly put:

I have a room with EMP guardian in the middle of the room (It's animated with multiple backround images). Soon as the player character reaches middle of the room he is hit by EMP and looses his sight (cyber eyes). At this point I wanted to make screen black while character is visible.

I haven't find a way to blacken the screen 'cause I'm using animated backround.

So is there a way either to reserve one of the 5 backround images for darkening the room without hurting the room animation

OR

to use cutscene room and make the character appear to same coordinates where he was hit by AMP?
Title: Re: Question about darkening the room
Post by: Slasher on Thu 25/06/2015 15:35:41
yes, you could do it by cutscene in another room but it could depend on what is supposed to happen in that dark room...and does he go back?
Title: Re: Question about darkening the room
Post by: Enchart on Thu 25/06/2015 15:49:16
Quote from: slasher on Thu 25/06/2015 15:35:41
yes, you could do it by cutscene in another room but it could depend on what is supposed to happen in that dark room...and does he go back?

When he not in proximity EMP guardian and some time have passed he should return to the original screen. Still the problem remains: how can I make character to change room and keep his coordinates?
Title: Re: Question about darkening the room
Post by: Slasher on Thu 25/06/2015 16:19:57
just change room:

Code (ags) Select

SetNextScreenTransition(eTransitionInstant); // if you do not want any fade between the rooms.

CharName.ChangeRoom(1);// example. will keep x y from room 2 when you go back to room 1.


Title: Re: Question about darkening the room
Post by: Crimson Wizard on Thu 25/06/2015 16:31:18
Simply use the room-sized object made of a big black sprite (initially not visible).
Adjust its baseline so that it covers everything (set it to bottom of the room).
Then make object visible.
Then adjust player's baseline property to higher value, making it appear above object.

When EMP cutscene is over, do reverse adjustments.

This way you could even emulate EMP effect "appearance" by gradually changing object's Transparency.

NOTE: If you do this in the editor, the object will cover whole screen, making it hard to edit this room further (unfortunately, AGS cannot hide particular objects during design time).
To solve this problem, assign any dummy sprite to this object at design time, and change it to big black sprite at runtime in script.
Title: Re: Question about darkening the room
Post by: Slasher on Thu 25/06/2015 16:38:09
Crimson
QuoteSimply use the room-sized object made of a big black sprite.

that would be a simpler way ;)
Title: Re: Question about darkening the room
Post by: Enchart on Thu 25/06/2015 17:57:34
Thank you to both of you. :)

I'm going to succeed with these instructions