Game Development Community

Building placement validation

by Justin Mosiman · in RTS Starter Kit · 12/30/2006 (10:16 pm) · 22 replies

I'm trying to improve the RTSBuilding placement system, and I am just totally out of ideas on this topic. If the RTSBuilding (of class RTSBuildingMarker with a parent of TSStatic) hits another object or is on uneven terrain, how do you check that?

I don't really want to wait until serverCmdPlaceBuilding in building.cs like the comments suggest because that would mean that I wouldn't be able to put a red overlay over the RTSBuildingMarker indicating that this is a bad area.

Does anybody have any ideas on the structure of implementing this? I don't need the code, I would be able to figure that part out, I'm just out of ideas on how to even approach this.

Any feedback would be greatly appreciated (I can make a resource once I get this working also).
Page«First 1 2 Next»
#21
01/28/2010 (3:38 am)
I tried to add this "as is" to my build but no luck. It does display the placing building marker - but left click doesn't place the building.

Going to try to troubleshoot it some more -- have a feeling its a matter of RTS 1.5.2 + world dom mod changes as well as these code fragments being duplicates of existing code.
#22
01/28/2010 (9:41 pm)
The code was a bit over-jumbled, as many pieces already existed -- which made implementing this a bit confusing. And I think this solution was a bit over-complicated perhaps --

Anyhow, I was able to make use of the code examples to get my building rotations working though ... so if anyone else wants this feature working with latest build, see my other post.


http://www.torquepowered.com/community/forums/viewthread/109545
Page«First 1 2 Next»