Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Lua in DGSDK

Author
Message
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 13th Dec 2004 00:02
Hi,

I just completed a couple of examples which make use of the LUA scripting system.

http://www.lua.org

It may prove invaluable for some of my DGSDK projects and its quite simple to use (I consider myself rubbish at C++, and I got it working fine).

It should integrate with DGSDK and can be used to control many aspects of games. If your going to be using DGSDK to develop a game engine then I would definately recommend this.

The 3d chat is coming...
Rights For Traffic Cones!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 13th Dec 2004 03:32
Can you pass values to and from Lua ?
And more importantly is execution synchronous or asynchronous ?
And can you execute only bits of it at a time ?

Beware the cat... The alien... The heretic...
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 13th Dec 2004 03:43
Yes you can pass values to and from Lua. Lua has its basic keywords such as for, next, do, if etc. and has a good structure. Then you can define functions in such manner within c++ so that you can obtain multiple pass values into c++ and also pass multiple values back into lua.

As for the other two questions, I am not sure. I will look into it further. When I get the SDK I may set up a simple header file that takes out some of the hard integration work, but for the most part the integration is simple anyway. Also lua comes with a basic library which you can choose to include or not include within your c++ app, this defines some functions for use in LUA, for example it defines the print function which works in console apps only I think.

The 3d chat is coming...
Rights For Traffic Cones!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 13th Dec 2004 03:49
Its always been a pain getting the values in and out again. LUA is nice though...

Beware the cat... The alien... The heretic...
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 13th Dec 2004 03:54
I need to learn a little more about it, but it will be great in creating structured projects. This would certainly facilitate the creation of a NWN type engine.

The 3d chat is coming...
Rights For Traffic Cones!
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 16th Dec 2004 09:11
I have been able to confirm what TCA said, LUA is indeed used in Warcraft 3. If it turns out to work well in my project and I get quite a bit better at using it and knowing how it works, I may post a tutorial on how to use it in your own project(knowledge permitting).

The 3d chat is coming...
Rights For Traffic Cones!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 16th Dec 2004 16:06
Hmm - I said Warhammer

Beware the cat... The alien... The heretic...
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 16th Dec 2004 22:01
You did?

My memory is broken lately. I should upgrade to 32MB in my brain.

Anyway, Warcraft 3 uses it too.

Warhammer does use it too so it must be at least quite capable .

The 3d chat is coming...
Rights For Traffic Cones!
enablerbr
21
Years of Service
User Offline
Joined: 22nd Jun 2003
Location: United Kingdom
Posted: 16th Dec 2004 22:19
it was the game farcry and its use of it. that made me take a look into a bit more. though i'll wait till after xmas to get the lua book.
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 16th Dec 2004 22:43 Edited at: 16th Dec 2004 22:54
If the book you are planning on getting is "Programming in LUA" then it is available for free in ebook format from the lua site.

I looked into it a bit more and it turns out you can either execute a whole file or single chunks in the runtime object. Its going to be quite difficult to learn, but a good asset once mastered.

The 3d chat is coming...
Rights For Traffic Cones!
Maleck
20
Years of Service
User Offline
Joined: 12th May 2004
Location: US
Posted: 24th Dec 2004 12:56
I have also been taking a look at LUA. I follow a couple MODs for Homeworld2 and all the scripting for that is done in LUA scripts. If I am not mistaken, even the maps are LUA scripts.

I'm glad to know that DB people are taking a look at integration with this.
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 24th Dec 2004 15:54
Its unlikely the maps are completely composed from lua files.
But the map loader controller thingy may be controlled by lua.
Then the map would probably lie in seperate media data files.
Anyway, it does have great potential, especially once you have appreciated its full power and how to fully work the API.

The 3d chat is coming...
Rights For Traffic Cones!
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Dec 2004 16:46
Just found this on hte LUA web site - shows how to access C classes within LUA:

http://lua-users.org/wiki/UserDataExample

The bit



Looks promising - this could mean that we'd eventually see



OOP DBpro?

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 24th Dec 2004 23:00
Definately have to look into this one .
Ill look into the API more after Chrimbo .

You guys have a good one

The 3d chat is coming...
Rights For Traffic Cones!
Ralen
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location:
Posted: 18th Jan 2005 21:35
World of Warcraft also uses LUA.

Ralen

Login to post a reply

Server time is: 2024-11-18 23:47:58
Your offset time is: 2024-11-18 23:47:58