Forum

> > CS2D > Scripts > Tibia Error
Forums overviewCS2D overview Scripts overviewLog in to reply

English Tibia Error

13 replies
To the start Previous 1 Next To the start

old Tibia Error

Ali security
User Off Offline

Quote
-Error
1
2
3
4
5
LUA ERROR: sys/lua/cs2dtibia/functions.lua:341: attempt to index field '?' (a ni
l value)
 -> sys/lua/cs2dtibia/functions.lua:341: in function 'gettile'
 -> sys/lua/cs2dtibia/monsters.lua:545: in function <sys/lua/cs2dtibia/monsters.
lua:529>

-functions lua : 341 :

1
2
3
function gettile(x,y)
	return TILEZONE[y][x]
end

monsters lua : 545:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
name = 'Golge Haramisi', health = 145000, image = 'gfx/weiwen/pokemon/163.png', scalex = 2, scaley = 2, 
		atk = 565, def = 28.3, spd = 25, atkspd = 23, x = 0, y = 0, ang = 0, imgang = 0, spawnchance = 40, runat = 0, range = 68, spawn1 = {23, 227}, spawn2 = {39, 228}, 
		exp = 1080000, money = 151300, loot = {{chance = 1800, id = 102},{chance = 1800, id = 107}},
		spc = {500, function(self, id, dist) 
			local range,dmg,erange,rept,gr,xx,yy = 300,15,128,math.random(10,20),0,self.x,self.y
			radiusmsg("Gölge Haramisi Meteor Firlatti!.", self.x, self.y)
			radiussound("materials/glass3.wav", self.x, self.y)
			repeat
				xx,yy=self.x,self.y
				xx=xx+math.random(1,range)-math.random(1,range)
				yy=yy+math.random(1,range)-math.random(1,range)
				parse('explosion ' .. xx .. ' ' .. yy .. ' ' .. erange .. ' ' .. dmg .. ' 0')
				parse("effect \"colorsmoke\" "..xx.." "..yy.." 100 96 0 0 0")
				radiussound("cs2d_tibia/blizz.ogg", self.x, self.y)
				gr = gr + 1
			until gr >= rept
		end},
	}, 
:545:       
}

529
1
exp = 1080000, money = 151300, loot = {{chance = 1800, id = 102},{chance = 1800, id = 107}},

HELP ME Pl<

old Re: Tibia Error

Zeik
User Off Offline

Quote
No way to tell where is the error exactly... You don't point what line gives error, and the code you provide is super incomplete...

And what is this?
user Ali security has written
529
1
exp = 1080000, money = 151300, loot = {{chance = 1800, id = 102},{chance = 1800, id = 107}},

That can't be actually a complete line...

old Re: Tibia Error

Yates
Reviewer Off Offline

Quote
That's a complete line. And the information given is sufficient.

I'll check when I get home to see what's causing it. I bet it's simply a comma in the wrong place somewhere.

old Re: Tibia Error

Dousea
User Off Offline

Quote
It seems the value of TILEZONE of index y is not exist or TILEZONE[y] of index x is not exist. Or maybe either x or y is a nil value.

old Re: Tibia Error

Yates
Reviewer Off Offline

Quote
@user Dousea: It's a problem with his monsters.lua, one of his new mobs has an error. There is absolutely guaranteed nothing wrong with anything other than what he posted here. I've had to deal with this error multiple times before.

old Re: Tibia Error

Dousea
User Off Offline

Quote
@user Yates: It's written in the error that the error is in gettile function:
1
2
3
LUA ERROR: sys/lua/cs2dtibia/functions.lua:341: attempt to index field '?' (a nil value)
 -> sys/lua/cs2dtibia/functions.lua:341: in function 'gettile'
 -> sys/lua/cs2dtibia/monsters.lua:545: in function <sys/lua/cs2dtibia/monsters.lua:529>

old Re: Tibia Error

Yates
Reviewer Off Offline

Quote
Please dude I know exactly what I'm on about

That error is derived due to a bug in his monsters.lua, I'll show you the fix when I'm home so you don't have to be all "ooh noo error line here!" because it's not helping. If you want to help, download Tibia and check it out, once you've gotten used to it add his monster and check for any syntax errors.

Nothing to do with gettile function, that's totally fine.

old Re: Tibia Error

Dousea
User Off Offline

Quote
I know there's nothing to do with gettile function, although I don't know anything about Tibia, but the argument x or y that passed through the function is the problem.
1
2
3
4
5
6
7
8
9
10
11
local TILEZONE = {
	{0, 0, 0},
	{0, 0, 0},
	{0, 0, 0}
}

function gettile(x, y)
	return TILEZONE[y][x] -- .. the error is here!
end

print(gettile(4, 0)) -- Called here but ..
Maybe it's out of boundaries.

old Re: Tibia Error

Yates
Reviewer Off Offline

Quote
user Yates has written
If you want to help, download Tibia and check it out, once you've gotten used to it add his monster and check for any syntax errors.

There is an error with his mob, most likely a syntax error. Because of this monsters.lua fails to fully load causing gettile to be called with nil values.

So stop posting about something you have absolute zero (nunu pun) knowledge about already because all you are doing is wasting space and pushing my patience with your ignorance.

Either do what I cannot do right now which is stated in my quote, or don't fucking do anything. You're not going to fix an error in the Tibia mod if you have never worked with it before and you can't do anything about that! So stop trying to be a smartarse and listen.

old Re: Tibia Error

EngiN33R
Moderator Off Offline

Quote
user Dousea has written
although I don't know anything about Tibia

Key words in this whole argument. user Yates has a lot of experience with the mod, so I suggest you refrain from offering help if you don't know anything about the subject matter. I certainly keep away from any Tibia-related discussions because my experience with it is scarce and long outdated.

Your help at the moment is akin to a person asking "why does my stomach hurt?" and getting "because your stomach hurts" in response.
edited 1×, last 04.01.16 02:14:35 pm

old Re: Tibia Error

Dousea
User Off Offline

Quote
@user Yates: I tried to tell him, and you, what is the cause of the error from my last posts.
user Dousea has written
Or maybe either x or y is a nil value.

user Dousea has written
the argument x or y that passed through the function is the problem.

user Dousea has written
Maybe it's out of boundaries.

Then you said in your last post.
user Yates has written
Because of this monsters.lua fails to fully load causing gettile to be called with nil values.


@user EngiN33R: I think my help at the moment is akin to a person asking "why does my stomach hurt?" and getting "because there's something in your stomach" in response.

Well at least I was trying to help, so no need for more argument here.

old Re: Tibia Error

Zeik
User Off Offline

Quote
The code he provides is not complete so if he expects help he should give as much information as he can.
That line may be complete but it means absolutely nothing without its context...

This post was like "hey here look, there is an error somewhere, fix it".
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview