Conjoint Gaming [Game On]

CG Technical Area => Programming => Topic started by: Ducky on November 27, 2010, 07:59:27 AM

Title: Learn To Script Lua
Post by: Ducky on November 27, 2010, 07:59:27 AM
(http://imgur.com/7Ohjo.png)
Follow these steps then maggot!
(http://imgur.com/RrVE8.png)
Download the program Notepad++ (http://notepad-plus-plus.org/release/5.8.5). This program is great for scripting in the Garry's Mod Lua syntax because it has a highlighting plugin made for it that makes scripting much easier. Once you get the Garry's Mod plugin (http://sourceforge.net/projects/npp-plugins/files/Gmod%20Lua%20Highlighter/Gmod%20Lua%20v1.5/NppGmodLuaPlugin-v1.5.zip/download), install all the files in the zip you downloaded into the programfiles/notepad++/plugin directory. Start up Notepad++ and click on the language tab at the top and you should see the language "Gmod Lua" selectable, select that and you are ready to start learning!
(http://imgur.com/IDV97.png)
This website is your god for the rest of your scripting career.

Garry's Mod Lua Wiki (http://wiki.garrysmod.com/?title=Lua)

This website has every function, hook, and command that you can give in Garry's Mod with Lua, and then some. If you ever see something you don't understand, just go to that wiki page and search for it. This is how you will learn how things work generally, and how you will memorize functions and hooks to speed up your scripting.

Starter Lua Tutorials (http://wiki.garrysmod.com/?title=Lua_Tutorial_Series)

Read those and make sure you fully understand them. After that, you are on your way to understanding Lua.

(http://imgur.com/GB2I0.png)

PLEASE, I am BEGGING you. Post all the questions you have about Lua coding in this thread. I will gladly answer anything you are confused on. It's what I am here for.  frogc00l

(http://imgur.com/bE2MX.png)
Make a simple deathmatch gamemode with a simple custom hud, without Fretta.
Make a melon that follows you around.
Make a script that allows you to charge up your jump, with a simple hud bar to gauge the power.
Take a crack at making your own custom scoreboard.
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.

Title: Re: Learn To Script Lua
Post by: Ducky on November 27, 2010, 02:52:06 PM
Thread is finished!  trollface
Title: Re: Learn To Script Lua
Post by: Travis on November 27, 2010, 03:16:15 PM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.
Title: Re: Learn To Script Lua
Post by: Wholegrain on November 27, 2010, 03:17:56 PM
im going to attempt to learn basic lua coding and then try to advance my skills to the point i can actually help keep the ttt server run more fluently and rely more on myself then on others
Title: Re: Learn To Script Lua
Post by: Ducky on November 27, 2010, 03:20:15 PM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
Title: Re: Learn To Script Lua
Post by: Ducky on November 27, 2010, 03:20:58 PM
im going to attempt to learn basic lua coding and then try to advance my skills to the point i can actually help keep the ttt server run more fluently and rely more on myself then on others

Thats awesome, I highly suggest it.
Title: Re: Learn To Script Lua
Post by: AlphaWeeaboo on November 27, 2010, 03:22:53 PM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
Title: Re: Learn To Script Lua
Post by: Travis on November 27, 2010, 03:30:59 PM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.
Title: Re: Learn To Script Lua
Post by: Ducky on November 27, 2010, 03:36:47 PM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
Title: Re: Learn To Script Lua
Post by: Travis on November 27, 2010, 04:29:51 PM
When I do

loop=10
for i=1,loop do
    Msg("This person was number "..i.." out of "..Loop.."  people.")
end

I get:

attempt to concatenate global 'Loop' (a nil value)

Edit: I see what I did wrong
Title: Re: Learn To Script Lua
Post by: AlphaWeeaboo on November 27, 2010, 04:36:02 PM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?
Title: Re: Learn To Script Lua
Post by: Ducky on November 27, 2010, 04:37:14 PM
When I do

loop=10
for i=1,loop do
    Msg("This person was number "..i.." out of "..Loop.."  people.")
end

I get:

attempt to concatenate global 'Loop' (a nil value)

Edit: I see what I did wrong

Just so you know, this is always a bitch for anyone to figure out. This is the code you always use to make v mean all players.
Code: [Select]
for k,v in pairs(player.GetAll()) do
That is just something that stumps a lot of people and that can only be realized as an example.
Title: Re: Learn To Script Lua
Post by: Ducky on November 27, 2010, 04:38:59 PM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

It is relatively easy and takes just a little bit of time to fully understand. You can be producing something noticeable in Garry's Mod within the first hour of knowing the language. Garry's Mod makes Lua extremely easy, don't get me started on Lua for shit like WoW and other games.
Title: Re: Learn To Script Lua
Post by: Travis on November 27, 2010, 11:18:15 PM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

It is relatively easy and takes just a little bit of time to fully understand. You can be producing something noticeable in Garry's Mod within the first hour of knowing the language. Garry's Mod makes Lua extremely easy, don't get me started on Lua for shit like WoW and other games.
How long until you can create a game mode?
Title: Re: Learn To Script Lua
Post by: Ducky on November 28, 2010, 12:01:00 AM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

It is relatively easy and takes just a little bit of time to fully understand. You can be producing something noticeable in Garry's Mod within the first hour of knowing the language. Garry's Mod makes Lua extremely easy, don't get me started on Lua for shit like WoW and other games.
How long until you can create a game mode?

Probably a couple days. You need to understand how everything works before you apply it to something large such as a gamemode.
Title: Re: Learn To Script Lua
Post by: Travis on November 28, 2010, 12:02:15 AM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

It is relatively easy and takes just a little bit of time to fully understand. You can be producing something noticeable in Garry's Mod within the first hour of knowing the language. Garry's Mod makes Lua extremely easy, don't get me started on Lua for shit like WoW and other games.
How long until you can create a game mode?

Probably a couple days. You need to understand how everything works before you apply it to something large such as a gamemode.
I would of thought atleast a month, really?
Title: Re: Learn To Script Lua
Post by: Ducky on November 28, 2010, 12:18:19 AM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

It is relatively easy and takes just a little bit of time to fully understand. You can be producing something noticeable in Garry's Mod within the first hour of knowing the language. Garry's Mod makes Lua extremely easy, don't get me started on Lua for shit like WoW and other games.
How long until you can create a game mode?

Probably a couple days. You need to understand how everything works before you apply it to something large such as a gamemode.
I would of thought atleast a month, really?

Besides HTML, Lua is the easiest language I have ever had to use.
Title: Re: Learn To Script Lua
Post by: Mr.TheDoctor on November 28, 2010, 11:02:05 PM
Make zombie NPCs spawn at random locations on a map, and not get stuck in walls.


Lulz.

I was hoping someone would catch on to that.
I was going to say the same thing!
But anyways I'll have to try this out. I've always been interested in learning some coding.
These are pretty good websites and if you need help just ask Ducky about it.

Please do, I am here to help.
That's what my doctors tell me. XD
But anyways how easy is the language and learning it? Is it something that can be picked up right away or takes some time before you can produce something noticeable?

It is relatively easy and takes just a little bit of time to fully understand. You can be producing something noticeable in Garry's Mod within the first hour of knowing the language. Garry's Mod makes Lua extremely easy, don't get me started on Lua for shit like WoW and other games.
How long until you can create a game mode?

Probably a couple days. You need to understand how everything works before you apply it to something large such as a game mode.
I would of thought at least a month, really?

Besides HTML, Lua is the easiest language I have ever had to use.



^^^^^^^^^Looks like  a pyramid. ^.^. And from what Ive heard, lua should take, on average, about a week to get the hang of.Looks like I'm in for a looong week .  :-\
SimplePortal 2.3.5 © 2008-2012, SimplePortal