• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

lua > xml ? get finaly rid of xml!

What do you think about this?


  • Total voters
    23
@Evil Hero ofc following this logic we could get rid of SQL and use lua tables as db instead, since sql is limiting us to do funny things like
Code:
Account = { [name] = "str" ... }
if os.time() == 123456789 then
Account = { [name] = "rts" ... }
I have a lua database type running but it's not for public yet, still to much work to put in it.

example of usage (same as scripts/example.lua)
Code:
-- default callbacks
local onEquip = function(player, item, slot)
   return true
end

local onDeEquip = function(player, item, slot)
   return true
end

-- Test Action Script
local action = Action()

function action.onUse(player, item, ...)
   item:transform(item:getId() == 1945 and item:getId() + 1 or item:getId() - 1)
   return true
end

action:aid(2000)
action:register()
--

-- Test Talkaction Script
local talk = TalkAction("!test")

function talk.onSay(player, words, param)
print("test ".. param)
return false
end

talk:separator(" ")
talk:register()
--

-- Test MoveEvent onEquip Script without actual lua function just default callback
local equip = MoveEvent()
equip.onEquip = onEquip -- setting it the default callback
equip:itemId(2400)
equip:slot("shield")
equip:level(100)
equip:magicLevel(50)
equip:register()
--

-- Test MoveEvent onDeEquip Script without actual lua function just default callback
local equip = MoveEvent()
equip.onDeEquip = onDeEquip
equip:itemId(2400)
equip:register()
--

-- Test MoveEvent onStepIn Script
local step = MoveEvent()

function step.onStepIn(creature, item, pos, fromPosition)
   print(creature:getName(), pos.x, pos.y, pos.z)
   return true
end

step:itemId(413)
step:register()

-- Test CreatureEvent onTextEdit Script
local textedit = CreatureEvent("text")

function textedit.onTextEdit(player, item, text)
   print(item:getId(), text)
   return true
end

textedit:register()
--

-- Test CreatureEvent onLogin Script
local login = CreatureEvent("test")

function login.onLogin(player)
   local item = Game.createItem(1945, 1, player:getPosition())
   item:setActionId(2000)
   player:registerEvent("text")
   return true
end

login:register()
--
 
I have a lua database type running but it's not for public yet, still to much work to put in it.
are you for real?
why are you getting rid of something that are meant for that? xml is the best choice for configuration files, and for database management there is nothing more safe than it, so why?
 
are you for real?
why are you getting rid of something that are meant for that? xml is the best choice for configuration files, and for database management there is nothing more safe than it, so why?
not easy enough
not fast to configure enough
takes too long to add features
bad organizing for custom servers.
 
not easy enough
so lets get rid of boost, asio and mutex for procotol listening, c++ isnt easy, we could use lua socket lib, since its hundred times easier.
Code:
require('socket')
local server = socket.bind('localhost', 7171)
if server:getpeername() == tibiaRSA then
       .. tibia protocols ..
       server:accept()
end
if server:receive(0x00) then
        server:send(0x01)
end
not fast to configure enough
what you mean?
takes too long to add features
ofc lets get rid of thousands of line in c++ and just make a binary to start lua things and move the server logic to lua, c++ takes too long to add features and test since it needs to be compiled, bullshit.
bad organizing for custom servers.
matter of opinion, for me xml is organized.
 
Last edited:
so lets get rid of boost, asio and mutex for procotol listening, c++ isnt easy, we could use lua socket lib, since its hundred times easier.
Code:
require('socket')
local server = socket.bind('localhost', 7171)
if server:getpeername() == tibiaRSA then
       .. tibia protocols ..
       server:accept()
end
if server:receive(0x00) then
        server:send(0x01)
end

what you mean?

ofc lets get rid of thousands of line in c++ and just make a binary to start lua things and move the server logic to lua, c++ takes too long to add features and test since it needs to be compiled, bullshit.

matter of opinion, for me xml is organized.
You didn't make it easier and more meaningful.
Your post just sounded like rant against an external improvement.
Nobody is forcing you to use Lua binds.

Each game/server creates his own systems to their needs, I find it more useful than xml.
 
You didn't make it easier and more meaningful.
was my way to say lua isnt better over xml, in same way xml isnt better than lua for script language.
Your post just sounded like rant against an external improvement.
it is NOT a improvement, configuration files arent meant to be customizable, just configurable, even with xml a wrong configuration can break up the server, just think a second how difficult would be cover all possibles crashs with lua that can returns a lot of values.
Nobody is forcing you to use Lua binds.
im not developing any server, if i was to, first thing that i'd do is get rid of lua, since it underperformace in most of cases.
Each game/server creates his own systems to their needs, I find it more useful than xml.
agreed, but no one is talking about in a server specifically, what im all about is tfs, since tfs is a community project it needs lua but in it purpose, which is SCRIPTING language, and i really think it has to have more functionality and more methods, if you are talking about what your server needs or someone else server's then i don't care, use what you think is better for it purpose.
 
was my way to say lua isnt better over xml, in same way xml isnt better than lua for script language.

it is NOT a improvement, configuration files arent meant to be customizable, just configurable, even with xml a wrong configuration can break up the server, just think a second how difficult would be cover all possibles crashs with lua that can returns a lot of values.

im not developing any server, if i was to, first thing that i'd do is get rid of lua, since it underperformace in most of cases.

agreed, but no one is talking about in a server specifically, what im all about is tfs, since tfs is a community project it needs lua but in it purpose, which is SCRIPTING language, and i really think it has to have more functionality and more methods, if you are talking about what your server needs or someone else server's then i don't care, use what you think is better for it purpose.

I agree that getting rid of xml and replacing with lua is bad, but being able to safely/properly register them in Lua could be something to add to TFS. If someone then wants to get rid of xml, just go ahead and delete the XML parsing functions and use only lua to register it.
 
@MatheusMkalo @Evil Hero @whitevo Use lua to configure are just waste of time, how many years are there config.lua in root folder? how many times did you see something like
Code:
if os.date() == thursday then
      worldType = "npvp"
end
i personally never saw this kind of configuration for any configuration posible in config.lua, so why should tfs be heading for this?
 
@MatheusMkalo @Evil Hero @whitevo Use lua to configure are just waste of time, how many years are there config.lua in root folder? how many times did you see something like
Code:
if os.date() == thursday then
      worldType = "npvp"
end
i personally never saw this kind of configuration for any configuration posible in config.lua, so why should tfs be heading for this?
I did not say configurate, I said register.

This would allow something like the mods back in 0.x when you could have entire scripts (actions, creaturescripts, etc) in one single file, making it easier to share/edit/organize entire systems that depend on multiple events.
 
This would allow something like the mods back in 0.x when you could have entire scripts (actions, creaturescripts, etc) in one single file, making it easier to share/edit/organize entire systems that depend on multiple events.
i agree, who is working in getting rid of xml could be spending his time in this kind of thing, i was not reffering on what you said, was just a thought for the topic.
 
Back
Top