PLUGIN: Lua for AGS

Started by Denzil Quixode, Fri 04/09/2009 19:30:22

Previous topic - Next topic

Calin Leafshade

There is significantly more.

The AGS-Lua link is purely manual. If you want to trigger AGS events in lua then you need to wire that up yourself.

You need a fairly good grasp of programming before you'll be able to understand how this is done.

Crimson Wizard

#141
Quote from: dbuske on Thu 11/09/2014 14:04:14
Ok, I converted the intro room script to Lua.
Do I put the Lua code in place of the original ags room code.
Or is their more?
There's an explanation with script examples in the very first post of this very thread.

In short, you are to put "Lua.RunScript("whatever_name_i_have.lua");" in game_start, and then put "Lua.Call("my_function_name")" whenever you want to call a function from lua script.

dbuske

Thanks for the replies.  Looks like I won't be able to use this.
What if your blessings come through raindrops
What if your healing comes through tears...

ChamberOfFear

Just for information. When I go to the download page it says "Subscription Expired". No downloads available.

Dualnames

http://duals.agser.me/Plugins/LuaForAGS_v4.rar

Found an old cd, and it had a version of certain plugins and one of them happened to be lua.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

TheNaiker

Hi,
sorry for writing in this old topic, but I have a problem with this plugin.
I have installed it correctly and it works fine with simple lua scripts. But now, in order to write my real code, I need another lua module (luasql.sqlite, exactly).
In this case, what should I do? I am not expert about how Lua Works and I haven't found any dll for that module; and If I am not wrong the modules I got must be installed directly into lua.

Can you give me any hint?

Thanks.
Hi, this signature is not funny because my imagination is actually on holiday.

Monsieur OUXX

Quote from: TheNaiker on Wed 11/05/2016 08:02:21
Hi,
sorry for writing in this old topic, but I have a problem with this plugin.
I have installed it correctly and it works fine with simple lua scripts. But now, in order to write my real code, I need another lua module (luasql.sqlite, exactly).
In this case, what should I do? I am not expert about how Lua Works and I haven't found any dll for that module; and If I am not wrong the modules I got must be installed directly into lua.

Can you give me any hint?

Thanks.
You'd be probably better off asking on the Lua forums, but I'm sure Calin Leafshade will help if he sees your update (did you try PM'ing him?)
 

TheNaiker

#147
Quote from: Monsieur OUXX on Wed 11/05/2016 09:30:08
Quote from: TheNaiker on Wed 11/05/2016 08:02:21
Hi,
sorry for writing in this old topic, but I have a problem with this plugin.
I have installed it correctly and it works fine with simple lua scripts. But now, in order to write my real code, I need another lua module (luasql.sqlite, exactly).
In this case, what should I do? I am not expert about how Lua Works and I haven't found any dll for that module; and If I am not wrong the modules I got must be installed directly into lua.

Can you give me any hint?

Thanks.
You'd be probably better off asking on the Lua forums, but I'm sure Calin Leafshade will help if he sees your update (did you try PM'ing him?)

I've done that some day ago(with another question, to be honest), but I've got no answer.
You know, I found a "sqlite3.dll" file, but I fear it's not enough - I'd should add something which allows comunication between lua and sqlite, shouldn't I? :P Before asking to official lua forums (where I am not sure they know about this old plugin) I wanted to ask here, I'll be waiting some time. :)
Hi, this signature is not funny because my imagination is actually on holiday.

Snarky

#148
I would start by writing a proof-of-concept test just in Lua (without AGS) to access SqlLite. This seems to be how to load a DLL: https://www.lua.org/pil/8.2.html, or you could try this: http://alien.luaforge.net/

If you can't get that to work, you need Lua-specific help. If you can, it should also work in AGS, and if it doesn't there might be something you need to do with the plugin or AGS build.

TheNaiker

Thanks, your second hint looks to be good. I typed this
Code: lua
function readDb (ID)
assert (package.loadlib("sqlite3.dll", "luaopen_luasql_sqlite3"))()  
env = luasql.sqlite3()
con = env:connect("test.db")
res = con:execute("create table person( id integer primary key,name text not null, email text, phone text)")
con:close()
env:close()
a = 12
return a 
end

And after compiling and running the "test.db" file has been created without error messages. (I used the A variable to see if Ags runs the script)
I will make further tests, but I am satisfied with this. Thanks again.
Hi, this signature is not funny because my imagination is actually on holiday.

Snarky

#150
Sweet! I don't know Lua, but that looks good so far. And thanks for posting your sample code, I'm sure that could be helpful for others.

Hope it works out.

eri0o

Hey! What's the status of this plugin? Is there an update? Is source code available somewhere? The first page link points to an expired wiki.

I played a little bit with love2d this weekend and would like to test using lua to use shaders :]

Crimson Wizard

Quote from: eri0o on Mon 22/01/2018 21:10:05
Hey! What's the status of this plugin? Is there an update? Is source code available somewhere? The first page link points to an expired wiki.

We have this plugin as submodule in our repository. Actual repository is https://github.com/duncanc/Lua-for-AGS/commits/master

The status of plugin is unknown. It seems to be made in such way that requires continious sync with the engine to have full support. Yet it was last updated in 2013, which means it cannot work with the any recently added engine API.
Also the reason I believe we should drop supporting this plugin when developing AGS 4 branch, because plugin is strictly tied to the engine's data layout in memory. Unless there would be a maintainer who rewrites it in a different way.

eri0o

Answering to myself after an year, I just started taking a look into this plug-in to see how the hell it works.

Apparently a part of the code is generated by a script. I also didn't find that script yet.

Unfortunately it doesn't use the proper Engine plug-in API and instead does weird things as CW suggests.

About my own questions on Shaders, which is unrelated to it, but I was too dumm at the time to know, it's a different issue. It would require AGS to expose the texture where screen is drawn or something similar for the plug-in interface, which right now only has the "screen bitmap", which only exists using Software Render and is only exposed on the plug-in interface of Windows build of the engine. Shaders are doable on a plug-in side if it's possible to access the texture that's going to be presented to the screen. It would probably be an OpenGL only feature.

SMF spam blocked by CleanTalk