Forum

> > CS2D > General > Unknown Lua Error
ForenübersichtCS2D-ÜbersichtGeneral-ÜbersichtEinloggen, um zu antworten

Englisch Unknown Lua Error

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Unknown Lua Error

Dousea
User Off Offline

Zitieren
First, see this script please:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function spawnplayer (id)
	if (conquest.flags_spawn) then
		local team = player (id, "team")
		local spawn_point = math.random (1, getteamdomination (team, "point"))
		local spawn_pointx, spawn_pointy = (getteamdomination (team, "x")[spawn_point] * 32) + 16, (getteamdomination (team, "y")[spawn_point] * 32) + 16
		local between_tilex, between_tiley = math.random (-2, 2), math.random (-2, 2)
		local tilex, tiley = getteamdomination (team, "x")[spawn_point] + between_tilex, getteamdomination (team, "x")[spawn_point] + between_tiley
		local x, y = spawn_pointx + (between_tilex * 32), spawn_pointy + (between_tiley * 32)
		parse ("killplayer " .. id)
		if (tile (tilex, tiley, "walkable") and tile (tilex, tiley, "frame") ~= 0) then
			parse ("spawnplayer " .. id .. " " .. x .. " " .. y)
		else
			x, y = randomentity (team - 1)
			parse ("spawnplayer " .. id .. " " .. x .. " " .. y)
		end
	end
end
Is this script looks complex to you? If no then why in Counter-Strike 2D tells it error? I saw this script again and again, there's nothing wrong about those codes. Well, actually this is not the whole script. The unknown Lua error is as you can see below:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[20:10:56] "  (637x)
[20:10:57] "  (518x)
[20:10:58] "  (371x)
[20:10:59] "  (330x)
[20:11:00] "  (274x)
[20:11:01] "  (260x)
[20:11:02] "  (246x)
[20:11:03] "  (230x)
[20:11:04] "  (246x)
[20:11:05] "  (212x)
[20:11:06] "  (211x)
[20:11:07] "  (189x)
[20:11:08] "  (179x)
[20:11:09] "  (166x)
[20:11:10] "  (156x)
[20:11:11] "  (149x)
[20:11:12] "  (168x)
[20:11:13] "  (148x)
...
As you can see, it is unknown error of Lua. It is makes my CPU speed getting lower and the CS2D is cannot "editable". I don't know what is this, if someone have been through this please tell me.

alt Re: Unknown Lua Error

Dousea
User Off Offline

Zitieren
user Yates hat geschrieben
When does this function execute?

Well, the function execute when player spawn. I think it do infinite loop, but as far as I remember it should print "C stack overflow" in console because I've read it somewhere about C stack overflow is infinite looping.

alt Re: Unknown Lua Error

Yates
Reviewer Off Offline

Zitieren
^ This.

You call the function on spawn, kill the player, then spawn the player which calls the function again. Infinite loops sometimes spew out errors we don't understand.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenGeneral-ÜbersichtCS2D-ÜbersichtForenübersicht