Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Gepard on Thu 29/12/2016 12:57:52

Title: Ghost GUI? [SOLVED]
Post by: Gepard on Thu 29/12/2016 12:57:52
Hello, yesterday I've encountered something with my game. Don't know exactly what is going on. Simply put, my game has a function, that can only run when you click buttons on a certain GUI. This GUI only shows when a player clicks a button on another GUI. However, I try to click a character that is in the game and this function runs like the GUI is visible. But it isn't! It is like a ghost GUI. When I click the edge of the character, the game runs fine. It is like the GUI is there but it is invisible. I checked the script and there is no way I made this GUI appear or run this function from elsewhere. Any suggestions? Thanks!
Title: Re: Ghost GUI?
Post by: Slasher on Thu 29/12/2016 13:20:20
First off,

check that the invisible gui is positioned correctly and you could also make it clickable=false until you click the button to make it visible and back to clickable.

food for thought.
Title: Re: Ghost GUI?
Post by: Cassiebsg on Thu 29/12/2016 13:22:22
Maybe you should post the functions that use that GUI, cause ghost GUIs don't exist (unless you made it 100% transparent). Just right click over your GUI name, and select show/list all uses of the gui. That will show you every function or event that calls that gui.
Title: Re: Ghost GUI?
Post by: dayowlron on Thu 29/12/2016 14:48:24
Just an idea and not sure if this will work or not, but being a programmer for 30 years if I had a function that was being run and I didn't know where it was being called I would put a breakpoint in the function then step until it returns from the function to see what is calling it. The function may be called from a place you didn't know you were calling it from.
Title: Re: Ghost GUI?
Post by: Gepard on Thu 29/12/2016 15:46:10
Thank you! Combining all your ideas, I was able to find what was wrong. It was another GUI that is invisible and that I've forgot to make invisible. However, the interesting thing is, that there shouldn't have been any reason for this invisible GUI to run that function. Than I realized, that in the past, one of the buttons on the invisible GUI had the same name as the button that currently runs that function on the visible GUI. Thank you for helping me find this!