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 / Barnski's Lua Plugin

Author
Message
entomophobiac
21
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 11th Feb 2009 22:10
I've been pulling my hair to get this to work. Now, I'm quite new to C++ in general, which means I'm not that versed in the fancy parts under the hood. So it might just be inadequate competence, after all.

But if anyone could possibly help me to get on the right track, just showing SOMETHING I can use to understand it better, it would be tremendously appreciated!

The largest issue I have is how to pass strings from a lua script to the program. Or even to load a script file in the first place. In fact, when I try to compile with just the make()-command, it fails to compile.

Anyone?
entomophobiac
21
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 12th Feb 2009 09:21
Just a small bit of tutorial?

Pretty-please?
Sweemoo
15
Years of Service
User Offline
Joined: 8th Jan 2009
Location: 127.0.0.1
Posted: 14th Feb 2009 08:03
first you have to include the directories for the files that came with Barnski's Library. The Lib file for the Lib Directories and Include for the header. Then set your Project to use Barnski'sLuaPlugin_debug.lib as an additional dependency



then in your Lua file (filename.file) you can just put



to define moo
entomophobiac
21
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 15th Feb 2009 12:23
Thank you so insanely much!

My oversight was the "additional dependency" portion. But now I'm live and kicking!
entomophobiac
21
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 15th Feb 2009 14:03
So, now I have it running... But I've quickly come to realize that there's no documentation for the GDK-version of the plugin. Or it's just sheer incompetence on my part.

If someone could help me even further, by explaining how to get a string from Lua (using the get_string() function) into a std::string, I'd be extremely grateful... I seem unable to wrap my head around the finer details of the built-in string class in general. And it essentially keeps halting my progress.

Sorry if I force you to become my C++ class, people.
Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 16th Feb 2009 00:08
Mh-m, I need LUA myself, so why not. Gimme a lill time.

Keep it simple.
Questions? Mail me
Redmotion
21
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 28th Feb 2009 18:29 Edited at: 28th Feb 2009 18:31
Some questions:

1. Can I use this LUA plugin with C++ 2008 Express? (Can't seem to get it to work at the moment)

I get this error (using code from Sweemo's post):



2. If I can, where's the best place to put the lib and the header files? Where in the menu system can I set up new directories for external libraries?

3. Slightly off topic - where to DarkGDK people usually put their 3d models, textures, etc?

Thanks.

War is terrorism with a bigger budget
Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 28th Feb 2009 19:12
1. Yes

2. Have you checked your compiler settings? And the project settings?.

Well, I like to put my libs in the same folder as the .exe, but that is what I like to do.

3. Where ever you want, I use to make a /media/ folder where I put all media for the project.

Keep it simple.
Questions? Mail me
Redmotion
21
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 28th Feb 2009 19:47
1. Good to know.

2. I think so. Under Tools/Options... Then under Projects & Solutions > VC++ Directories and finally under Show directories for: Include files & Library Files I've added the directory paths.

3. Tried that also, still no joy.

Thanks for trying.

War is terrorism with a bigger budget
Redmotion
21
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 28th Feb 2009 20:05 Edited at: 28th Feb 2009 20:06
Ok. Fixed this:

Right click on your project, choose Properties. Then Linker, then Input. Then add the lib to the Additional Dependencies bit at the top.

Talk about obscure.

War is terrorism with a bigger budget

Login to post a reply

Server time is: 2024-09-30 19:32:03
Your offset time is: 2024-09-30 19:32:03