Lua Idiot Here

Status
Not open for further replies.

Rex The Kitsune

Annoying Purple Dude
Since I am now fascinated with what Lua can do, and I've seen the cool things that come out of it, I would like to learn Lua. If someone who knows Lua could show me a tutorial or teach me about it I would appreciate it.

Honestly, I don't know where to start. I want to begin by making a simple Lua script where you can jump infinitely when you hold the Custom 1 button.
 
The stickies...?
https://mb.srb2.org/showthread.php?t=36736
https://mb.srb2.org/showthread.php?t=37219

Coding in Lua is like 10% learning the syntax and 90% learning what variables do what. You can just take a look inside some of the existing lua scripts to see what does what. Plenty of people who know Lua in IRC would be willing to help as well.
If you don't constantly complain about asking for help. But seriously, there are some people in IRC to help you like MI, FuryHunter, and etc. And I'm warning you, if no one tries to help, wait till tomorrow, I've learned that lesson the hard way... :/
 
They generally won't be down your throat unless it's obvious you're not making an effort to do things yourself
 
But I want to start from the very beginning. I'm a slow learner, so I need to learn the various functions and variables step by step.
Is there any tutorial like that?
 
This my start right here. Literally what I did is go on IRC and say "hey, how do I get rid of the rings, and how do I change what comes out of this monitor". They answered, we talked about how the code works, I learned, and then I just did stuff from there.

And seriously, you can just learn stuff by looking at how other Lua scripts do stuff. Poking around in Rosy's lua taught me a lot about what kind of functions and variables can be used to accomplish different objectives.
 
It helps a lot to see how other people have done their Lua scripts for reference, yeah. Part of how I figured out Lua was at first staring at JTE's own Lua scripts (such as creator.wad!).

It also helps to be familiar with SRB2's source code if possible, so then you can understand what on earth the hooks affect as well as when they take place.

Also, I've been working on my own Lua documentation on the SRB2 Wiki:

https://wiki.srb2.org/wiki/User:Monster_Iestyn/Lua_basics
https://wiki.srb2.org/wiki/User:Monster_Iestyn/Userdata_structures
https://wiki.srb2.org/wiki/User:Monster_Iestyn/Lua_documentation

None of these can really be called "complete" yet (the latter two mostly), but these should be helpful somewhat.
 
Last edited:
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top