Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: GameMaker_95 on Sun 25/10/2015 08:20:00

Title: Animate a Dumpster: Opening, Searching, Closing.
Post by: GameMaker_95 on Sun 25/10/2015 08:20:00
Hi,

I have a dumpster that I need to search to obtain a backstage pass. I want to be able to click on it to open it, click to search (get the pass), click to close.

Then every other time I open it to search, it says there is nothing else of interest. What would the best way to animate it be (I have all the frames of it) and what script would I need to do this. keep in mind I'm not a noob but I'm close to one.

Thanks in advance.

Title: Re: Animate a dumpster. Opening, searching, closing.
Post by: Kumpel on Sun 25/10/2015 13:23:13
Hey,

I'd suggest you do the dumpster and trash as one hotspot. over that you put your cover as an object assigned with the view of open/closed. this objects gets a interact-with-function that changes the frame of the cover. The hotspot of dumpsterbox and trash gets a normal interact-with-function which triggers the animation of your guy searching it. Also add an int var to count the second (third, fourth...) time. Then if player interacts more then one time the character says his line.

Hope that helps :)

Cheers
Kumpel

Title: Re: Animate a dumpster. Opening, searching, closing.
Post by: GameMaker_95 on Sun 25/10/2015 23:59:39
Hi Kumpel,

I'll give that a try today and see how I go. I'll let you know if I run into a problem.

Thanks.
Title: Re: Animate a dumpster. Opening, searching, closing.
Post by: selmiak on Mon 26/10/2015 00:11:47
who throws a precious backstage pass into a dumpster???
Title: Re: Animate a dumpster. Opening, searching, closing.
Post by: GameMaker_95 on Mon 26/10/2015 00:19:27
Haha, maybe it was a last minute gift? It's actually not a backstage pass but that's the best I could describe it.
Title: Re: Animate a Dumpster: Opening, Searching, Closing.
Post by: GameMaker_95 on Mon 26/10/2015 04:39:01
Hey Kumpel,

I tried doing what you said but I ran into a problem with the position of the sprites after they change so I had to make them
two separate objects but I did make the dumpster a hotspot and now it works fine because it's a completely different interaction.

Thanks again.
Title: Re: Animate a Dumpster: Opening, Searching, Closing.
Post by: Kumpel on Tue 27/10/2015 02:49:00
I think the problem is, that you positioned the sprite for the second frame different from the first one.

But two objects works too. It's just not that elegantly short in script as changing the frame number. :=

I would like to see the scene of yours! Could you do a video or gif of this game situation? :)
Title: Re: Animate a Dumpster: Opening, Searching, Closing.
Post by: GameMaker_95 on Tue 27/10/2015 03:22:19
Do you mean of the character searching the dumpster? Currently I'm just using a placeholder sprite I edited and
A background I'll probably update just to complete the game before I go back and finish everything. If you want to see the background
though, let me know. :smiley:
Title: Re: Animate a Dumpster: Opening, Searching, Closing.
Post by: Kumpel on Tue 27/10/2015 14:49:35
Sure. Post it here or send me a link if you want!