Jump to content

  • Log In with Google      Sign In   
  • Create Account

Shadowraix

Member Since 23 Nov 2012
Offline Last Active Feb 25 2016 05:07 PM

Posts I've Made

In Topic: Embedding Lua in C# with P/Invoke

25 February 2016 - 03:13 PM

Thanks for the detailed information once again. I'm slowly working through everything. So my program has an error saying that the entry point 'lua_pcall' cant be found. The tutorial I followed in OP was based on Lua 5.1, but heres the culprit code I believe.

        [DllImport("lua53.dll", EntryPoint = "lua_pcall", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
        public static extern int lua_pcall(IntPtr lua_State, int nargs, int nresults, int errfunc);

        //simplify the execution of a Lua script
        public static int luaL_dostring(IntPtr lua_State, string s) {
            if (luaL_loadstring(lua_State, s) != 0)
                return 1;
            return lua_pcall(lua_State, 0, LUA_MULTRET, 0);
        }

In Topic: Is it worth it to learn LUA scripting for the AAA game industry?

25 February 2016 - 01:51 PM

You can just read the online version instead of forking out before knowing whether you need it smile.png

http://www.lua.org/pil/contents.html

This is for Lua 5.0. Latest is 5.3.2 just making that known so there will be significant differences.

 

Lua was my first programming language then I transitioned to Java and C#. One of my C# Projects will integrate Lua. Its pretty easy to learn, simple, fast, extendible. Go for it.


In Topic: Embedding Lua in C# with P/Invoke

25 February 2016 - 09:37 AM

I wanted the same thing a while ago and rolled my own for my game engine.  If you want, please take a look at my Lua bindings for C# at: https://github.com/bholcomb/Lua-  There is a thin layer on top of the pinvoke bindings, which covers about 99% of the Lua API.  I wrote c# functions to implement the macro's in the lua header as well.  If you only want the "pure" C api, then you should only need what is in the LuaDll.cs file.  The LuaState and LuaObject are part of my thin wrapper. 

 

It has the full lua 5.3.2 source built as part of the project, so you should only need to download, then run the build config (premake) then build the project to produce all the dlls you need.  It is expecting lua5.3.dll in a x86 or x64 folder where you run your executable from.  You can change how this works in the dllLoader class in the luaDll.cs file.

 

There is also a simple test console written in C# that uses the Lua#.dll to verify that it's working.  

 

Please let me know if you find any bugs or have any questions.

 

cheers, 

 

Bob

Thanks for the detailed reply! I'm looking to do this myself for the experience. So if you can guide me a little bit i'd appreciate it.

The tutorial I followed required me to build the Lua DLL myself for a few reasons:

1. Calling Conventions (Changing it to __stdcall in VS settings)
2. Decorated functions (Using a .def file, but that solution didn't work for me)

3. C Manifest (It describes how its built into the DLL but needs a standalone manifest too)

 

Is this a non-issue for you? Did you modify how the DLL is built or is it a simple import files and compile? I'd like to know how you solved these potential issues.

 

Are the LuaObject and LuaState CS files just wrappers so users of the library can use those to simulate those objects rather than using IntPtrs all the time?


In Topic: Title for game? [Solved]

31 December 2013 - 12:32 AM

Hmm the roleplaying part was already covered in my first batch of words, I thought.  Since you didn't like the style of them, I'm not sure how to work that idea in in a way that appeals to you.  Though I didn't try words related to talking - that would give you options like CreatureChat, Creature Forum, Amphora (a kind of Greek vase, but it's like animal forum), Bestiary (old book with pictured of all different animals, like a zoo).  Of the second batch ones that you liked, Animal Ascension is probably my own favorite.  I'm not really all that fond of the concept of an "alpha" personality or social role - over in romance novel land there's a term "alphahole" that's used to express the way alpha humans are often more irritating than admirable.  But let's see, if I mix around the ones you liked and try to make them non-specific to wolves... Creature's Claim or Creature Claim, Claim of Animality, Beast Claim, Faunaclaim, Pack Claim, Outcast Pack, Animalarchy (lol that's like a multipun with anarchy and malarkey), Archimal, Archimality, Faunarchy, Faunoutcast, Predoutcast, Creaturescension, Faunascension

 

I'd personally avoid using "vore" in the title because of the existence of the vore fetish.  Yeah people might roleplay that but it shouldn't be presented as the main or only subject for roleplay.

Thanks for all of your help. I discussed titles with a few people and Animal Ascension had majority vote so I will be going with that. Probably would take me months to come up with a name if it weren't for you. Thanks a lot!


In Topic: Title for game? [Solved]

30 December 2013 - 06:15 PM

Well what is the player's main goal or main activity in the multiplayer part?

Well, that can vary depending on what the player wants to do. However, the main focus of the multiplayer is roleplay. Be the animal you want to be and roleplay with others. Of course you don't have to. If you so wish you could explore, socialize, or fight others if you so wished.


PARTNERS