Jump to content

Lua and LE


Sooshi
 Share

Recommended Posts

Hi, I have followed the pdf of getting started with Lua. And it seems to be simliar to the C++ tutorials in the documentation. I can follow these tutorials fine with no problem. But when I try to understand how to script with Lua inside the editor, I am completely lost. I thought the editor was suppose to make things easier when scripting with Lua? And if thats the case, where is the documentation on how to get started with Lua and LE editor, similiar to the C++ documented tutorials?

 

The way things are done in the editor completely changes everything im used to doing when I am using Lua and I am seriously confused. And I cannot find anything that clearly explains step by step what is going on about all these entity classes and what not. Where is the documentation?

Working on a major RPG project.......will showcase soon.

 

www.kevintillman1.wix.com/tillmansart

Link to comment
Share on other sites

The basics are explained in the "Getting Started With Lua" PDF, but it is pretty confusing. Everything I've learned has been just via looking at how the existing scripts work and google searchs when I want to understand something specific that I find in them.

 

Of course, you don't HAVE to use Lua if you don't want to. You can still iterate through the objects in your C++ code and use the C or C++ API to do everything Lua can do. The main advantage to using Lua is that the Lua scripts will execute while in editor while your C code won't.

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

the best documentation currently is to look at the existing model scripts and the game scripts

 

I can look at it all day, day after day, but if the theory and terminology behind it is not explained in an in depth tutorial, im just wasting my time. And also, the best way is to learn from example that is being "explained"

 

like these...

http://www.leadwerks.com/wiki/index.php?title=Main_Page

Working on a major RPG project.......will showcase soon.

 

www.kevintillman1.wix.com/tillmansart

Link to comment
Share on other sites

Yeah, I agree that the pdf is a little hard to grasp on it's own. I'll look at doing a video tutorial like the others that will help people get started if I can find time. I just noticed how much time I was spending adding features to LE instead of actually working on game code or doing paying work. Not that I'm complaining, I've been having fun, I just have to catch up on some projects to pay the bills, then I'll jump back into LE stuff.

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

Yeah, I agree that the pdf is a little hard to grasp on it's own. I'll look at doing a video tutorial like the others that will help people get started if I can find time. I just noticed how much time I was spending adding features to LE instead of actually working on game code or doing paying work. Not that I'm complaining, I've been having fun, I just have to catch up on some projects to pay the bills, then I'll jump back into LE stuff.

 

That would be awsome bro, trial and error should only be a factor when no one has the answers to this stuff, I dont pride myself over "finding things out on my own". If someone has the knowledge, I am going to contact that person so I can bump heads with them, 2 heads is better than one...

 

From Kindergaden to HighSchool, if all teachers did was tell students "we have the knowledge, but find it out on your own!" And if no one bothered to write books behind knowledge(a book is nothing but a documentation),the world would never progress, if someone has the answers then someone needs to document the knowledge behind this stuff, because to me, time is critical :)

 

Lua with LE needs in depth tutorials...

Thanks Niosop

Working on a major RPG project.......will showcase soon.

 

www.kevintillman1.wix.com/tillmansart

Link to comment
Share on other sites

Yeah, we really need some official documentation soon. It is taking a ridiculous amount of time.

 

 

 

Well if you think thats "ridiculous time" you want to see how my watch works :)

 

I agree with Mack and Nio, right now the best bet is to use the existing model/game scripts and what ever is on the wiki, not to mention the forum, while Josh catches up in that area. Make the best of what we do have until then.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Niosop, Aggror, Rick.....thanks guys. The editor is a fine piece of software, but without any in depth tutorials and examples. I think that not only myself but many people will be lost and confused. And most people will not be able to get anything going. There needs to be examples with explanations just like the C++ tutorials.

Working on a major RPG project.......will showcase soon.

 

www.kevintillman1.wix.com/tillmansart

Link to comment
Share on other sites

Niosop, Aggror, Rick.....thanks guys. The editor is a fine piece of software, but without any in depth tutorials and examples. I think that not only myself but many people will be lost and confused. And most people will not be able to get anything going. There needs to be examples with explanations just like the C++ tutorials.

 

what parts are you having difficulty with? the gamescripts or just the model's scripts?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

what parts are you having difficulty with? the gamescripts or just the model's scripts?

 

 

Just getting started really, If I drop a cube .gmf file in the editor, what am I suppose to script to make it move, because the syntax is different when I look at these scripts for the windmill and firepit etc. There is no documentation on Lua functions, nor is there tutorials for just "getting started".

 

Everything else is documented, blitsmax, C#, C++, but not Lua....

 

I was also following the C++ tutorials to understand how to do things, and that worked out great, cuz I incorporated that knowledge using Lua. But when the editor is concerned, everything is different, and it is not "explained".

 

I am having trouble with the code below, what does this mean, why is this here, why is it necessary? And after that is explained, give me an example starting from scratch in the script editor on doing simple things like camera movement, bodies etc. like in the C++ tutorials...

 

local class=CreateClass(...)

class.sound=LoadSound('abstract::campfire_01_15.wav')

 

function class:CreateObject(model)

local object=self.super:CreateObject(model)

 

 

And this, I actually prefer just calling the actual function and providing the arguments like in the C++ tutorials rather than calling them this way...What is another way of calling functions in the editor?

object.heathaze:Paint(object.material_heathaze,0)

Working on a major RPG project.......will showcase soon.

 

www.kevintillman1.wix.com/tillmansart

Link to comment
Share on other sites

Just getting started really, If I drop a cube .gmf file in the editor, what am I suppose to script to make it move, because the syntax is different when I look at these scripts for the windmill and firepit etc. There is no documentation on Lua functions, nor is there tutorials for just "getting started".

when you say make it move... do you mean something like make it spin?

 

Everything else is documented, blitsmax, C#, C++, but not Lua....

 

I was also following the C++ tutorials to understand how to do things. But when the editor is concerned, everything is different, and it is not "explained".

well, some of the lua is documented... josh has been updating things as he goes... if you open the script editor and click the help menu>Help or press F1 it will bring up the basic lua script wiki documentation. Also, the Entities has lua commands listed.

 

I am having trouble with the code below, what does this mean, why is this here, why is it necessary? And after that is explained, give me an example starting from scratch in the script editor on doing simple things like camera movement, bodies etc. like in the C++ tutorials...

 

local class=CreateClass(...)

class.sound=LoadSound('abstract::campfire_01_15.wav')

 

function class:CreateObject(model)

local object=self.super:CreateObject(model)

 

 

And this, I actually prefer just calling the actual function like in the C++ tutorials rather than calling them this way...What is another way of calling functions in the editor?

object.heathaze:Paint(object.material_heathaze,0)

 

the following code just allows your model to have the very basic accessible properties:

require("scripts/class")

local class=CreateClass(...)

if you have that alone saved in your model's lua script it will allow you to access the standard properties like color, material, physics, etc... You can either right-click on the model thats listed in the right panel of the editor or select the model in the scene and press Alt+Enter to open up this property dialog.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

The way the class scripts is set up is not simple or easy to understand, but fortunately it is not necessary that you understand the structure. If you just copy the basic template and expose whichever functions you need, you can add your own code to make the entity behave. For a more in-depth look at tables, go to www.lua.org. To explain the table/class code, I would pretty much have to explain the whole Lua tables system.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Thanks for your help macklabee, I have also asked Niosop for some help and he has helped me out a great deal, thank you guys, until Lua docs roll in, I will definetely be expiramenting with this. Its just all so new to me and I have never worked with this type of stuff before. Im just used to calling functions, providing the arguments if necessary and doing my logic through control structure and iterations lol :(

Working on a major RPG project.......will showcase soon.

 

www.kevintillman1.wix.com/tillmansart

Link to comment
Share on other sites

Thanks for your help macklabee, I have also asked Niosop for some help and he has helped me out a great deal, thank you guys, until Lua docs roll in, I will definetely be expiramenting with this. Its just all so new to me and I have never worked with this type of stuff before. Im just used to calling functions, providing the arguments if necessary and doing my logic through control structure and iterations lol :(

 

no problem... glad I could be of some assistance. And the same thing is basically being done in the lua scripts as well. The 'Getting Started with LUA' also shows the basic functions that come with class.lua file that you list in your model script, 'require("scripts/class")'.

 

just some of the standard functions you can call in your model's script:

class:InitDialog(grid) - to add your own properties in the dialog

class:CreateObject(model) - to add your own code to control the behavior or change properties of your model

object:GetKey() - get specific keys/values associated with your model

object:SetKey() - set specific keys/values associated with your model

object:Render() - this is called any time the model is being rendered, so you can put specific code in here that only needs to occur when the model is being rendered

etc...

etc...

 

You can also create your own functions as well, as long as you create a call for that function.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Having to do trial and error(without documentation) to me is very very frustrating and it wastes so much of my time. To me, time is everything. I bought LeadWerks to create my game because I feel its the best indie game engine out there. But without tutorials and instructions, none of that matters. And I understand the documentation is being worked on, so on that note, I cannot sit at my computer for hours at a day nitpicking at code that isnt explained in depth. In the end, it will waste tons of my time and get me no where, I need something like this..

 

http://www.panda3d.org/wiki/index.php/Main_Page

 

which are documents that have the instructions clearly laid out for me. My way of thinking wont allow me to nitpick at the class entity scripts like this. Because I can utilize that time to work on my art assets, learn other things etc.

 

I dont mind brainstorming with you all on the forums with Lua, but without documents to study at the exact same time while brainstorming, its pointless.

 

I learned art at a good pace from studying gnomon dvds, watching tutorials of youtube videos. Going to different websites like 3dtotal.com and looking at their tutorials. I didnt even go to school for art, I went to school and got a degree in animation while studying art. I taught myself all on my own. Because I studied the recourses. And it still took a long time to do so because I had to exercise the knowledge that was being shown to me. But without anything being properly shown and explained, it is a complete waste of time in my eyes.

 

I need documentation in order to continue...

Working on a major RPG project.......will showcase soon.

 

www.kevintillman1.wix.com/tillmansart

Link to comment
Share on other sites

Ah .. so I didn't have a point then ... oh well one day .. it will happen ... I'll have one ... mark my words :D

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Ah .. so I didn't have a point then ... oh well one day .. it will happen ... I'll have one ... mark my words :D

 

No you do have a point, because everyone is different....

Working on a major RPG project.......will showcase soon.

 

www.kevintillman1.wix.com/tillmansart

Link to comment
Share on other sites

There is extensive documentation of the Lua implementation here:

http://www.leadwerks.com/files/Tutorials/Lua/Getting_Started_With_Lua.pdf

 

See pages 10-14 for information on class scripts, especially starting at page 12. On page 18 it shows how to make an object turn each frame in the editor, using a class script.

 

The command documentation is all in the wiki. Start here:

http://www.leadwerks.com/wiki/index.php?title=Entities

 

We're also in the process of getting an example character animated, so it can be used for a "make a game" type tutorial.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I get the feeling thats not the sort of documentation he is after :D

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...