Using frames to switch between backgrounds.

Started by ian80, Sat 24/01/2004 04:24:12

Previous topic - Next topic

ian80

Hi,

I have a light switch that causes the background to change  BMP. Now, I think I have it scripted right, but it is screwing up because the frames are animated. How do I turn background animation off?

LordHart

I'm pretty sure you can't, seeing as each frame is one part of the backgrounds animation (or maybe CJ changed it recently?).

I would suggest having the animated parts of the background as objects.

ian80

Ok, maybe I should ask diferently:

What is the best way to change the room's background image mid-game?

Darth Mandarb

Put in the 'Before Fadein' actions a Run Script command and do this:

SetBackgroundFrame=(x); // x being whatever frame you want.

This'll lock in the background frame you want and stop the animating.

Then, when the light switch is thrown, just SetBackgroundFrame=(y); in the script for that event.

:: From the Help File ::

SetBackgroundFrame

Locks the background to frame number FRAME of an animating-background screen. (Values for FRAME are from 0 to 4). This allows you to use the animating backgrounds feature for another purpose - you can have two frames of the background, one for example with a spaceship crashed on it. Then, once the right event has happened, call SetBackgroundFrame in the Player Enters Screen event to set the background before the screen fades in.

Call SetBackgroundFrame(-1) to set the default animating frames.

hope that helps!

])]v[

ian80

Thanks Darth.

However, when I do that, I get this message:

variable required on left of assignment.

What does that mean?

Darth Mandarb

Is it giving you that error when you enter the room?  Or when you try to switch the light?  At which point are you getting that error?  Can you post your Script?

Steps:
* select the room interactions (CTRL-I)
* select 'Player Enters Screen (before fadein)'
* choose 'Run Script', in the script type in: SetBackgroundFrame(1); (or whatever frame you want!)
* hit ALT-F-X (save and exit)

That should do what you want.  How are you triggering the effect?  That would help too ;)

])]V[

ian80


SMF spam blocked by CleanTalk