Re: Object Oriented Programming in Maratis(LUA)(Tutorial)

Ah hell, i tought it was ok, but the problem's not gone -.-
I'm gonna make a detailed topic about it later today, because there's also other stuff that's not working correctly sad

Re: Object Oriented Programming in Maratis(LUA)(Tutorial)

I stumbled across something interesting when wondering if I can use a function as an argument:
http://stackoverflow.com/questions/1698 … ter-in-lua

function init() 
     print("init");
end

block = { 
     startup = init
}

They also say the two examples below are the same:

function foo()
end

foo = function()
end

Last edited by Tutorial Doctor (2014-03-02 19:41:31)

Re: Object Oriented Programming in Maratis(LUA)(Tutorial)

joe = {name =nil, age =nil, gender =nil}

joe.name = "Joseph"
joe.age = "24"
joe.gender = "Male"

I am wondering if such code would work, and I am wondering if I could put functions into the table also to do simpler OOP.

Re: Object Oriented Programming in Maratis(LUA)(Tutorial)

function foo() end  foo = function() end


in the Cryengine used to this style of programming.
also it is possible in javascript to write.

joe = {name =nil, age =nil, gender =nil}   
joe.name = "Joseph" 
joe.age = "24" 
joe.gender = "Male"


what's special? Lua allows you to do much more interesting things!

Re: Object Oriented Programming in Maratis(LUA)(Tutorial)

Yeah, lua is looking more flexible every day. I think I need to learn some of the other languages alongside lua so I can actually see the flexibility of it.