Is there a way to turn on and off backgrounds within a room. I have one with a light on and windows darkened and then 3 with the light off and the stars sparkling. Is there a way to have the light one going and then turn it off and turn on the other three?
So you want a backgroundanimation with 3 frames of sparkling stars and the possibility to switch the light on and end the animation / having another background frame, right?
I can think of two solutions:
1. You don't use the background animation and set the background frames manually, using a timer variable and SetBackgroundFrame. So, for example, you cycle through the first three background frames and when the light is turned on, you switch to the 4th frame manually.
2. You make the stars and object. This should be no problem, since it seems they just shown through a window. Then normally the window object is animated, showing the sparkling stars. When the light is on, you simply change the view of the object.
The first one sounds like it could work although I'm not sure how I would do it. To be more clear though. The main character walks in looks out the window, then snaps his fingers and the lights are off. The lighting is coming from a single lamp so it is very apparent when it is on or off, and when the light is off I have the blueish tint of it being nighttime. So I really need to have the first background be the only one showing for a while then have it cycle between the other three. I'll see if I can figure it out.
Okay, then something like this should work:
bool clap=false;
int change=0, bframe=0;
// in the look at window event:
player.animate(bla) // player claps his hands
clap=true;
SetBackgroundFrame(1);
// in the rep-ex:
if (clap){
if (change==40){ // change frame every second
if (bframe<3) bframe++;
else bframe=1;
change=0;
SetBackgroundFrame(bframe);
}
else change++;
}
Whoa, I can't really concentrate right now, I hope it works..
Alright, I think that I've got it figured out.