Image "poping up" when looking at something (Overlay? Dynamic Sprite?)

Started by Nadarian, Thu 28/05/2020 19:04:36

Previous topic - Next topic

Nadarian

Hi there!

Though I started using AGS just a few weeks ago for the first time, and my scripting knowledge was near zero at that time, I'm really happy with my first game. Something I'd love to use for my students in the "Analog Photography" subject!


Well, this said, what I'm trying to do in my game (which I really didn't know how to look for in the forums, nor what keywords to use in the subject), is that very recurrent thing of showing something really close when the player looks at an inventory item, an object, a hotspot... That is for example, looking at a book, and having it appearing fullscreen (or just partially), so you can read a page. Then right-clicking to go back to where you were. Or even putting an "Exit" or "Back" button.

I think I read something about Overlays or Dynamic Sprites that maybe could be this, but I'm really not sure about how to make this. In one case, I'd like this to happen when the player looks at something in the inventory, so it should happen no matter where he/she is.


Thanks a lot in advance!!
Teaching film photography in the 21st century.
Now, trying to do it through adventure games.

Khris

There's a bunch of options (Room, Object, Overlay), but imo the safest/easiest is to use a GUI because it will display on top of everything else. That way you can also easily add a back button. Just set the close-up sprite as background of the GUI, set the GUIs "Popup Style" to "pause game when shown" and "Visible" to false.

When the player looks at the inventory item, simply call  gCloseUp.Visible = true;  to show the GUI. Make its button set the property back to  false  and that's pretty much it.

Nadarian

Thank you, Khris!

Seems this could be the perfect solution. This has to happen in a couple or three occasions during my game and I don’t know if this will work for all of them, but I’ll try it right now.

I’ll just let you know!
Teaching film photography in the 21st century.
Now, trying to do it through adventure games.

Nadarian

Solved!  :)

In one case, I solved it with the GUI option perfectly! In another case, I just used a new room making the main character invisible to fake a zoom with many interactions in it.
There's still a third case left, I'll try to work on tomorrow. I hope I can easily do what's on my mind!


Again, thanks!
Teaching film photography in the 21st century.
Now, trying to do it through adventure games.

Crimson Wizard

Quote from: Nadarian on Fri 29/05/2020 18:11:06
In one case, I solved it with the GUI option perfectly! In another case, I just used a new room making the main character invisible to fake a zoom with many interactions in it.

Since 3.5.0 you can also use custom cameras for displaying different parts of same room over main view. For example, you may put all "close ups" on same room background, restrict main camera to only the real room area, and show "close up" areas in a smaller camera overlaying main one.

The only drawback there is that if your "real" room has to be scrolling, then you must script your own camera scrolling to prevent it from moving beyond borders.

Nadarian

Thank you Crimson Wizard!

For this occasion, I think I already solved all the issues with a GUI and a couple new rooms with an invisible main character.
But as this is my first try, I'll surely do some research about these custom cameras!
Teaching film photography in the 21st century.
Now, trying to do it through adventure games.

Cassiebsg

You know that you can turn of player character for rooms right? No need to make him invisible.  ;)
There are those who believe that life here began out there...

Nadarian

Now I do, thanks!!
Doing so, are you still able to make the main character talk and see his sentences on screen?
Teaching film photography in the 21st century.
Now, trying to do it through adventure games.

Cassiebsg

yes as far as I know it will show the text, question might be "where". But SayAt should solve the "where" if need be.
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk