Scripts / Learn Lua script

Author
Message
Theo196943
8
Years of Service
User Offline
Joined: 21st Apr 2016
Location:
Posted: 27th Jan 2017 22:38
Can anyone tell me how to learn lua script ????Please.....
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 27th Jan 2017 23:18
Same way you learn anything else, get the manual, google for tutorials and wiki sites, watch Lee's twitch broadcasts, but most of all go look through all the existing scripts and figure out what they do and how they do it. Don't be afraid to experiment.
Been there, done that, got all the T-Shirts!
PM
Theo196943
8
Years of Service
User Offline
Joined: 21st Apr 2016
Location:
Posted: 30th Jan 2017 01:13
Thanks ill experiment
PM
MChapman
8
Years of Service
User Offline
Joined: 19th May 2015
Location: USA
Posted: 11th Feb 2017 04:31
If you follow Lee's youtube series of Live streams you will be pretty fluent with GameGuru's lua. there may seem like alot but before no time you're like the rest of us waiting eagerly for more lol...
Markchapman10 is my Skype let's have some dev talk.
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 12th Feb 2017 12:47 Edited at: 12th Feb 2017 16:40
Download one of these editors:
http://notepad-plus-plus.org/
http://studio.zerobrane.com/
http://luaedit.sourceforge.net/

for notepad syntax highlighting:
https://forum.game-guru.com/thread/213931


Learn the basics about scripting if you have none:
https://www.lua.org/pil/contents.html (how to initialise vars; arrays(1. dimension, maybe 2. too); if else; loops are not necessary, because the scripts loop themself)

Then look at the tutorials:
https://steamcommunity.com/app/266310/discussions/0/610574106416358095/
and just for Lua, all commands from GG are here:
http://steamcommunity.com/sharedfiles/filedetails/?id=398177770

And then learn from Try and Error. Every start is hard so don't give up

Some threads for examples:
https://forum.game-guru.com/thread/207801

Last tip: Don't read all these "performance" threads out there. Lua is a scripting language, so the performance gain is low and make your script unnecessary complicated.

After you feel save with lua, you can look about:
Performance:
https://www.lua.org/gems/sample.pdf
http://stackoverflow.com/questions/154672/what-can-i-do-to-increase-the-performance-of-a-lua-program
Loops: http://lua.lickert.net/loop/index_en.html
Objects: https://www.lua.org/pil/16.html
and so on...

And the last good tip:
Start with easy scripts and have fun.

(We should make a sticky thread about this!!!! You can take this as template)
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 12th Feb 2017 14:28
Lua may be a scripting language but that doesn't mean you should ignore performance when writing in it.

I was able to double the FPS on the MMS map simply by making the Lua scripts it uses more efficient! Or to put it another way if you write a badly optimised script you can kill the performance of your game and it is easier to learn good coding habits early and apply them rather than having to re-write your scripts later trying to increase performance. I always keep an eye on the AI slider, if it jumps up after adding an entity it is an indication that it has an inefficient script.

Also it is incorrect to say you don't need to learn looping, if you take a look at some of my scripts you'll find lots of looping.
Been there, done that, got all the T-Shirts!
PM
Corno_1
GameGuru Tool Maker
13
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 12th Feb 2017 16:31 Edited at: 12th Feb 2017 16:43
Quote: "Lua may be a scripting language but that doesn't mean you should ignore performance when writing in it."

I never said that. I said he should ignore your, mousa and all the other threads about performance, because they are high class and he want to start! It is better to learn to read and write code and then to focus on performance, isn´t it?
Quote: "it is easier to learn good coding habits early and apply them rather than having to re-write your scripts later trying to increase performance."
Good coding habits are always basic, I not talk about basics, I talk about performance optimization to the top.
Quote: "Also it is incorrect to say you don't need to learn looping, if you take a look at some of my scripts you'll find lots of looping."

He starts and loops can create some problems in GG if you're not fully understand them. That is the reason why I told him this. Basic scripts not really need loops. That is my opinion. A tutorial should make you a casual coder, not a pro!
Quote: "I always keep an eye on the AI slider, if it jumps up after adding an entity it is an indication that it has an inefficient script."

With writing "a badly optimised script you can kill the performance of your game and it is easier to learn good coding habits early and apply them rather than having to re-write your scripts later trying to increase performance." I never experienced a big jump, but maybe I did not try to jump over some calculations with system time operations.
Quote: "I was able to double the FPS on the MMS map simply by making the Lua scripts it uses more efficient!"

Everybody tell this, nobody ever prove it. I know that a lot of standard scripts needs some optimization, but I never use one, because I build my games from ground up. So every piece has its own function and I know exactly what.

But to get rid of this discussion: He want to start and I showed him the same I showed the little brother of my girlfriend who want to start in Lua with GG. He can now script, not perfect, but it is really good for the first half year into programming/scripting. I also updated my post above, so he has some sources for experienced users.
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
Mipastu
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 16th Feb 2015
Location: Finland
Posted: 21st Feb 2017 17:52 Edited at: 21st Feb 2017 17:52
If you want to know how any of that works and you are complete beginner, try something easy like this to understand how any of this works: https://studio.code.org/hoc/1 Its easy game that by only playing you will get some idea
Intel Core i5 6600K @ 3.50GHz ¨ 16,0Gt dual channel RAM @ 1334MHz ¨¨ 2048MtNVIDIA GeForce GTX 1060 6GB ¨¨ 465GB Samsung SSD 750 EVO 500GB (SSD) ¨¨ Windows 10 Home 64-bit

Login to post a reply

Server time is: 2024-04-24 23:48:15
Your offset time is: 2024-04-24 23:48:15