Jump to content

Creating A Lua Class


Shard
 Share

Recommended Posts

Hey guys, I have a quick question. How do I create a Lua file so that I can declare the class of each object? I want to do this so that I can read in each object with out having to check for each objects name, because that requires that each object be individually named and there can be typos and whatnot that can go wrong. If I code the class before hand, that problem is dealt with easily.

 

 

Thanks

-Shard

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Double-click on the class node in the editor to open the class script.

 

Thanks Josh, but I know how to open it. the problem that I'm having is that I don't know how to define a class in code.

 

From my level sbx:

Model {
path="info_player_node.gmf"
position=-1.00000000,1.00000000,18.0000000
rotation=-0.000000000,-0.000000000,0.000000000
scale=1.00000000,1.00000000,1.00000000
id=211024872
"class"="Model"
"name"="baseEnemy"
}

 

Instead of the name being baseEnemy, I want the class to be baseEnemy for all my baseEnemy nodes.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

  • 1 month later...
Guest Red Ocktober

a lil late on the reply... and you've probably found htis already... but if you haven't... look here --> lua script tutorial ...

 

 

scroll down to plage 14 for classes... it should at least give you a lil insight on what's going on...

 

good luck...

 

 

--Mike

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...