I'm thinking of making my own extension and i wanted to know what the difference between LIB & GEX were - under which situation is one preferable to the other? Both are composed of GML scripts right?
Edited by iam1me, 11 February 2012 - 06:45 AM.
Posted 11 February 2012 - 06:45 AM
Edited by iam1me, 11 February 2012 - 06:45 AM.
Posted 11 February 2012 - 08:15 AM
LIB = Collection of actions (usually scripts) that are treated as Drag-and-Drop blocks.I'm thinking of making my own extension and i wanted to know what the difference between LIB & GEX were - under which situation is one preferable to the other? Both are composed of GML scripts right?
Posted 11 February 2012 - 05:58 PM
LIB = Collection of actions (usually scripts) that are treated as Drag-and-Drop blocks.
I'm thinking of making my own extension and i wanted to know what the difference between LIB & GEX were - under which situation is one preferable to the other? Both are composed of GML scripts right?
GEX = Collection of LIBS, DLLs, and pure GML scripts.
Make a LIB if you are making a drag-and-drop thing. Gift the noobs with your code, but know that many users will ignore it because they can't use it in GML.
Make a GEX if you want to provide GML functions with hidden code or automatically-initialized DLLs.
If nothing else, the difference will become clear once you open the editors.
Anyway, (I think) I've answered that. I have a question for the people who use this forum:
DLL, GEX, or both?
Posted 12 February 2012 - 04:03 AM
Posted 12 February 2012 - 05:27 AM
I myself prefer a GEX.
1. For dlls, it auto-inits them once you are using them, instead of having to call scripts defining the functions and arguments(though they still have to be defined in the extension creator). It also includes the dll in the package, and so you don't have to separately put it into the game's folder, rather it gets extracted along with the game's resources.
2. Another good reason is that you can make scripts that "acompany" the dll. For example, in my kbzip extension, the dll itself only contains the simple extract, archiving functions. But the gex also contains gml that loads in sprites and backgrounds, utilizing the dll functions in the process. So in one function call, the gml side calls the dll side to extract a given file, then the gml loads the file as an external resource, then it deletes the file(using gml). To do this kind of thing distributing a dll, I would have to provide separate scripts for that functionality, or the user would have to come up with them.
3. It allows you to create "script containers." For example, my kbinput3 extension is a bunch of gml scripts, and nothing else. It simply extends on GM's input system, allowing the game player to choose his/her controls, and your games input response to rely on a single function, not caring about whether the player is using a keyboard, joystick, or both. Instead of loading this up as a group of scripts in the game maker resource tree, I have it all in an extension, and the scripts are all available.
4. It allows for d&d actions(like libs) along with all of the other things, all at once. I've never actually done this because most of my extension simply would get too complicated for d&d usage and are actually easier to use with gml code, but for some extensions, this would make sense.
5. Another good reason is that all the scripts/functions, whether they are gml coded or dll functions, or even gml code that ends up calling dll functions, all can appear on the autocomplete box, and in the status bar(showing the arguments). This can help a lot when you are actually coding things.
6. The last reason that comes to mind is the fact that all of these things come in a single package, even the help file(if you so desire). You have only a single file to distribute, and it includes any number of these things.
Posted 12 February 2012 - 06:24 AM
Posted 12 February 2012 - 06:40 AM
Posted 12 February 2012 - 03:39 PM
Question: What does D&D stand for? I've only ever used GML (I avoid doing things via the interface).
I think I will go ahead and do as you suggest - provide it as a GEX and also provide the source code in a separate gm81 file. The autocomplete/help line features will be very useful!
I've got another question for you to. Are there currently any popular GUI API extensions? I've searched the forum but there doesn't seem to be much save little pieces here and there. I ask because that's what mine is - a GUI Application Programmers Interface. Rather than just provide a couple nice objects like buttons and such (which it will have) - it provides a whole new coding interface for designing complex GUIs with ease. It will also, itself, be extensible. Sound like something you might use for your projects?
Posted 12 February 2012 - 05:43 PM
d&d is for Drag & Drop, the little boxes that do things in the event editor. LIBs create those boxes instead of creating gml functions, so in your case, since you tend to use gml for everything, a LIB isn't really useful.
Before you dive too deep into your project, I would take a look at what is out there. A lot of the time, it has been done, and done dead. Take a look at Game Widgets by B&B Gaming for example. It is all gml and it doesn't come as a gex, rather as a bunch of scripts. The reason it was left like that is because a GUI isn't something you can just GEX up very easily while allowing massive customization, though with some work it could be done. You'll also notice that though the script names show in the autocomplete, you get no help with arguments on the help line. On the other hand, there are a TON of scripts there, and so it would be quite an undertaking to convert it all into a GEX.
The GUI extension you describe could be useful, but for me, I would need easy methods to customize it, have things move around if need be(for pretty menus) and so I tend to prefer to simply create what I need for a single project, reusing code where possible. But it could be useful.
Edited by iam1me, 12 February 2012 - 05:50 PM.
Posted 12 February 2012 - 07:08 PM
Posted 12 February 2012 - 08:09 PM
OK, I'll watch for your GUI stuff...
Yes, you can easily have functions be hidden from the autocomplete and help line. In the extension creator, where you add functions(either dll or gml functions) there is a check box that says hidden. Then, the function is not visible. It can still be called from the other extension functions, and I think it can still be called by the user, but they would have to know the exact function name and arguments to use it properly.
0 members, 0 guests, 0 anonymous users