Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: mouldy on Mon 07/08/2006 09:38:26

Title: open and close objects
Post by: mouldy on Mon 07/08/2006 09:38:26
To make objects like doors and cubboards open and close do you just make a open sprite and a close one then put it in a view, then when the player interacts with it you make them walk to it then get it to play view?  ::)
Title: Re: open and close objects
Post by: Ashen on Mon 07/08/2006 12:14:04
I'm not sure, but I think you answered your own question...
If you want to animate something opening (doors, draws, a giant scary eyeball in the ceiling) then yes, you assign the sprites to a view then use Object.Animate (http://www.adventuregamestudio.co.uk/manual/Object.Animate.htm). However, if you only have two sprites (fully closed, fully open) you might as well use Object.Graphic (http://www.adventuregamestudio.co.uk/manual/Object.Graphic.htm) to change it directly, and save the loop for something else (not that the view/loop limit is that low, but if you've got a lot of 'background' animations like this, they can add up).
Title: Re: open and close objects
Post by: Dan_N on Mon 07/08/2006 15:23:37
Yeah, it's that simple.

Or do you want to make a GUI for open/close objects (doors, drawers, cupboards etc.)?
Title: Re: open and close objects
Post by: mouldy on Tue 08/08/2006 09:31:14
Oh okay didn't know it was that simple why how can you make it do it from a GUI?  :o
Title: Re: open and close objects
Post by: mouldy on Wed 09/08/2006 09:25:25
Okay I try to do that but when I put the door in the room it's huge any info on how to get it exact size as wall?
Title: Re: open and close objects
Post by: Dan_N on Wed 09/08/2006 12:08:16
Copy the portion of the room background where your door should be, paste it into a new file, then draw the door over it and then import it into AGS. Simple, really, I can't believe you couldn't do that.

(P.S.: no offense, but i could hardly understand what you said in your last post, if you get my drift...)
Title: Re: open and close objects
Post by: Ishmael on Wed 09/08/2006 12:36:00
If you have a program that supports layers, such as Photoshop or Paint Shop Pro you can draw your objects on a new layer over the background, then just copy it from that layer to a new file and resize the canvas in that new file down to meet the size of the object, if neccesary.

And doing stuff like opening doors with a GUI would work for a very small game, but in a bigger one the GUIs would just clutter up, so using objects is a better idea in my opinion.
Title: Re: open and close objects
Post by: mouldy on Thu 10/08/2006 09:15:54
Ah I get you now thanks for the help  :D