Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Monsieur OUXX on Tue 11/02/2014 13:19:44

Title: Best practice to export a GUI?
Post by: Monsieur OUXX on Tue 11/02/2014 13:19:44
Every now and then I want to share a module that also relies on a GUI.

Problem is : the action scripts bound to that GUI (e.g. : "click on that button") are placed automatically in the global script by AGS.

Question: Are those bits of code supposed to be exported alongside the GUI, into the .guf file? I think not, but couldn't find a definitive answer.

If they don't get exported, I'll just write a little module to detect the clicks in a GUI that only relies on GetAtMouseXY and repeatedly_execute_always. This way, not one line of code gets out of the module.
Title: Re: Best practice to export a GUI?
Post by: Monsieur OUXX on Wed 12/02/2014 09:13:28
Could I just have a confirmation that exporting a GUI is not meant to also export the bound code in the global script?
Title: Re: Best practice to export a GUI?
Post by: Ghost on Wed 12/02/2014 09:55:01
I did export GUIs every now and then since back in 2.72 days. The code always was exported too, and when importing, placed in GlobalScript. Hope that helps :-\
Title: Re: Best practice to export a GUI?
Post by: Monsieur OUXX on Wed 12/02/2014 17:09:44
Quote from: Ghost on Wed 12/02/2014 09:55:01
I did export GUIs every now and then since back in 2.72 days. The code always was exported too, and when importing, placed in GlobalScript. Hope that helps :-\

Well that's weird, I did the test myself, and the code didn't travel. And I'm probably not the only one, because in some modules/GUIs I've seen readme's like : "if the buttons don't work, then add this to your global script..."

Crimson Wizard? What is this wizardry?
Title: Re: Best practice to export a GUI?
Post by: Crimson Wizard on Wed 12/02/2014 17:39:54
Quote from: Monsieur OUXX on Wed 12/02/2014 17:09:44
Crimson Wizard? What is this wizardry?
Lol, why me? I know nothing about gui export stuff :tongue:.
You all have more experience using AGS actually.

Well, I can tell that AGS exports: GUI properties, All sprites used on gui (literally... binary data in XML (wtf)), and also all 256 palette entries, regardless of game colour depth. BTW the latter may take more space than all the rest summed up (if the gui background sprite is lo-res).
I don't see if any trace of script being exported anywhere.
Title: Re: Best practice to export a GUI?
Post by: Monsieur OUXX on Wed 12/02/2014 19:35:12
Maybe that got removed with 3.x and never re-introduced afterwards?
Title: Re: Best practice to export a GUI?
Post by: Ghost on Wed 12/02/2014 19:40:42
That is possible. I definitely had code travelling in 2.x, I remember that.