Forum

> > CS2D > Scripts > Check Entity Position or whatever
Forums overviewCS2D overview Scripts overviewLog in to reply

English Check Entity Position or whatever

6 replies
To the start Previous 1 Next To the start

old Check Entity Position or whatever

G3tWr3ck3d
User Off Offline

Quote
I want to do something like :
1
2
3
if entity(x,y,"type") ~= 27 then
	do shit
end

So how do I make it for all the entities (27 - hurt zones) and not just one (x,y) entity?

old Re: Check Entity Position or whatever

Infinite Rain
Reviewer Off Offline

Quote
Use nested "for" loop to check every position on the map.

Ex.:
1
2
3
4
5
for x = 0, map('xsize') do
 for y = 0, map('ysize') do
  --entity(x, y, "shit")
 end
end

old Re: Check Entity Position or whatever

Infinite Rain
Reviewer Off Offline

Quote
@user _Yank:
Nope, they aren't. By tile based I meant the limitation of placement. You can put two different entities on a same tile as well as put entities outside of the map. You can't do neither of what I've said with tiles.

Sorry if "tile based" was confusing, I could have picked better words for that.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview