Jump to content

[HELP] Implementing Lua


Guest desch

Recommended Posts

And VladimirMangos... I know that MaNGOS is made for Blizzlike server and can only use C++, but LUA is more easy and some players want it, so they can script more Blizzlike and more faster :)

You not understand my point. Scripting implemented in scripting library, and you can add lua engine to scripting library. Mangos code not need know what scripting language you use in scriping library and then this not mangos core problem. You can add to same scripting DLL and LUA and python and VB and anything more. For mangos core only need that when it call some scritpintg API then scritps proccess its propertly.

Link to comment
Share on other sites

You not understand my point. Scripting implemented in scripting library, and you can add lua engine to scripting library. Mangos code not need know what scripting language you use in scriping library and then this not mangos core problem. You can add to same scripting DLL and LUA and python and VB and anything more. For mangos core only need that when it call some scritpintg API then scritps proccess its propertly.

You mean that MaNGOS supports LUA right now ?! xD

And will you tell me how to use it :D please

Link to comment
Share on other sites

You mean that MaNGOS supports LUA right now ?! xD

And will you tell me how to use it :D please

Any scripting language that can bind with C++, mangos "supports." That is what he is talking about.

If you actually know C++, I would recommend you read up on Lunar. Also look into how Arc's Lua system works for a good example of using Lunar.

Simple example:

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

Link to comment
Share on other sites

In C++ you are also restricted to a set of functions, the interface is just larger and easier to implement. Each language has its disadvantages and advantages. If we take the perspective of a developer Mangos there is indeed no interest, but if we take the perspective of those succeptibles develop IA I think the majority preferred to code in Lua .

Link to comment
Share on other sites

In C++ you are also restricted to a set of functions, the interface is just larger and easier to implement. Each language has its disadvantages and advantages. If we take the perspective of a developer Mangos there is indeed no interest, but if we take the perspective of those succeptibles develop IA I think the majority preferred to code in Lua .

Lua is not good for coding AI's. It's just not fast enough. Going through Lua on every creature update cycle for every creature would just be a disaster. This is the primary problem with making a Lua binding: people would use it disasterously and then give mangos QQ when it doesn't work well.

There are also a few other problems. For example, if you want to store a timer variable in an AI, it would have to be stored outside of Lua anyway, and passed back and forth between AI calls, only further slowing things down.

Lua's only realistic use would be for GO/item use, gossip scripts, and other such "one-shot" functions. I was considering making an interface that supported these functions. If there is actual interest I might consider giving it a shot.

To code AI's: use C++, use EventAI, or don't.

Link to comment
Share on other sites

Lua is not good for coding AI's. It's just not fast enough. Going through Lua on every creature update cycle for every creature would just be a disaster. This is the primary problem with making a Lua binding: people would use it disasterously and then give mangos QQ when it doesn't work well.

There are also a few other problems. For example, if you want to store a timer variable in an AI, it would have to be stored outside of Lua anyway, and passed back and forth between AI calls, only further slowing things down.

Lua's only realistic use would be for GO/item use, gossip scripts, and other such "one-shot" functions. I was considering making an interface that supported these functions. If there is actual interest I might consider giving it a shot.

To code AI's: use C++, use EventAI, or don't.

Do you really believe it's _THAT_ way slower? Have you done any C++ vs LUA vs Python benchmarks? I assume you know that LUA doesn't need to compile the code each time it's executed.

I know this kind of topic is here somewhat often, but I'd really like to see some benchmarks if anyone has done any.

Link to comment
Share on other sites

Do you really believe it's _THAT_ way slower? Have you done any C++ vs LUA vs Python benchmarks? I assume you know that LUA doesn't need to compile the code each time it's executed.

I know this kind of topic is here somewhat often, but I'd really like to see some benchmarks if anyone has done any.

I was just about to say that the LUA would probably be compiled or similar.

Link to comment
Share on other sites

ok... I dont know if i am the only one seeing this, this way but... here is what I see:

1. MaNGOS has absolutely nothing to do with LUA.. if you want to implement it, implement it to ScriptDev2 ( i.e. go over to their forum and start this thread...)

2. each and every person pining for LUA compatibility is an ex- Ascent or ArcEMU user... if this is such... keep using those programs.. MaNGOS is ScriptDev run, has been scriptdev run for quite some time, and those of us who actually respect actual code rather than cheap XML knockoffs want to keep mangos Mangos.. not be forced to use the inferior LUA system.

3. batboy... open ur damn eyes and read what they are telling you... LUA is NOT a part of mangos... the google-crap you found was an extraneous project that eventually led to Ascent. it is NOT mangos..

i swear if i had a dollar for every freakin idiot who cant read but also think they should be allowed to program a computer I'd be lending money to Bill Gates...

Link to comment
Share on other sites

1. MaNGOS has absolutely nothing to do with LUA..

That's true.

if you want to implement it, implement it to ScriptDev2 ( i.e. go over to their forum and start this thread...)

ScriptDev2 is a C++ scripting library, LUA could be *just* another scripting library, mangos can run with any scripting library you create, not just with SD2. The (most likely) correct way of LUA implementation would be to write a small translational C/C++ library for mangos and implement all LUA processing above it, using this C/C++ piece of code as an abstract layer. Inserting "run my all-in-LUA script library" code into mangos itself is not that clean.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use