Forum




RPG Server Bug After version 0.1.1.9
20 repliesnext time post in english section

what exactly doesn't work?
what error message do you see (console)?
you probably just didn't install it correctly because there are no changes on existing Lua commands/hooks
I don't understand him

Edit: Ahhh.. lol thought it was about RPG, normally I just read the titels..
Quote
my lua doesn't work
so I guess it's about an RPG Lua script. not enough information to help.
But what does the lua actually do?
And like DC said before, what error msg? (In the console)
~Edited
edited 1×, last 25.03.11 09:58:07 pm
DC has written
what error message do you see (console)?
"LOAD MAP: 'maps/ysize.map' does not exist
LUA ERROR:sys/lua/cs2dtibia/server.lua:20: 'for' limit must be a number"
Counter-Strike 2d/maps
WannaBe has written
map is okay, idk what's with ysize.map i never see or hear about it, i think the problem is in "sys/lua/cs2dtibia/server.lua:20: 'for' limit must be a number"
yes, but that is most likely to be a rather important thing having a missing map, as the map cannot be played if it does not exist.
the second error looks like a bug in the lua, and as far as i know it means that you're missing a limiting variable to limit one or the other thing.
just check if you haven't maybe edited the script, reread the instructions and if it doesn't work contact the writer of the script.
Quote
print('initialising...')
dofile('sys/lua/wrapper.lua')
math.randomseed(os.time())
dir = 'sys/lua/cs2dtibia/'
dofile(dir .. 'config.lua')
EXPTABLE = {}
for level = 1, 500 do
EXPTABLE[level] = CONFIG.EXP.CALC(level)
end
EXPTABLE.__index = function(t, k)
t[k] = CONFIG.EXP.CALC(k)
return t[k]
end
setmetatable(EXPTABLE, EXPTABLE)
GROUNDITEMS = {}
TILEZONE = {}
for y = 0, map'ysize' do
GROUNDITEMS[y], TILEZONE[y] = {}, {}
for x = 0, map'xsize' do
GROUNDITEMS[y][x], TILEZONE[y][x] = {}, {}
for i, v in ipairs(SAFEZONE) do
TILEZONE[y][x].SAFE = (x >= v[1][1] and x <= v[2][1] and y >= v[1][2] and y <= v[2][2])
if TILEZONE[y][x].SAFE then break end
end
for i, v in ipairs(PVPZONE) do
TILEZONE[y][x].PVP = (x >= v[1][1] and x <= v[2][1] and y >= v[1][2] and y <= v[2][2]) and i or nil
if TILEZONE[y][x].PVP then
TILEZONE[y][x].SAFE = false
break
end
end
for i, v in ipairs(HOUSES) do
TILEZONE[y][x].HOUSE = (x >= v.pos1[1] and x <= v.pos2[1] and y >= v.pos1[2] and y <= v.pos2[2]) and i or nil
TILEZONE[y][x].HOUSEDOOR = (x == v.door[1] and y == v.door[2]) and i or nil
TILEZONE[y][x].HOUSEENT = (x == v.ent[1] and y == v.ent[2]) and i or nil
if TILEZONE[y][x].HOUSE or TILEZONE[y][x].HOUSEDOOR or TILEZONE[y][x].HOUSEENT then break end
end
end
end
PLAYERS = {}
PLAYERCACHE = {}
HUDImage = image('gfx/weiwen/1x1.png', 565, 407+#CONFIG.STATS*CONFIG.PIXELS/2, 2)
imagescale(HUDImage, 130,CONFIG.PIXELS+#CONFIG.STATS*CONFIG.PIXELS)
imagealpha(HUDImage, 0.5)
SKY = image('gfx/weiwen/1x1.png',320,240,2)
imagescale(SKY,640,480)
imagecolor(SKY,0,0,32)
MINUTES = 0
GLOBAL = {}
GLOBAL.TIME = 0
GLOBAL.RAIN = 0
dofile(dir .. 'functions.lua')
dofile(dir .. 'admin.lua')
dofile(dir .. 'commands.lua')
dofile(dir .. 'items.lua')
dofile(dir .. 'npcs.lua')
if CONFIG.MAXMONSTERS > 0 then
dofile(dir .. 'monsters.lua')
end
dofile(dir .. 'hooks.lua')
HUDRadar = image("gfx/weiwen/pokeball.png", 53, 53, 2)
TMPGROUNDITEMS = {}
TMPHOUSES = {}
local file = io.open(dir .. "saves/" .. map'name' .. ".lua")
if file then
io.close(file)
dofile(dir .. "saves/" .. map'name' .. ".lua")
for y = 0, map'ysize' do
if TMPGROUNDITEMS[y] then
for x = 0, map'xsize' do
if TMPGROUNDITEMS[y][x] then
for _, j in ipairs(TMPGROUNDITEMS[y][x]) do
if j < 0 then
spawnitem(1337, x, y, -j)
else
spawnitem(j, x, y)
end
end
end
end
end
end
for i, v in pairs(TMPHOUSES) do
for k, l in pairs(v) do
HOUSES[i][k] = l
end
end
TMPGROUNDITEMS = nil
TMPHOUSES = nil
end
local file = io.open(dir .. "saves/players.lua")
if file then
io.close(file)
dofile(dir .. "saves/players.lua")
end
file = nil
parse("mp_infammo 1")
parse("mp_deathdrop 4")
parse("sv_password " .. CONFIG.PASSWORD)
print('initialisation comleted!')
dofile('sys/lua/wrapper.lua')
math.randomseed(os.time())
dir = 'sys/lua/cs2dtibia/'
dofile(dir .. 'config.lua')
EXPTABLE = {}
for level = 1, 500 do
EXPTABLE[level] = CONFIG.EXP.CALC(level)
end
EXPTABLE.__index = function(t, k)
t[k] = CONFIG.EXP.CALC(k)
return t[k]
end
setmetatable(EXPTABLE, EXPTABLE)
GROUNDITEMS = {}
TILEZONE = {}
for y = 0, map'ysize' do
GROUNDITEMS[y], TILEZONE[y] = {}, {}
for x = 0, map'xsize' do
GROUNDITEMS[y][x], TILEZONE[y][x] = {}, {}
for i, v in ipairs(SAFEZONE) do
TILEZONE[y][x].SAFE = (x >= v[1][1] and x <= v[2][1] and y >= v[1][2] and y <= v[2][2])
if TILEZONE[y][x].SAFE then break end
end
for i, v in ipairs(PVPZONE) do
TILEZONE[y][x].PVP = (x >= v[1][1] and x <= v[2][1] and y >= v[1][2] and y <= v[2][2]) and i or nil
if TILEZONE[y][x].PVP then
TILEZONE[y][x].SAFE = false
break
end
end
for i, v in ipairs(HOUSES) do
TILEZONE[y][x].HOUSE = (x >= v.pos1[1] and x <= v.pos2[1] and y >= v.pos1[2] and y <= v.pos2[2]) and i or nil
TILEZONE[y][x].HOUSEDOOR = (x == v.door[1] and y == v.door[2]) and i or nil
TILEZONE[y][x].HOUSEENT = (x == v.ent[1] and y == v.ent[2]) and i or nil
if TILEZONE[y][x].HOUSE or TILEZONE[y][x].HOUSEDOOR or TILEZONE[y][x].HOUSEENT then break end
end
end
end
PLAYERS = {}
PLAYERCACHE = {}
HUDImage = image('gfx/weiwen/1x1.png', 565, 407+#CONFIG.STATS*CONFIG.PIXELS/2, 2)
imagescale(HUDImage, 130,CONFIG.PIXELS+#CONFIG.STATS*CONFIG.PIXELS)
imagealpha(HUDImage, 0.5)
SKY = image('gfx/weiwen/1x1.png',320,240,2)
imagescale(SKY,640,480)
imagecolor(SKY,0,0,32)
MINUTES = 0
GLOBAL = {}
GLOBAL.TIME = 0
GLOBAL.RAIN = 0
dofile(dir .. 'functions.lua')
dofile(dir .. 'admin.lua')
dofile(dir .. 'commands.lua')
dofile(dir .. 'items.lua')
dofile(dir .. 'npcs.lua')
if CONFIG.MAXMONSTERS > 0 then
dofile(dir .. 'monsters.lua')
end
dofile(dir .. 'hooks.lua')
HUDRadar = image("gfx/weiwen/pokeball.png", 53, 53, 2)
TMPGROUNDITEMS = {}
TMPHOUSES = {}
local file = io.open(dir .. "saves/" .. map'name' .. ".lua")
if file then
io.close(file)
dofile(dir .. "saves/" .. map'name' .. ".lua")
for y = 0, map'ysize' do
if TMPGROUNDITEMS[y] then
for x = 0, map'xsize' do
if TMPGROUNDITEMS[y][x] then
for _, j in ipairs(TMPGROUNDITEMS[y][x]) do
if j < 0 then
spawnitem(1337, x, y, -j)
else
spawnitem(j, x, y)
end
end
end
end
end
end
for i, v in pairs(TMPHOUSES) do
for k, l in pairs(v) do
HOUSES[i][k] = l
end
end
TMPGROUNDITEMS = nil
TMPHOUSES = nil
end
local file = io.open(dir .. "saves/players.lua")
if file then
io.close(file)
dofile(dir .. "saves/players.lua")
end
file = nil
parse("mp_infammo 1")
parse("mp_deathdrop 4")
parse("sv_password " .. CONFIG.PASSWORD)
print('initialisation comleted!')
What could be wrong....

EDIT: WAIT

either copy the old wrapper.lua into that folder or edit wrapper.lua and remove the map-function from it.
sorry about that.
edited 4×, last 25.03.11 10:17:53 pm

I tried, then when i started server it frozes at "Loading Map ; Generating Tile Effects" i think i have to do an copy of normal map....Same Thing....

Edit:
Erm wait i dont understand...
plz lets speak on an xat channel, got to be easy?
http://www.xat.com/chat/room/137647633/
Edit2:
I have to go sleep guys, speak again next morning (in 8 hours)
edited 2×, last 25.03.11 10:26:45 pm

Edit:
Thanks A Lot! Solve it . Now people can taste from my cool server

edited 1×, last 26.03.11 07:37:27 am


1
2
3
2
3
function map(map) 	parse("map "..map) end

