Forum

> > CS2D > Scripts > Check Entity Position or whatever
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Check Entity Position or whatever

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Check Entity Position or whatever

G3tWr3ck3d
User Off Offline

Zitieren
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?

alt Re: Check Entity Position or whatever

Infinite Rain
Reviewer Off Offline

Zitieren
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

alt Re: Check Entity Position or whatever

Infinite Rain
Reviewer Off Offline

Zitieren
@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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht