Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: mikesdk on Fri 12/09/2008 19:10:56

Title: Swapping room background for another if a certain condition is met [SOLVED]
Post by: mikesdk on Fri 12/09/2008 19:10:56
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
Title: Re: Swapping room background for another if a certain condition is met
Post by: Pumaman on Fri 12/09/2008 19:13:47
The command you're looking for is SetBackgroundFrame (http://www.adventuregamestudio.co.uk/manual/SetBackgroundFrame.htm). 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.
Title: Re: Swapping room background for another if a certain condition is met
Post by: mikesdk on Fri 12/09/2008 19:15:04

Wow, quick response.

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