copying a room[SOLVED]

Started by lafouine88, Thu 14/05/2020 14:30:11

Previous topic - Next topic

lafouine88

Hi guys

Once again, it sounds like a stupid easy question but I guess it's not so obvious since I haven't found anything about it : How to copy a room ?
The game I'm working on mixes different times of the day, so the background will change to look like night and day. But the hotspots,walkbehinds, objets etc. remain the same.

I'm pretty sure I need to create a room for each part of the day, but could I copy the one I fully edited and just change the background so that I don't have to do everything again ?

Thanks a lot :)

Khris

Changing a room's background is already built in, just add a second background image in the editor.
In the room's before fadein event, use
Code: ags
  SetBackgroundFrame(0);

to prevent AGS from animating the background. To switch, just call the command again, passing 1 for the 2nd frame, etc.

Btw, you can copy a room, just close the game and duplicate the *.crm file in the main game folder, giving it a different index.

Crimson Wizard

#2
You can have up to 5 backgrounds in a room and switch between them during the game. To import more backgrounds - dropdown the backgrounds list where it sais "Main background" and click "Import new background".
I think you may also set BackgroundAnimationDelay property to 0 in the room to prevent them switching on their own.
Call SetBackgroundFrame(X) in script to change background when in room.

Quote from: Khris on Thu 14/05/2020 14:50:50
Btw, you can copy a room, just close the game and duplicate the *.crm file in the main game folder, giving it a different index.

Note, you import existing room by right clicking on Rooms and choosing "Import existing room".

lafouine88

Oh yeah right. I thought this was just for animating the background but it makes sense^^
Thanks a lot for the complete and quick answer :)

SMF spam blocked by CleanTalk