LUA Practices and differences between python and gmod lua
7 replies, posted
Hey there!, I have been looking at coderhire and seeing some very easy jobs i reckon I could do, but i never apply cause i feel it might be harder then i first thought, and i am not the best lua coder,
Are there some practices that i can do, or can someone suggest something so that i can attempt it and see how my skills are,
Also, what are some main differences between python and lua,
[URL="http://bit.ly/1bi63SW"]Differences between python and lua[/URL]
The best way of practicing, I've found is by converting old addons/gamemodes from older versions of GMod. Through this, you can fix a lot of code yourself while observing the correct way to use different things and their effects. Converting also forces you to know what the code does so you can correctly fix issues, because a lot of times, errors won't be output, it just won't work.
As for the difference between python and lua, read these:
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index70f9.html[/url]
[url]http://lua-users.org/wiki/LuaVersusPython[/url]
Edit things that are actually coded well. Add new features and things like that. Then make your own.
Is there a place (not coderhire) where people can say "If someone could make this blah blah for this gamemode that would be awesome"
example:
"If someone can create a innocent ttt shop for ttt that would be awesome"
Is there some forum like that? where people request stuff
Not really. If you try to do it here, it usually results in a ban
[QUOTE=AnonTakesOver;42816648]Is there a place (not coderhire) where people can say "If someone could make this blah blah for this gamemode that would be awesome"
example:
"If someone can create a innocent ttt shop for ttt that would be awesome"
Is there some forum like that? where people request stuff[/QUOTE]
Look at CoderHire and create addons without applying for the job.
In terms of the difference between LUA and Python, there are a few. The most important difference is that Python is meant to deliver a high-level and cross-compatible programming language, LUA is meant to provide a high-level scripting access embedded in software, letting someone modify run-time behavior without mucking about with the internal code. Python has a massive amount of libraries to choose from, and is arguably more flexible. LUA has a much smaller foot-print, and is very simple to learn and use.
That's my understanding of it, at least. Speaking as a Perl / C++ programmer I have a few petty gripes with both. My main issue with LUA is a lack of a POSIX-Regular Expression library, but I'm digressing a bit...
As for learning and practicing, there's a common theme in the posts here: you have to find your own project. Give yourself something to do! You can use previously established code as a jumping off point, use someone's initial idea (like how Anon describes above) as inspiration, or just make up something and see if you can do it.
I'm a fan of the latter method. Think of something you'd like to see or do, and try to code it. Think of a problem, then try and solve it. Just as an example, for the first LUA script I wrote that actually did something I decided to [url=http://pastebin.com/7Gh0B15v]figure out how far a player has moved in Imperial and Metric units, converted from game units[/url]. Pretty simple, but taught me a lot.
What the methods I listed have in common, is that you have to give yourself something to do. The difference is in where the inspiration comes from, but what you do is irrelevant just so long as you do it, and understand it. Don't be afraid of errors or semantic bugs, because fixing them will give you valuable insight on what's going on under the hood.
Sorry, you need to Log In to post a reply to this thread.