Forum

> > CS2D > Scripts > Explode on tile
Forums overviewCS2D overview Scripts overviewLog in to reply

English Explode on tile

4 replies
To the start Previous 1 Next To the start

old Explode on tile

X-Files
User Off Offline

Quote
whats problem ?

1
2
3
4
5
6
7
8
9
10
addhook("second","maptile") 
function maptile()
for x=0, map("xsize") do
     for y=0, map("ysize") do
	 if tile(x,y,"frame") == 30 then
				parse('explosion ' .. x .. ' ' .. y .. ' 128 40')
	 end
end
end
end

old Re: Explode on tile

Alistaire
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
addhook("second","maptile") 
function maptile()
for x=0, map("xsize") do
     for y=0, map("ysize") do
	 if tile(x,y,"frame") == 30 then
				parse('explosion ' .. ( x * 32 ) .. ' ' .. ( y * 32 ) .. ' 128 40')
	 end
end
end
end

The explosion parser function uses pixel X and Y positions, so multiply the tile X and Y by 32.

old Re: Explode on tile

X-Files
User Off Offline

Quote
@user Alistaire: seems legit, thanks !

ok another problem
flare showing up in left upper corner why ? anyway to fix ?

IMG:https://oi57.tinypic.com/2m33141.jpg<br>


1
parse('effect "flare" ' .. ( x * 32 ) .. ' ' .. ( y * 32 ) .. ' 100 32 255 128 0')
edited 1×, last 06.09.14 01:26:47 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview