import/export GUI so the code is retained.

Started by skuttleman, Sat 14/06/2008 21:33:56

Previous topic - Next topic

skuttleman

Is thre a way to export a GUI so that I can import it and it will retain the global script code associated with it? (on_click etc.)

If so, how? If no, why?

Ubel

When you export and import a GUI it should automatically contain all the scripts and graphics associated with it. If it doesn't then something's wrong or I'm missing something.

skuttleman

Quote from: Pablo on Sat 14/06/2008 22:48:18
When you export and import a GUI it should automatically contain all the scripts and graphics associated with it. If it doesn't then something's wrong or I'm missing something.

When I do it. It retains the graphics, not the scripts.

GarageGothic

Yeah, I was pretty sure it saved the scripts too - otherwise what would be the point? But I just tried it out, and skuttleman is right, the linked scripts are not imported. Could this be a bug in the new AGS versions?

Pumaman

Sounds like a reasonable request for a future version, if others would find it useful?

GarageGothic

#5
It would definitely be useful. But perhaps a cleaner way would be if you could link a GUI to a module, so you can access its scripts without importing them in the module header first (GUI scipts rarely need to be accessed from anywhere else than the referring GUI item)? If you just want to test out a couple of custom GUIs for your game it could be a pain to find and remove all the scripts in the global script once you remove it. I'm myself modulizing pretty much all my code now, because the global script was getting to be a mess.

For instance, if my lightmap module has two debug GUIs, I could link them both to the LightMap module script (by specifying its name in the GUI properties). The GUI events would then refer to functions in the module script instead of the global script. In case a developer exports a GUI containing references to the global script, these could then be automatically compiled to a module with the same name as the GUI and distributed alongside it.

monkey0506

I was fairly certain the code has always been retained... :o

Although actually I quite like GG's suggestion there.

Lt. Smash

#7
I also think that codes for guis should be seperated.
Room events (also hotspot, object events) could also be rearanged everytime I add a new event.
F.e.
You have:
Code: ags

function room_RepExec()
{

}

function hHotspot1_Look()
{

}


and now you add room_FirstLoad()
Oh you remember you want to add a Hotspot_Interaction.
after some time it will look like this:
Code: ags

function room_RepExec()
{

}

function room_FirstLoad()
{

}

function hHotspot1_Look()
{

}

function hHotspot1_Interact()
{

}

function room_Load()
{

}

function room_AfterFadeIn()
{

}

function objObject_Look()
{

}

function objObject_UseInv()
{

}

now wouldn't it be nice to have:
Code: ags

#sectionstart ROOM
function room_AfterFadeIn()
{

}

function room_Load()
{

}

function room_FirstLoad()
{

}

function room_RepExec()
{

}
#sectionend ROOM

#sectionstart HOTSPOT1
function hHotspot1_Look()
{

}

function hHotspot1_Interact()
{

}
#sectionend HOTSPOT1

#sectionstart OBJECT
function objObject_Look()
{

}

function objObject_UseInv()
{

}
#sectionend OBJECT

updating and rearranging automatically if you add a new event.

SMF spam blocked by CleanTalk