Ulysses
General => Off-Topic => Topic started by: krooks on December 14, 2012, 03:36:56 PM
-
About me, I'm extremely right brained: a ton of ideas, always! Hard to manifest them in the code world.
I understand CSS/HTML, and limp through PHP/JavaScript, but can still produce nice things.
I know how code works for the most part, I understand functions and things like that, but I don't ever remember syntax or don't know where to find the right hooks etc. I basically see the big picture and hack away until it works, it may not look pretty, but I have gotten a lot of visually pleasing results over the years (front end)!
What exactly is the advantage to designing a plugin for ULX/ Ulib, rather than just working on something stand alone?
Is Ulib a library for lua, like jquery is to JavaScript? Could designing for ULX/ Ulib be called any easier?
-
ULib is indeed a library for lua, and in this case, Gmod, yes, like jquery is to Javascript.
It includes lots of tools for Gmod that just weren't included in Gmod or lua to begin with.
Later revisions were actually designed to carry across multiple lua games.
Before Megiddo had to invest in "real" life, he even planned on a 'ULX' equivalent for another steam game that uses lua (that for life of me can't remember it's name at the moment).
I think the site/domain and project were pretty much put on hold once he got buried in school.
ULib or ULX vs stand-alone;
Standalone
- not everyone uses ULib. Some dislike ULX so much, they think if your mod requires ULib, it means ULX (It doesn't) and therefore might not try your code.
- Self Dependency - you learn to code without cheating relying on nice already well tested code.
ULib;
- Library - When coding, I just kept finding features in it that helped keep me from re-inventing the wheel. I can't count how many times I asked myself 'ok, i want this, how do I do it in lua. Oh look, 10 lines of code can do it. Wait...darn...ULib has a function that does it in 2.
- Compatibility - We DO override some Gmod functions, but, we allow priorities in chain. Have a hook you don't want to be broken by other badly coded hooks? Features in ULib allow you to set a priority. Other code (normally) will run as whatever default. Set a certain parameter, yours can always run first. (This doesn't guarantee hooks won't break, but..can help)
(Hook = Gmod functions that look for game events in Gmod and can be used to run your code for the event)
Overall, I've always found using ULib library easier than straight figuring out (or coding if I already knew) how to do something raw in lua.
BUT...I started with coding my own stuff in Lua before I stumbled across ULib and the wonderful original team surrounding it. (Spbogie....where are you?!??)
I'm not sure my skill would be at the level it is now if I'd started out in ULib to begin with. It really did help me stop re-inventing the wheel when using stuff.
-
JamminR's right, ULib tries to simplify things for you as the developer. Some people use it and love it, some people prefer to do it from scratch either because they don't trust us to maintain compatibility or just because they enjoy the challenge of going bare-bones. There's really no "right" or "wrong" way to do it, just like anything else in the programming world.
The other game's name is Natural Selection 2, JamminR. Someday it would be great to get back to it! I actually had someone ask me recently about the SQL/flatfile abstraction I created (http://nayruden.com/?p=117), which made me want to continue working on it. :P
-
Awesome thanks for the detailed replies.
Being the way that I am, someone who struggles a bit through this sort of thing, I'd rather use a library. I'm more interested in the result than the experience. I don't plan to sell my work etc, I just want to be able to make small changes here and there, so it sounds right up my ally.
Also, if I created something nice enough to give out to the community, I'd rather the traffic come here than say FP.
Besides the doc's here, are there other places you recommend I go to find answers to my questions before asking extremely noob questions? I'm thinking something like a wiki or other documentation?
-
The developers corner forum section has lots of pinned posts at the top, that contain links to our and other sites.
We've nothing against noob questions if the 'noob' at least tries to find answers first, and then phrases the question intelligibly.
As you know, 'it doesn't work' isn't a favorite topic post here.
:)
-
The developers corner forum section has lots of pinned posts at the top, that contain links to our and other sites.
We've nothing against noob questions if the 'noob' at least tries to find answers first, and then phrases the question intelligibly.
As you know, 'it doesn't work' isn't a favorite topic post here.
:)
haha for sure, well cool. I'm excited to get started on this, we'll see how it works out given my spare time etc. ;D
# EDIT #
My first question, what is going to be the best way for me to edit server-side lua?
Is there some way of going about it without having to restart the server every time I edit something in say ..lua/autorun/server?
-
Usually you can just reload the script using the lua_openscript and lua_openscript_cl commands.
Garry supposedly implemented a new system where if you make edits to lua files, it will automatically update in-game. I have not yet looked in how to get that set up, though. All I know is that anytime I make a small change to XGUI, I have to restart :-[ So many restarts! *shudder*
.. And for the worst case, make sure your development server has as few addons installed as possible-- that always helps the load times :P
-
Thanks Stickly, as a report on the new auto refresh after lua change, it seems to be functional with the small script I've been working on!