otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.59k stars 1.06k forks source link

Still error #90

Closed PrinterLUA closed 11 years ago

PrinterLUA commented 11 years ago

Hi,

Well i claimed that there is function which have been moved from source to compat.lua and i get this error: https://github.com/otland/forgottenserver/issues/89

Ive download the latest from github, compiled but still same error what im doing wrong?

Thanks.

EvanMC commented 11 years ago

Well, Mark said you need to update your sources and recompile. I've tested this function to double-check; it seems to be working fine.

function onSay(cid, words, param)
    local t = getTownTemplePosition(1)
    print("{x = " .. t.x .. ", y = " .. t.y .. ", z = " .. t.z .. "}")
    return true
end

alt text

PrinterLUA commented 11 years ago

But ive already downloaded latest source, i think. Can you give me the link to your download, so i can retry. And could you tell me which boost and libraries you are using to compile? Myabe my compiler fucks it up.

EvanMC commented 11 years ago

I just downloaded from here: https://github.com/otland/forgottenserver (I haven't familiarized myself using the GitHub desktop app thingy to clone and all)

alt text

When compiling, make sure you update the project files.

I'm using the original SDK from Kornholijo with a change to update Boost to 1.53. I'm also using my method of compiling (modified settings.prop), that thread is outdated for the record. Maybe someday I'll do another tutorial (without modifying settings.prop) for compiling TFS 1.0 (no promises).

Anyways, this is all based on my experiences, I'm sure someone else can give you a much more reasonable and better answer.

PrinterLUA commented 11 years ago

Could you just please upload the exe file :/ until i get a dedicate server so i will use linux ^^

Thanks :D

dalkon commented 11 years ago

Everything works properly, make sure you update both your sources and data folder, then recompile.

PrinterLUA commented 11 years ago

I already done it, so please someone upload the latest compiled exe thanks :)

PrinterLUA commented 11 years ago

Between did anyone else try out the script i posted? and see if you get same error? Since i tested evan script didnt give any startup error, so what is the wrong with the script i got?

marksamman commented 11 years ago

You won't get any startup error with Evan's script because it has correct Lua syntax, the Town constructor is only called when onSay is called and your executable seems to be compiled without that.

PrinterLUA commented 11 years ago

How is it compiled without it? I just download it fresh, and added the code i provided and gave error. Are you sure that i could even use that function with table?

marksamman commented 11 years ago

We told you that IT IS COMPILED WITHOUT IT. That's all we can tell you, we don't have logs of your computer activity to tell you how the hell you managed to compile without it.

Besides, even if you get it to work, it's going to return false because towns haven't been loaded when the global Lua space is being evaluated.

Example script:

local townPositions = {
        [1000] = getTownTemplePosition(0),
        [1001] = getTownTemplePosition(1),
        [1002] = getTownTemplePosition(2),
        [1003] = getTownTemplePosition(3),
        [1004] = getTownTemplePosition(4),
        [1005] = getTownTemplePosition(5)
}
for k, v in pairs(townPositions) do
        print(k, v)
end

Output: 1002 false 1000 false 1004 false 1005 false 1003 false 1001 false 1002 false 1000 false 1004 false 1005 false 1003 false 1001 false