Jump to content

[HELP] Implementing Lua


Recommended Posts

Posted

This SVN is years outdated xD

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 :)

Posted
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.

Posted
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

Posted

So.... Basicaly Lunar is some kind of C++ LUA?! xD

I need to know if there is someking of something that can make MaNGOS use ArcEmu's LUA....

Please post and Thanks Patman128 for the Lunar link

Posted

if you use lua or any other language that isnt C++ you would be limited to a subset of exported functions to interface your scripts and the core

maybe what you want is an arcemu script compatibility layer right?

Posted

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 .

Posted
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.

Posted
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.

Posted
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.

Posted

im new to mangos, old school arcemu guy, alot of my server stuff uses lua... hyparclua in fact and i am switching to mangos indefinately so if there is a way to implement lua, in the words of the old blind man... I wish i could see it

Posted

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...

Posted

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.

×
×
  • 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