Author Topic: strobe lighting  (Read 542 times)  Share 

strobe lighting
« on: 30 Sep 2012, 21:54 »
is there away to control the gamma
so it flickers the screen light a strobe light.


slasher

  • Stare deep into the darkness of your mind...
    • I can help with AGS tutoring
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: strobe lighting
« Reply #1 on: 01 Oct 2012, 05:57 »
You could import a second background or just have it set off by a region/hotspot for example and set the gamma property so that when the background animates or region walked on or hotspot interacted, the gamma changes and the effect happens.

Gamma property:
Gets/sets the current screen Gamma level. This is 100 by default, and you can set it anywhere from 0 (pitch black) to 200 (double normal brightness).

Check out Gamma property in the AGS help file.

You can stop it by setting the SetBackgroundFrame property if in the same room or returning it to normal if just one background.

This is one possible way.


Don't aim to be the best, just do your best ;)

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: strobe lighting
« Reply #2 on: 01 Oct 2012, 10:12 »
Note that changing Gamma only works if the game is run fullscreen.
You shouldn't use Gamma to make the screen flash anyway; it's not supposed to be used like that and could even ruin stuff (eyes, at least).
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

slasher

  • Stare deep into the darkness of your mind...
    • I can help with AGS tutoring
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: strobe lighting
« Reply #3 on: 01 Oct 2012, 10:47 »
I agree with Khris, strobe lighting affects certain people, as well as annoying normal eyes, so a warning MUST be given before the game starts that it contains some strobe lighting effects.

Use 2 backgrounds for the effect. One background (main) is normal and the other background (import new background) dark so it animates like a strobe. No need to use gamma settings this way.

The room will 'strobe' until you set background frame to 0.

Apart from that....
Don't aim to be the best, just do your best ;)

Crimson Wizard

  • AGS Project Admins
  • not et suppotreD
    • I can help with translating
    •  
Re: strobe lighting
« Reply #4 on: 01 Oct 2012, 12:18 »
Can't a Tint be used here?
http://www.adventuregamestudio.co.uk/wiki/?title=Region_functions_and_properties#Region.Tint

Also, I think it is possible to use Dynamic Sprites with alpha channel.

Re: strobe lighting
« Reply #5 on: 02 Oct 2012, 14:09 »
hi all thanks for the info.
yes using the gamma is a bad idea.
so im trying the room animation with 3 back grounds 0 with all open doors and sprites 1 with a solid pic with closed doors and 3 which is black.
i tryed it with just 0 and 1 as the back background.
but when i ran it the sprites was showing up.
so can you animate between 1 and 2 then set it to 0 after?


im havin trouble still tho. as i cant find in the manual info about animating room frames.


« Last Edit: 02 Oct 2012, 14:27 by duanne_boy »

slasher

  • Stare deep into the darkness of your mind...
    • I can help with AGS tutoring
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with web design
    •  
Re: strobe lighting
« Reply #6 on: 02 Oct 2012, 16:05 »
I've had the same problem with objects showing on a black background that I have solved. Not quite the same scenario but nonetheless.

You could have the objects made invisible if a certain background frame is showing.

I have not tried this but I assume it should work.

Code: Adventure Game Studio
  1. function room_RepExec()
  2. {
  3. if (background.Frame==0)
  4. {
  5. odoor.Visible=false;
  6. owindow.Visible=false;   // simply amend to your objects.
  7. }
  8. else
  9. {
  10. odoor.Visible=true;
  11. owindow.Visible=true;   // simply amend to your objects.
  12. }
  13. }
  14.  
  15.  

Adjust to suit.

Come on guys, where are you  (roll)

Don't aim to be the best, just do your best ;)

Re: strobe lighting
« Reply #7 on: 02 Oct 2012, 17:00 »
the only problem with that is if i make the sprite none visible.
the room will look like it as open doors.
that is why i made a background with it closed and one with it open and one black.

they only other way i can think of solving this problem is making a new room with the closed door pic and the black background.
have them animate and then after the animation as run go to the room where the game starts






Crimson Wizard

  • AGS Project Admins
  • not et suppotreD
    • I can help with translating
    •  
Re: strobe lighting
« Reply #8 on: 02 Oct 2012, 17:31 »
Hmm, do I understand correct that you want to make verything pitch black for a moment?
Have you considered using FadeIn/FadeOut functions:
http://www.adventuregamestudio.co.uk/wiki/?title=Screen_functions#FadeIn

May they fit your needs?

E: Oh, wait. You mean there's nothing but doors visible?
Then they probably won't be that useful....

What about a big black object in foreground with "holes" for doors?
« Last Edit: 02 Oct 2012, 17:32 by Crimson Wizard »

Re: strobe lighting
« Reply #9 on: 02 Oct 2012, 17:44 »
what im trying to do is a light effect.
so at game start the room flashes, flickers a couple a times like a fluorescent light is being turned on.

or even when a light switch is pressed on a dark room.

ive my main background with a open door.
and a object door which i make invisible when its open.

if i run the room animation with the black background the door object is visible and is not black.
if i was to make it none visible it not show the door sprite and i would get the effect.
but will then show the main background image with the door open.
which needs to be closed.
« Last Edit: 02 Oct 2012, 18:09 by duanne_boy »

Crimson Wizard

  • AGS Project Admins
  • not et suppotreD
    • I can help with translating
    •  
Re: strobe lighting
« Reply #10 on: 02 Oct 2012, 20:38 »
what im trying to do is a light effect.
so at game start the room flashes, flickers a couple a times like a fluorescent light is being turned on.

Try to put this in your "Room After Fade In" function:
Code: Adventure Game Studio
  1. FadeOut(64);
  2. Wait(10);
  3. FadeIn(64);
  4. Wait(10);
  5. FadeOut(64);
  6. Wait(10);
  7. FadeIn(64);
  8.  
Will that do similar thing to what you want?
« Last Edit: 02 Oct 2012, 20:42 by Crimson Wizard »

Re: strobe lighting
« Reply #11 on: 02 Oct 2012, 21:02 »
ive my main background with a open door.
and a object door which i make invisible when its open.
Isn't the solution then to make the background with closed doors and have objects for open doors?

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: strobe lighting
« Reply #12 on: 02 Oct 2012, 21:48 »
If you use the built-in background animation, all frames are used.
You can do:
Code: Adventure Game Studio
  1.   int delay = 3;
  2.   SetBackgroundFrame(1);
  3.   Wait(delay);
  4.   SetBackgroundFrame(2);
  5.   Wait(delay);
  6.   SetBackgroundFrame(1);
  7.   Wait(delay);
  8.   SetBackgroundFrame(2);
  9.   Wait(delay);
  10.   SetBackgroundFrame(1);
  11.   Wait(delay);
  12.   SetBackgroundFrame(2);
  13.   Wait(delay);
  14.   SetBackgroundFrame(1);
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Re: strobe lighting
« Reply #13 on: 02 Oct 2012, 23:37 »
thanks you all for the help heres the code i have now and works great :)

function room_AfterFadeIn()
{
RemoveWalkableArea(1);
AODoor.Visible = false;
int delay = 3;
  SetBackgroundFrame(1);
  Wait(delay);
  SetBackgroundFrame(2);
  Wait(delay);
  SetBackgroundFrame(1);
  Wait(delay);
  SetBackgroundFrame(2);
  Wait(delay);
  SetBackgroundFrame(1);
  Wait(delay);
  SetBackgroundFrame(2);
  Wait(delay);
  SetBackgroundFrame(1);
  Wait(delay);
  SetBackgroundFrame(0);
  AODoor.Visible = true;
}

Cheers