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.

AppGameKit Classic Chat / Lua & AGK.

Author
Message
Alpha Mike
13
Years of Service
User Offline
Joined: 22nd Aug 2010
Location: Bristol, UK
Posted: 14th Jul 2012 22:11 Edited at: 14th Jul 2012 22:13
Hey folks,

I am currently writing a Tier 2 (C++) app. I've been hearing about Lua and I thought it might be a good idea to try and integrate it into my game.

Then I figured it might actually not work at all with the way AppGameKit works. So I figured I would come to you lovely people and see if anyone has had success with this, should I or should I not put any effort into Lua?

Cheers,

AM

Edit: I got the wrong Tier
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 15th Jul 2012 00:10 Edited at: 15th Jul 2012 00:25
That's the question that has bothered me lately too.

I think that unless we can read file contents to an characters' array / string, then there's no way of integrating LUA, since it has one fuction called "lua_dofile", which uses C / iostream / whatever to open up files and "do" them.

Must look deeper into it.

@EDIT

Have a look into that.

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

Should be possible to integrate one.


@EDIT2

You can use this guy's work:

https://github.com/mkottman/AndroLua

It seems he has ported LUA to integrate with both android SDK and NDK. He's been nice enough to even give out a library there.

Follow me on twitter! @MotionStruct
Motion Struct blog
Airslide
19
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 16th Jul 2012 23:57 Edited at: 16th Jul 2012 23:57
Lua is fairly platform independent, if you are utilizing Tier 2 then you should be able to integrate it with your game without issues - you'll just have to write all the 'glue' code between the Lua state and your engine yourself.

It might be worthwhile to look at LuaJIT, which is faster and has tested compatibility with a wide range of platforms, including iOS and Android (although the iOS version will not give you the JIT compiler, the interpreter should still be faster than the stock version).

Quote: "I think that unless we can read file contents to an characters' array / string, then there's no way of integrating LUA, since it has one fuction called "lua_dofile", which uses C / iostream / whatever to open up files and "do" them."


Why would this be a problem? I haven't looked closely at AGK's file commands but virtually every major platform supports C's standard IO facilities. You can also load Lua functions from a string (note that Lua script "files" are actually functions, which is why you "do" them), and I can't imagine AppGameKit lacks a ReadString command.
Alpha Mike
13
Years of Service
User Offline
Joined: 22nd Aug 2010
Location: Bristol, UK
Posted: 19th Jul 2012 22:45
Ah cool Airslide.

I might have a go and see if I can make a simple app with some LUA scripts involved.

Would be nice to get the experience too.


Cheers,

AM

Login to post a reply

Server time is: 2024-05-05 18:59:31
Your offset time is: 2024-05-05 18:59:31