Jump to content

An important questions about scripting


PeteyFTW

Recommended Posts

I'm planning to start my new career in scripting life, Well I just want to learn lua language and dedicated for MTA only but I searched in Google, MTA Wiki Wikipedia, I did each step but I don't understand anything of the scripting codes, Such eventhandler and functions  . . . ect, I'm really very interested in learning scripting ' Lua language ' but I can't understand the scripting codes that are placed here https://wiki.multitheftauto.com/wiki/Scripting_Introduction


So my question is: Give me some good tips to start my new career because I couldn't understand the codes although It is explained in detail ' Wikipedia ' . Tell me how to start it in an easy way . . !

 

Regards: Petey - MTA lover

Link to comment
25 minutes ago, NeverGiveup said:

Check out tutorials subforum, there are bunch of tips and tricks you want to know

As beginner i'd like you to check  out this tuts which created by madex, this one really well explained

https://forum.multitheftauto.com/topic/64228-the-ultimate-lua-tutorial/

 

It's complicated a bit, I couldn't understand!, What is the first steps that I'm supposed to do, starting with the smallest stuff . . . ! I watched creating events, he used some difficult codes I couldn't absorb them unfortunately, a lot of codes around, with hard texts!!

Link to comment

The way I learned (some) lua was by trial and error and asking others for help. It helps a lot to first just edit really simple stuff from already made resources which you can get from the community site. Like, change position of a text on screen, make it look good on any resolution etc. You get the idea. 

And when you can edit most such parts of already made resources you will start understanding how things work and won't have a problem with creating functions. 

Remember: always Google or ask in here (if Google has let you down) and you'll learn it, not immediately but you will. 

So, good luck with it :)

  • Like 1
Link to comment

First thing that you need to accept is that programing/scripting isn't something that can be learned in one day, even though I have several years of experience in lua I learn new stuff witch each new script I create.

The requirements to get starting with programing scripting are:

-patience and strong will,

-understanding of English language,

-basic math knowledge like operations on formulas (creating own formulas, merging formulas) and logical operations .

If you have all that, then all you need to know is that programing/scripting is nothing more then talking to the computer (writing commands that the computer is able to understand and execute).

To do that you need to learn a programing/scripting language like lua.

Like any other language it has its rues syntax and grammar (a set of keywords and the way you use them).

Unlike humans computers are very stupid, you need to tell them how to do every, even most basic operation from start to finish, without making any syntax or grammar error (luckily for us the most basic stuff are already covered by build in lua and MTA functions, so it's not that hard).

So the most basic stuff you need to know about any language including lua are:

variables – they are containers that hold various data like numbers or text ('strings'), depending on the data stored in them you can preform any sort of operations on them – mathematical, logical, ect.

If .. else .. end statement – the way to control witch part of the code will be executed depending on the conditions

functions – you may think of them like smaller scripts within a script

tables – you may think of them like more powerful variables, tables are VERY important

I would recommend to find a good lua tutorial and start with this topics, then jump to MTA event handlers so that you will be able to test your knowledge in game.

  • Like 1
Link to comment

So, I will start editing small scripts till I get used about some easy codes then start gradually using some difficult codes, By the way, I have good English skills and acceptable and I can communicate with everyone without any problem, So It will take more than two years till I learn lua language even more, I just feel so.

 

I will follow the important guidelines that have been stated above ^

  • Like 2
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...