LUA Coding

tehrilez

New Adventurer
Joined
Aug 3, 2007
Messages
776
Reaction score
0
Age
30
Location
USA, NY
I'm sure a few of you are familiar with Garry's Mod, and how its scripts work.


http://www.lua.org/

Basically, it runs off of LUA scripts, which are pretty easy to code. Much easier than hard coding something into a mod.


I was wondering if it were possible, to have MS:S run on the LUA engine.

That way, even the community could make their own weapons. Plus, instead of having a weak team of 1-2 coders, I could get people familiarized with LUA, including myself, to work on this. We could have TONS more people working on this if we implented lua. Of course, you would have to find a way to keep people from making scripts to say, use noclip or a nuke or something, because with LUA, anything is possible.

:roll:

Overall I think LUA would make developing this 10x easier.

On a side note, something made ENTIRELY in LUA, in 20x less time that it would take to code all of the weapons and stuff directly into the mod.

Set your class, coins, inventory. Everything in a few LUA scripts, which take about two seconds to make.

218d8d91a9620cebcc6e3f695433c0dd.jpg



Also, with LUA, you would never need "monthly patches." You could just release updates to LUA scripts, instead of an ENTIRE DLL.


This would also get rid of different Client.dll problems, cause if the game runs on lua, and the client has a different script than the server, the script downloads from server to client. If the client has the same script as the host, then it won't.
 

The Man In Black

Administrator
Staff member
Administrator
Moderator
RiP
Joined
Jul 9, 2006
Messages
6,904
Reaction score
71
Yes, it will make it so much easier!...After we do all the coding to remove any possibilty of a client editting the files..

MS:C/S already have Scripting systems (planned for Source, of course). They're powerful and come in a nice .dll that users have a very difficult time messing with. Current Script System > LUA.
 

Shurik3n

New Adventurer
MSC Developer
RiP
Joined
Aug 15, 2006
Messages
1,357
Reaction score
0
Age
34
Hows does people being able to make godly items whenever they want help the game?

Also, as MiB stated, this game already has its own scripting for easy expansion with weapons/items/monsters without editing the hardcode.
 

tehrilez

New Adventurer
Joined
Aug 3, 2007
Messages
776
Reaction score
0
Age
30
Location
USA, NY
A .dll is an easily expanded script that isn't hard code?


uhh..
 

The Man In Black

Administrator
Staff member
Administrator
Moderator
RiP
Joined
Jul 9, 2006
Messages
6,904
Reaction score
71
Indeed, it is. It's VERY easy to use, it's just compiled (via a special program) into a .dll for safety.
 

Shurik3n

New Adventurer
MSC Developer
RiP
Joined
Aug 15, 2006
Messages
1,357
Reaction score
0
Age
34
The folder of scripts is compiled and encrypted into the dll so nobody can edit them.
 

tehrilez

New Adventurer
Joined
Aug 3, 2007
Messages
776
Reaction score
0
Age
30
Location
USA, NY
Well then can I see an example script, before its compiled?


Depending on level of difficulty I may want to try coding for this mod.


I've done a bit of scripting, but not for source.
 

Drigien

New Adventurer
Joined
Jan 12, 2007
Messages
103
Reaction score
0
Location
Canada
From what i have heard, its not that difficult to implement into source, and would have to agree to use lua as the scripting language for MS:S.

Mainly because no one from MS:C is working on the coding/scripts for MS:S (that i know about), and that it would lessen the work the developers would have to do (ie: no more Thothie spending a month just on ppls map scripts while new things get pushed back) because the community could help write the scripts along with the mapper to get what they want as well as making new skills and weapons. Of course developers would have the final say about using/making them official, and have protection against any unofficial scripts with use of FN (or whatever it will be called). That way people could still develop and test new scripts on local servers.

This way the developers don't have to work on new content as much as stabilize code and create new tools for the community to build off of.
 

tehrilez

New Adventurer
Joined
Aug 3, 2007
Messages
776
Reaction score
0
Age
30
Location
USA, NY
Drigien said:
From what i have heard, its not that difficult to implement into source, and would have to agree to use lua as the scripting language for MS:S.

Mainly because no one from MS:C is working on the coding/scripts for MS:S (that i know about), and that it would lessen the work the developers would have to do (ie: no more Thothie spending a month just on ppls map scripts while new things get pushed back) because the community could help write the scripts along with the mapper to get what they want as well as making new skills and weapons. Of course developers would have the final say about using/making them official, and have protection against any unofficial scripts with use of FN (or whatever it will be called). That way people could still develop and test new scripts on local servers.

This way the developers don't have to work on new content as much as stabilize code and create new tools for the community to build off of.


Thats what I've been trying to say.
 

ceriux

Adventurer
Joined
Feb 17, 2005
Messages
2,297
Reaction score
5
Age
36
Location
At my computer :)
yea... but with that... people could also start making godly armor and such ... unless u could make the LUA un accessable to the public.
 

tehrilez

New Adventurer
Joined
Aug 3, 2007
Messages
776
Reaction score
0
Age
30
Location
USA, NY
ceriux said:
yea... but with that... people could also start making godly armor and such ... unless u could make the LUA unaccessible to the public.


Sorry for reviving this, I thought I'd make a few points though. I'm hard coding the mod now but I thought I would say a few things about LUA.


- It's an easy scripting language which easily allows developers to create and add on things to the game.

- It isn't hard coded in, so cheaters might be a problem. But if FN is implemented in MS:S, it wouldn't be a big deal. Cheaters could be found out in about two seconds, due to the fact that almost the entire community on this forum is against cheaters.

- Thousands of people code LUA for Garry's Mod 10. We could get quite a work load if we used LUA.

- LUA is much easier to code than C++, the coding is much more newb friendly.

- Mappers could also learn LUA, and be able to make their monsters for a map without having to ask the developers to hardcode it in. This would also allow developers to work on more important parts of the mod (single player?) instead of having everything pushed back because they have to create monsters for someones map.
 

Tull

New Adventurer
RiP
Joined
Dec 23, 2006
Messages
394
Reaction score
0
Age
40
Location
Shuweeden
tehrilez said:
- It isn't hard coded in, so cheaters might be a problem. But if FN is implemented in MS:S, it wouldn't be a big deal. Cheaters could be found out in about two seconds, due to the fact that almost the entire community on this forum is against cheaters.
Wouldn't this mean that FN had to check every new server's last piece of LUA code to make sure none has changed it into something more profitable? Sounds like FN:S is going to have quite a hard time if the server list grows to big. This check would probably be required every time the map is changed or server is started/restarted, I guess.

Or I'm all wrong. Perhaps you could use some hash checking or something.
 

ceriux

Adventurer
Joined
Feb 17, 2005
Messages
2,297
Reaction score
5
Age
36
Location
At my computer :)
why cant you just make a custom script file system like we have now... and hand out a mock version of it... iv seen ms's script files ... they arnt that complicated.


i found this.

What is Lua?
Lua is a powerful, fast, light-weight, embeddable scripting language.

Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

'Lua' means 'moon' in Portuguese and is pronounced LOO-ah.

maybe you can still do it if u embed it into a dll or something?
 

decon

New Adventurer
Joined
Aug 23, 2007
Messages
17
Reaction score
0
you could most likely find many people who are very skilled at lua programing at these forums http://forums.facepunchstudios.com/
and a willing programmer will not be hard to find since they are always looking for something to do
 

CrazyMonkeyDude

New Adventurer
MSC Developer
RiP
Joined
Jun 29, 2007
Messages
2,619
Reaction score
2
Age
35
Finding someone smart enough to link to it properly might be a tough one, though. :p

Either way, my first thought for LUA coders would have been the gmod forums, and, if you read this thread, that's where they got the idea.
 

WeissberV

New Adventurer
Crusaders
Joined
Jan 21, 2007
Messages
1,053
Reaction score
0
Age
32
Location
England
Garrys mod 9 is known for lua virus's when u download a load of lua from a server it could be anything, i dunno if its like that for gmod10 but for the 9th version, that had quite alot
 

tehrilez

New Adventurer
Joined
Aug 3, 2007
Messages
776
Reaction score
0
Age
30
Location
USA, NY
It was fixed for GMod 10..


I remember once I got a lua virus called spoon.lua or something, in GMOD9.


when I made my own server it renamed me to " Hairy Dick " or something like that, kept making me spam "I'm gay and watch child porn" and banned me from my own server.

Fun times.

Also, if you have gmod9, get 10. It's so much better, no viruses, etc.

I'm not sure how they fixed the viruses, I think they changed how the LUA was handled.

I'll find an article if I can.
 

CrazyMonkeyDude

New Adventurer
MSC Developer
RiP
Joined
Jun 29, 2007
Messages
2,619
Reaction score
2
Age
35
I stopped playing gmod10 after I realised most people payed 10 dollars so they could just fuck with you. Every server I went to without an admin actively in it was crashed by lighthouse-spam. Add that with item ownership...
 

tehrilez

New Adventurer
Joined
Aug 3, 2007
Messages
776
Reaction score
0
Age
30
Location
USA, NY
Erm, so play in your own server?

Just leave whenever you see "MingeBag"


thats the default name for a reason
 

Shurik3n

New Adventurer
MSC Developer
RiP
Joined
Aug 15, 2006
Messages
1,357
Reaction score
0
Age
34
Because we all know griefers can't change their name.
 

The Man In Black

Administrator
Staff member
Administrator
Moderator
RiP
Joined
Jul 9, 2006
Messages
6,904
Reaction score
71
I lol'd @ Rilez.

Besides, I prefer entmod on Sven over gmod =|
 

Shurik3n

New Adventurer
MSC Developer
RiP
Joined
Aug 15, 2006
Messages
1,357
Reaction score
0
Age
34
But you cant make sexual poses with ragdolls in hl1! (in b4 J-M).
 

The Man In Black

Administrator
Staff member
Administrator
Moderator
RiP
Joined
Jul 9, 2006
Messages
6,904
Reaction score
71
I BEG TO DIFFER (I will find pics if I must.)
 
Top