HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Indoor/Outdoor

07-21-2002, 01:41 AM#1
Guest
I'm trying to find a way to find out whether or not a peon is inside, within placed walls, or outside a "house".

My idea, tell me if it is flawed:

1) Finds that there is an inside by finding out if all walls are adjacent to two other walls. If adjacent to more than two, the game considers this a bad building. Also, a single door can be placed, and one has to be found adjacent to two walls.

2) Peon starts outside in a place that cannot be inside, then as he moves adjacent to the door, a region is created. If he leaves the region and still remains adjacent to the door, than the game thinks he is inside. If he leaves and isn't, then he is still outside. The same applies for going outside.

Anyway, tell me if you think it works. Right now, i am trying to figure out how to make the above work, as i cannot figure out how to use the "within range of" without preplaced units.