Hi, Since I got the DGSDK a couple of days ago I have been working to integrate lua and create some examples of lua`s capability and potential within the DGSDK. Here is an example that I made yesterday and today. I shall explain how it works.
When the application is run, a script called main.lua is activated and this sets up the program. If nothing is in main.lua then the app is just a blank loop and is generally very boring.
There are a few commands I have created, they are
id=createObject(scriptname)
colorObject(id,r,g,b)
rotateObject(id,x,y,z)
positionObject(id,x,y,z)
moveObject(id,distance)
Ok, so nothing you can create the next NWN with, but let me explain the fist command. It returns the objects id number so you can use it to further setup the object using main.lua. The scriptname is the script that will be executed for that particular object when its event is fired. By default its event is fired every 10 loops but you can change this using setInterval(id,num_of_loops).
Also in the scripts for each personal object you have to get the id of the object you are working with (I will change it so that it defaults to the current object in the future). For now you have to use the getCurrentId() command. The lua language supports all kinds of loops and conditional statements, arithmetic etc. The examples included will probably explain more. See if you can think of any good things to change or include with this example.
[EDIT] I uploaded the file to my server. Can be downloaded by
http://logicstudios.net/script.exe
[/EDIT] Sorry for the confuzzlement
The 3d chat is coming...
Rights For Traffic Cones!