Forum

> > CS2D > Scripts > Tibia Error
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Tibia Error

13 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Tibia Error

Ali security
User Off Offline

Zitieren
-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<

alt Re: Tibia Error

Zeik
User Off Offline

Zitieren
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 hat geschrieben
529
1
exp = 1080000, money = 151300, loot = {{chance = 1800, id = 102},{chance = 1800, id = 107}},

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

alt Re: Tibia Error

Yates
Reviewer Off Offline

Zitieren
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.

alt Re: Tibia Error

Dousea
User Off Offline

Zitieren
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.

alt Re: Tibia Error

Yates
Reviewer Off Offline

Zitieren
@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.

alt Re: Tibia Error

Dousea
User Off Offline

Zitieren
@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>

alt Re: Tibia Error

Yates
Reviewer Off Offline

Zitieren
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.

alt Re: Tibia Error

Dousea
User Off Offline

Zitieren
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.

alt Re: Tibia Error

Yates
Reviewer Off Offline

Zitieren
user Yates hat geschrieben
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.

alt Re: Tibia Error

EngiN33R
Moderator Off Offline

Zitieren
user Dousea hat geschrieben
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.
1× editiert, zuletzt 04.01.16 14:14:35

alt Re: Tibia Error

Dousea
User Off Offline

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

user Dousea hat geschrieben
the argument x or y that passed through the function is the problem.

user Dousea hat geschrieben
Maybe it's out of boundaries.

Then you said in your last post.
user Yates hat geschrieben
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.

alt Re: Tibia Error

Zeik
User Off Offline

Zitieren
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".
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht