Swapping room background for another if a certain condition is met [SOLVED]

Started by mikesdk, Fri 12/09/2008 19:10:56

Previous topic - Next topic

mikesdk

Hi there,

I've been lurking the forums for a while as well as trying to get a handle of this beast called AGS. I've run into a problem:

I'm trying to change the background of a room (lit to unlit version) if the player picks up a specific item in there. I tried setting up an alternate background, but there doesn't seem to be any way to halt the animation loop between the two, which unfortunately produces the undesirable result of the backgrounds swapping regardless whether the player has picked up the item or not.

My question is this:

Is there any way that I can change the background via the scripting language, for example by putting it in the function for manipulating the object, or am I stuck with making a completely new room and "teleporting" the player there once he picks the item up?

Thanks,

Mike

Pumaman

The command you're looking for is SetBackgroundFrame. Call it once in the Player Enters Room event to fix it to the first frame, and then call it again when they pick up the item to change to the unlit version.

mikesdk


Wow, quick response.

Thanks a bunch, I'll give that a try right away :)

SMF spam blocked by CleanTalk