[SOLVED] Changing background when using "Open"

Started by tobulos1, Tue 07/04/2015 19:57:26

Previous topic - Next topic

tobulos1

Hi!
I have two (almost) identical backgrounds. One with a door closed, and one with a door open (I didn't care to make objects out of the doors).
I want the character to be able to "open" the closed door so the game switches backgrounds to the one with the open door.

Is this possible?
If so, what would be the easiest way to do it? Create a hotspot around the closed door and have the player use "Open"/"Close" on it?
I'm using the 9-Verb template, btw.

Thank you for answers!

Slasher

You would need to use

Code: ags
SetBackgroundFrame=number; // number is the background frame number (0 is the main frame number)


there would also be other factors to consider like when the room loads you would need to set background frame to display else background will animate... etc

Crimson Wizard

Quote from: slasher on Tue 07/04/2015 20:53:42
You would need to use

Code: ags
SetBackgroundFrame=number; // number is the background frame number (0 is the main frame number)


Not quite, it is
Code: ags
SetBackgroundFrame(number);
.
Notice the brackets. It is the function, not a variable.
http://www.adventuregamestudio.co.uk/wiki/Room_functions#SetBackgroundFrame
http://www.adventuregamestudio.co.uk/wiki/Scripting_tutorial_part_1#Functions_Explained

Slasher

QuoteNot quite, it is
wrote without realising the schoolboy error (roll)

thanks for correcting crimson ;)

Mandle

Quote from: slasher on Tue 07/04/2015 22:26:17
wrote without realising the schoolboy error (roll)

If only the forums had autofiller prompts for code like in AGS itself!!!

(Heeeeeeeyyyyyy...not a bad idead...) ;)

tobulos1

Ah I got it working now! Thank you guys, much appreciated as always :)

SMF spam blocked by CleanTalk