Easy to install Scripting Languages in Visual Studio

Started by
4 comments, last by Shaarigan 5 years, 6 months ago

Hello Everyone,

I just have a general question about scripting.

Currently I am using Visual Studio and Lua 5.3.3. I need to be able to access C++ classes through Lua, which means I need to be able to use Luabind or Luabridge. For the life of me, I can't get these to work ( with respect to the former, I don't really want to use boost either ).

I am wondering if there's another scripting language out there, which is easy to to integrate with Visual Studio so I can move on with my life? Perhaps with existing .dll and .lib files.

Thanks so much,

Mike

Advertisement

If it has to be Visual Studio supported language, you could also try to wrapp your Cpp into a library and use C# to bootstrap your Cpp to have C# communicate with it

9 hours ago, fleabay said:

Can you say what you are trying to do? There may be simpler ways than using a full featured scripting language.

I would for example like to write debugging scrips which means I need to access my renderer class.

When making a game, I would like to script most of the ai, for example state machines, goals, variables etc.

What I really need is a simple to install script that can access C++ classes/functions ( and vice versa ) ( polymorphic or not ) without having to spend countless hours trying to get the scripting library to work.

In my limited experience, with a *.lib and *.dll integrating a library in visual studio is a breeze. So I am justi wondering if there's a solution out there for me.

Mike

9 hours ago, Shaarigan said:

If it has to be Visual Studio supported language, you could also try to wrapp your Cpp into a library and use C# to bootstrap your Cpp to have C# communicate with it

I am sorry I have no idea how to even start this process. Is there a tutorial somewhere?

If possible, I am looking for a simple solution.

Thanks again,

Mike

I've never used AngelScript, but my understanding is that it offers easy integration with C++ (or at least easier than e.g. Lua). If you haven't done so already, it might be worth taking a look.

You may have already seen it, but there's a list of Lua-C++ binding libraries hereOf course sorting through such a list can take some work in and of itself.

If LuaBridge seems promising other than getting it to work, you could post the problems you're having, and someone might be able to help.

Another possibility would be to write a lightweight binding module yourself. Unfortunately this in no way meets your requirement of being simple :| But, if you suddenly have the urge to dive into some template metaprogramming, it is an option.

You seem to struggle on basics so you should first learn how to structure your projects correctly and how to link libraries to your project.

.lib files are static linked libraries, you reference them as usally but they are placed directly into your program rather than stay aside

.dll files stay aside of your program and are solved at runtime

Take a look at the docs on how to load dependencies if you have problems solving this.

For my solution option you need to compile your code as native dll and put it aside to a short C# wrapper that will handle anything for startup. You need to expose some function that initializes your code similar to the main function and then write a short C# program that calls this function.

Here is also a short how-to showing how you use p/invoke to drive that route. You can then simply start ana dditional thread or whatever to run your "scripted" game code and call into your C++ app

This topic is closed to new replies.

Advertisement