Forum

> > Carnage Contest > I can't seem to find the error...
Forums overviewCarnage Contest overviewLog in to reply

English I can't seem to find the error...

2 replies
To the start Previous 1 Next To the start

old I can't seem to find the error...

Obviously Exactly Myself
User Off Offline

Quote
I'm using Notepad++ and Notepad++ can find lua errors, but there isn't any. But when I started CC, it says: EXCEPTION_ACCESS_VIOLATION
I've been fixing it all night and after sleeping, I kept trying to fix it until now but the script still show that error.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
function cc.blackhole.blackhole.update(id,x,y)
	local players=playertable(0,0)
	for i=1,#players do
		if math.sqrt((x-getplayerx(players[i]))^2+(y-getplayery(players[i]))^2)<=300 then
			playerpush(players[i],0,0,1,0)
			playerforceframe(players[i],4)
			if getplayerx(players[i])>x then
				playerposition(players[i],getplayerx(players[i])-6,getplayery(players[i]))
			elseif getplayerx(players[i])<x then
				playerposition(players[i],getplayerx(players[i])+6,getplayery(players[i]))
			end
			if getplayery(players[i])>y then
				playerposition(players[i],getplayerx(players[i]),getplayery(players[i])-6)
			elseif getplayery(players[i])<y then
				playerposition(players[i],getplayerx(players[i]),getplayery(players[i])+6)
			end
			if getplayerx(players[i])==x and getplayery(players[i])<y then
				playerposition(players[i],getplayerx(players[i]),getplayery(players[i])+6)
			elseif getplayerx(players[i])==x and getplayery(players[i])>y then
				playerposition(players[i],getplayerx(players[i]),getplayery(players[i])-6)
			elseif getplayerx(players[i])<x and getplayery(players[i])==y then
				playerposition(players[i],getplayerx(players[i])+6,getplayery(players[i]))
			elseif getplayerx(players[i])>x and getplayery(players[i])==y then
				playerposition(players[i],getplayerx(players[i])-6,getplayery(players[i]))
			end
		end
	end
	for pi=1,#projectiles do
		if projectiles[pi].x~=nil and projectiles[pi].y~=nil and projectiles[pi].sx~=nil and projectiles[pi].sy~=nil then
			if math.sqrt((x-projectiles[pi].x)^2+(y-projectiles[pi].y)^2)<=50 then
				projectiles[pi].x=-1000
				projectiles[pi].y=getwatery()
			elseif math.sqrt((x-projectiles[pi].x)^2+(y-projectiles[pi].y)^2)<=300 then
				if projectiles[pi].x>x then
					projectiles[pi].x=projectiles[pi].x-6
					projectiles[pi].sx=projectiles[pi].sx-0.5
				elseif projectiles[pi].x<x then
					projectiles[pi].x=projectiles[pi].x+6
					projectiles[pi].sx=projectiles[pi].sx+0.5
				end
				if projectiles[pi].y>y then
					projectiles[pi].y=projectiles[pi].y-6
					projectiles[pi].sy=projectiles[pi].sy-0.5
				elseif projectiles[pi].y<y then
					projectiles[pi].y=projectiles[pi].y+6
					projectiles[pi].sy=projectiles[pi].sy+0.5
				end
				if projectiles[pi].x==x and projectiles[pi].y<y then
					projectiles[pi].y=projectiles[pi].y+6
					projectiles[pi].sy=projectiles[pi].sy+0.5
					projectiles[pi].sx=0.0
				elseif projectiles[pi].x==x and projectiles[pi].y>y then
					projectiles[pi].y=projectiles[pi].y-6
					projectiles[pi].sy=projectiles[pi].sy-0.5
					projectiles[pi].sx=0.0
				elseif projectiles[pi].x<x and projectiles[pi].y==y then
					projectiles[pi].x=projectiles[pi].x+6
					projectiles[pi].sx=projectiles[pi].sx+0.5
					projectiles[pi].sy=0.0
				elseif projectiles[pi].x>x and projectiles[pi].y==y then
					projectiles[pi].x=rojectiles[pi].x-6
					projectiles[pi].sx=projectiles[pi].sx-0.5
					projectiles[pi].sy=0.0
				end
			end
		end
	end
	local objects=objecttable()
	for oi=1,#objects do
		if objects~=nil then
			if math.sqrt((x-getobjectx(objects[oi]))^2+(y-getobjecty(objects[oi]))^2)<=300 then
				objects[objects[oi]].sy=0
				if getobjectx(objects[oi])>x then
					objectposition(objects[oi],objectx(objects[oi])-6,getobjecty(objects[oi]))
				elseif getobjectx(objects[oi])<x then
					objectposition(objects[oi],objectx(objects[oi])+6,getobjecty(objects[oi]))
				end
				if getobjecty(objects[oi])>y then
					objectposition(objects[oi],objectx(objects[oi]),getobjecty(objects[oi])-6)
				elseif getobjecty(objects[oi])<y then
					objectposition(objects[oi],objectx(objects[oi]),getobjecty(objects[oi])+6)
				end
				if getobjectx(objects[oi])==x and getobjecty(objects[oi])<y then
					objectposition(objects[oi],objectx(objects[oi]),getobjecty(objects[oi])+6)
				elseif getobjectx(objects[oi])==x and getobjecty(objects[oi])>y then
					objectposition(objects[oi],objectx(objects[oi]),getobjecty(objects[oi])-6)
				elseif getobjectx(objects[oi])<x and getobjecty(objects[oi])==y then
					objectposition(objects[oi],objectx(objects[oi])+6,getobjecty(objects[oi]))
				elseif getobjectx(objects[oi])>x and getobjecty(objects[oi])==y then
					objectposition(objects[oi],objectx(objects[oi])-6,getobjecty(objects[oi]))
				end
			end
		end
	end
	baho=objecttable(cc.blackhole.blackhole)
	for bh=1,#baho do
		if math.sqrt((x-getobjectx(baho[bh]))^2+(y-getobjecty(baho[bh]))^2)<=700 then
			if bh~=id then
				removeobject(bh)
			end
		end
	end
	fire=objecttable(o_fire)
	for f=1,#fire do
		if math.sqrt((x-getobjectx(fire[f]))^2+(y-getobjecty(fire[f]))^2)<=50 then
			removeobject(fire[f])
		end
	end
	trap=objecttable(o_beartrap)
	for t=1,#trap do
		if math.sqrt((x-getobjectx(trap[t]))^2+(y-getobjecty(trap[t]))^2)<=50 then
			removeobject(trap[t])
		end
	end
	mine=objecttable(o_mine)
	for m=1,#mine do
		if math.sqrt((x-getobjectx(mine[m]))^2+(y-getobjecty(mine[m]))^2)<=50 then
			removeobject(mine[m])
		end
	end
	itembox=objecttable(o_supply)
	for b=1,#itembox do
		if math.sqrt((x-getobjectx(itembox[b]))^2+(y-getobjecty(itembox[b]))^2)<=50 then
			removeobject(itembox[b])
		end
	end
	healbox=objecttable(o_medikit)
	for h=1,#healbox do
		if math.sqrt((x-getobjectx(healbox[h]))^2+(y-getobjecty(healbox[h]))^2)<=50 then
			removeobject(healbox[h])
		end
	end
	if collision(cc.blackhole.gfx_sucker,x,y)==1 then
		if objectcollision()>0 and objectcollision()~=id then
			removeobject(objectcollision())
		end
		if playercollision()>0 then
			playerdamage(playercollision(),2147483648)
		end
	end
	if collision(cc.blackhole.gfx,x,y)==1 then
		if terraincollision()>0 then
			terraincircle(x,y,120,0x00000000)
		end
	end
end
edited 1×, last 10.06.12 08:03:32 am
To the start Previous 1 Next To the start
Log in to replyCarnage Contest overviewForums overview