i checked mafia man's script but its too complex
Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
Image on wall
19 replies![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)
i checked mafia man's script but its too complex
Place image entity and set offset Y as 32 (so it's one tile below). Make a name <name> (example 'potato'). Make your breakable entity and in trigger field, enter <name> (in my example it's 'potato')
![cs2d lua hook](img/i_codehelp.png)
![cs2d lua hook](img/i_codehelp.png)
edited 1×, last 21.08.14 06:04:56 pm
To easy.
![user](img/i_friend.png)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
img = image("path/of/the/image.png",0,0,0) addhook("build","a") function a(id,t,x,y,mode,oid) 	imagepos(img,x*32+16,y*32+16,0) end addhook("objectkill","b") function b(oid,id) 	freeimage(img) end
This is too simple and probably sucks but you asked how it's done so...
![user](img/i_friend.png)
![user](img/i_friend.png)
![cs2d entity](img/i_codehelp.png)
![user](img/i_friend.png)
That's how build hook works. It proceeds only when you finish building. If you want the image to appear during construction, you need buildattempt hook.
no dude... i have azlready builded walls from map those pics need to get on them in startround
![user](img/i_friend.png)
image from map wont work for me for some complex reason i need codes ! and this codes need to go on walls which is already builded, so build or buildattempt hooks wont work for my plan
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
img = {} addhook("startround","a") function a(mode) 	local ID = 0 	for x = 0,map("xsize") do 		for y = 0,map("ysize") do 			if tile(x,y,"wall") then 				ID = ID + 1 				img[ID] = image("path/image.png",0,0,0) 				imagepos(img[ID],x*32+16,y*32+16,0) 			end 		end 	end end
add additional checks if you want it to work with breakable entities.
![user](img/i_friend.png)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
img = {} addhook("startround","a") function a(mode) 	local ID = 0 	for x = 0,map("xsize") do 		for y = 0,map("ysize") do 			if tile(x,y,"wall") then 				ID = ID + 1 				img[ID] = image("path/image.png",0,0,0) 				imagepos(img[ID],x*32+16,y*32+16,0) 			end 		end 	end end
add additional checks if you want it to work with breakable entities.
its cool but what about removing image ?
im afraid it could remove all images on walls with breakiig one wall
1
2
3
4
2
3
4
addhook("objectkill","b") function b(oid,id) freeimage(img) end
1
2
3
2
3
for i = 1,ID do 	freeimage(img[i]) end
![user](img/i_friend.png)
i dont want to remove all
i hope im clear
this code just putting an image on wall now i need to remove that after break
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
img = {} addhook("startround","a") function a(mode) local ID = 0 for x = 0,map("xsize") do for y = 0,map("ysize") do if tile(x,y,"wall") then ID = ID + 1 img[ID] = image("path/image.png",0,0,0) imagepos(img[ID],x*32+16,y*32+16,0) end end end end
What you want is possible, I gave you basic stuff for image handling, now just sort out how to do it with entities.
![user](img/i_friend.png)
![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)