Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Fri 28/11/2003 18:40:06

Title: How to make a door that opens ??
Post by: on Fri 28/11/2003 18:40:06
Look.. Ive got a background with a door, the whole room is ready, now I need to move on to the next ( of course ), thru the door, but how can I make a door that opens ? ( Open door, door opens, so the character can get thru )

Ive already got a picture for the door that is open.

This is probably the most easy thing in whole AGS, but I am just started, and i couldnt find this in any FAQ, Tutorial.. or whatever...

Do i need to animate the background.. or...?? please do it step by step.. or give me a link to a tutorial about it...

Thanks!!
Title: Re:How to make a door that opens ??
Post by: Totoro on Fri 28/11/2003 20:56:50
Hello,
I think there are several possibilities. Until now I was too lazy to do opening doors, so I am not sure which is the most convenient, but you could make the picture of the opened door a single object, which appears at the position of the door as the result of your action opening the door. Then you can make a player-stands-on-object condition resulting in moving to the next room. Open, sesame !  ;D
Title: Re:How to make a door that opens ??
Post by: CB.. on Sat 29/11/2003 13:00:12
yu could use the picture yu have for the background the one yu have now has the door shown closed?
create a new back ground with the door shown open
import in as one of the animated frames for the background /
then in as room loads

run script

edit script then copy this into the window and save

SetBackgroundFrame(0);


this will ensure that the background is the correct one showing the closed door as yu enter the room/ frame(0) is the view shown in the editor main window)

then create a region near the door
and use the if player has inventory item  ie a key or similar (or whatever idea yu have employed for opening the door)

run script

edit script and enter this

SetBackgroundFrame(1);
NewRoom(2);


Title: Re:How to make a door that opens ??
Post by: on Sat 29/11/2003 16:46:26
thanks guys!
Title: Re:How to make a door that opens ??
Post by: Darth Mandarb on Sat 29/11/2003 23:17:32
I do it in a different, perhaps more complicated than necessary, way.

I create the door as an object and just position it where I want it.  (I create an animation for it opening and closing.)

I create a HotSpot in front of the door which, when walked on, opens the door.  That hotspot is surrounded by another hotspot that shuts the door.
(http://www.twin-design.com/random/hotspots.gif)
[color=0000aa]Hotspot 1[/color] is enabled when you enter the room.  Once you step upon that hotspot it animates the door opening, then disables itself (other wise the door would keep opening over and over) and it enables [color=00aa00]Hotspot 2[/color], which, when stepped on, animates the door closing, disables itself, and enables [color=0000aa]Hotspot 1[/color]

There is a walkable area under it all that allows you to walk off the side of the screen and the [color=00ADAD]Hotspot  3[/color]  takes you to the next room.

Like I said, it's a lot of scripting and can be confusing but it works perfectly over and over (if you walk back and forth)

Of course, this only works if the door doesn't require a button being pushed or a key being used to open it.

Hope it wasn't too confusing!

]).]v[.
Title: Re:How to make a door that opens ??
Post by: Timosity on Sun 30/11/2003 05:32:12
Yeah, DM, that's how I do it, Although you should probably use regions and not hotspots (ie player walk onto region) (although it should make no difference, that's one of the reasons regions were introduced, and stand on hotspot has a message that it is obsolete)

The other convenient thing about that is you can then have hotspots overlapping regions that give you different messages which can come in very handy in certain situations.
Title: Re:How to make a door that opens ??
Post by: Darth Mandarb on Mon 01/12/2003 18:55:48
Timosity - This is such a dumb question, but are 'regions' a newer feature in AGS?  I still use 2.53 (haven't bothered to upload download the newest version 'cause I'm not to a point yet where I actually HAVE to use AGS! (just making the graphics/story etc.)

But somebody suggested regions to me and when I went into AGS I couldn't find them ...

** DM cringes waiting for the obvious answer ** ;D
Title: Re:How to make a door that opens ??
Post by: SSH on Mon 01/12/2003 19:20:40
DM- yes, that and lots of other spiffy features. If you're doing a custom GUI at 640x400 res, then I'd wait for 2.6 to go to release, as it makes it much easier...
Title: Re:How to make a door that opens ??
Post by: Timosity on Tue 02/12/2003 04:06:18
Sorry DM, I forgot about this post, but yeah, SSH probably filled you in, I think you'll probably find Regions very handy, not only for what I mentioned but you can use them for some very handy lighting effects.

but I'm no expert in these new features, I'm not sure if these are only handy for high colour games or both, and I'm asuming a lot of your work isn't in high colour (but so fucking good, you'd think it was)

~Tim
Title: Re:How to make a door that opens ??
Post by: Darth Mandarb on Tue 02/12/2003 16:16:56
Awesome!  

Now (especially with the alpha stuff) I drool with anticipation of using the new version!

Thanks guys!

]).]v[.