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 / Unity - The DarkBASIC Scripting Pack

Author
Message
tomjscott
19
Years of Service
User Offline
Joined: 18th Aug 2005
Location:
Posted: 21st Dec 2005 19:12
Anyone know if this plugin is going to be ported to Dark Game?
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 22nd Dec 2005 00:19 Edited at: 22nd Dec 2005 00:19
[href]www.lua.org[/href]
That is the official Lua site. Since lua is designed to work with C++ (as far as I know) it should be easy enough to implement it yourself. There is just one problem : when you download it how do you unzip a .tar.gz file?
Vlad
19
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 22nd Dec 2005 00:31
Winace or Winrar should probably deal with it.

I'm pretty sure I know everything. Doubts are something rare in me and I am never wrong, as this signature can prove.
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 22nd Dec 2005 00:38
I thought it needed a tar extractor and a gzip extractor but where can you download them?
Vlad
19
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 22nd Dec 2005 01:02
Nah! WinRar supports it, just checked my own.

www.rarlab.com

I don't use another than this one, opens everything, including tins of cat food.

V

I'm pretty sure I know everything. Doubts are something rare in me and I am never wrong, as this signature can prove.
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 22nd Dec 2005 01:10 Edited at: 22nd Dec 2005 04:21
Thanks, I managed to get it extracted: got any links to good beginners tutorials, which tell me what to include, and what to link as library files etc.?

[edit] Actually if you are fairly good at C++ then use the tutorials on this site: http://www.codegurus.be/codegurus/Programming/luaintroduction_en.htm

- The site offers much help in setting up an application to use Lua (something I couldn’t find in any of the official manuals)
Vlad
19
Years of Service
User Offline
Joined: 5th Oct 2005
Location:
Posted: 22nd Dec 2005 01:23
No idea, sorry. I'm pretty new to C++ and never worked with that lib.

I'm pretty sure I know everything. Doubts are something rare in me and I am never wrong, as this signature can prove.
Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 22nd Dec 2005 17:08
I have used Lua with a couple of binds in the past and am now using a different scripting language called GameMonkey (http://www.somedude.net/gamemonkey/). Since you are just beginning and won't be losing any work, can I suggest you try that language instead of Lua. I found the bindings much easier, and it is easier to debug.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 22nd Dec 2005 17:28 Edited at: 22nd Dec 2005 17:29
Hi,

It's better to use Lua directly with DGSDK, since you're in C++.

If you want help I can help It's pretty easy. You also get the added bonus of being able to bind C functions with Lua.

Do a search for "Lua" on this board - mnemonix did some work with it a while ago.

Good luck.

Torrey
20
Years of Service
User Offline
Joined: 20th Aug 2004
Location: New Jersey
Posted: 23rd Dec 2005 05:25
GameMonkey was built with the concepts of Lua and expanded with improvements that benefit game programmers. Just like Miguel said, it's really easy to work with. If you want to save time you can use my plugin that is in my sig with your project. It uses GameMonkey at its core. I'll be creating a usable C++ library soon, but if you wanted to use my plugin you can view the exported api by using a program called "depends" and make calls to the DLL from C++.

Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 23rd Dec 2005 23:22 Edited at: 23rd Dec 2005 23:23
I did the search for the work that was done with Lua on these boards and it didn’t really explain my problems. I am currently using the extern command to load in the headers. This works fine but I get all kinds of unresolved external errors when I try to use the Lua commands for loading a script file. I end up including all the headers in the ‘src’ folder in a new folder included with my project. I am just wondering if there is a more efficient way of doing this?

It would be really good if someone was to write a beginners tutorial on using Lua with C++ and loading scripts from a file.

Happy Christmas people!
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Dec 2005 12:08
Hi,

When I get on my dev machine later I'll look at exactly what I'm doing. I'm sure I'm:

linking to lua.lib
including Lua.h (and lualib.h) using extern

and that's it. I'll check later. Do you have the compiled lua.lib? For some reason the package doesn't come with it.

Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 24th Dec 2005 12:18 Edited at: 24th Dec 2005 12:19
No I don't have that file. What are the advantages of using it and where can I get it?
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Dec 2005 13:12 Edited at: 24th Dec 2005 13:13
Lua.lib is all of Lua, compiled together into one distributable file. For some reason, Lua isn't supplied compiled - you get all the source and have to compile it yourself. Attached is the zip I use containing all you need, compiled.

Extract this zip to a folder somewhere (I have C:/C++/Lua).

In VC++, click Tools -> Options then click the directories tab. Click the "new" button top right (looks like a dotted box with a star top left and then a new row should appear, click the "..." button to browse to the directory where you extracted the zip file.

Click OK. You can now include the lua library and include file from any project.

What I do in my Lua projects:

- Project, Settings, Link - where it says "object/library modules" I add "lua.lib lualib.lib" to the end of that text box.

- Use the following code in my program to load Lua



Remember becuase you added the dir with the include files / lib files to your Directories tab you don't need to copy any of the files you're including to your current working folder.

I then just do



to get a Lua state and you're off.

Once you've got it set up this tutorial is good for learning how to use the engine. http://www.gamedev.net/reference/programming/features/lua/page2.asp

Attachments

Login to view attachments
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 28th Dec 2005 23:05 Edited at: 28th Dec 2005 23:59
I'll try that soon thank-you for the help.

[edit] Bad problems, you know the Projects-Link... part I don’t think you are using Visual Studio.NET 2003 - when I try your code example to start a new Lua state I get unresolved externals.

Login to post a reply

Server time is: 2024-11-19 03:32:04
Your offset time is: 2024-11-19 03:32:04