🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
where to get Lua tutorials
The actual docs, I guess. You could also buy Programming in Lua, which is an excellent book. But I don't think there are too many good online tutorials (or so goes the lament I tend to hear concerning them [grin]).
ok I'll re-read the docs for a bit.
btw, am I in the wrong forum? This post did not appear on the
news section?
btw, am I in the wrong forum? This post did not appear on the
news section?
The state of documentation for lua is a very sorry state. The manual is very concise in defining the Lua langugage and C API. There are a few good samples in the Lua WIKI, too. But beyond that, you're pretty much on your own.
What kind of tutoirals are you looking for that aren't covered in the wiki?
I wouldn't mind writing a couple if there is a demand for them.
Dwiel.
Oh, there is a good article about calling Lua functions from C and visa-versa, I can't find it at the moment, but if that is what you are looking for, I can try a little harder.
Hope I've helped!
Dwiel
I wouldn't mind writing a couple if there is a demand for them.
Dwiel.
Oh, there is a good article about calling Lua functions from C and visa-versa, I can't find it at the moment, but if that is what you are looking for, I can try a little harder.
Hope I've helped!
Dwiel
Quote: Original post by Tazzel3D
Oh, there is a good article about calling Lua functions from C and visa-versa, I can't find it at the moment, but if that is what you are looking for, I can try a little harder.
Well, for calling Lua from C? Let's see. In Lua, make a function like this:
function func(x, y)
-- do stuff with x and y
return x + y; -- just for fun
end
In C:
lua_getglobal(L, "func");
lua_pushnumber(L, 5);
lua_pushnumber(L, 10);
lua_call(L, 2, 1);
// result will equal 15
int result = (int)lua_tonumber(L, -1);
lua_pop(L, 1);
All off the top of my head, but I think that's right. Calling C from Lua is about the same; you just have to register the C functions with Lua first. Check the docs for info on all those functions. Or just Google all the functions and you're sure to find a more in-depth tutorial.
Meanwhile, should I be moving this to Programming?
If anything, I would say move it to the scripting forum.
ok
I found the articles I was think of which I thought explained things well:
Part 1
Part 2
Part 3
Hope that helps. Also, like I said before, if you find that the existing tutorials cover enough topics, let me know what you think should be covered, and I'll try my best.
Dwiel
ok
I found the articles I was think of which I thought explained things well:
Part 1
Part 2
Part 3
Hope that helps. Also, like I said before, if you find that the existing tutorials cover enough topics, let me know what you think should be covered, and I'll try my best.
Dwiel
Quote: Original post by Tazzel3D
If anything, I would say move it to the scripting forum.
I'd forgotten about that one. :)
Moved ...
The lounge is a scripting forum?
Edit Oh, the thread is now in both places at once. Interesting. . .
Edit Oh, the thread is now in both places at once. Interesting. . .
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement