Author Topic: [Solved] How to check if a brick can be planted?  (Read 302 times)

How do I check if a brick can be planted? Like check if the brick isn't in another brick, the ground, etc.
« Last Edit: January 06, 2013, 04:59:00 PM by Electrk »

How do I check if a brick can be planted? Like check if the brick isn't in another brick, the ground, etc.
Worst case is that you'll have to use container raycasts. There MIGHT be an easier to use function for checking, but I'm not sure. I always use container raycasts though, they're really not bad at all

Code: [Select]
%name = %brick.getName();
%brick.setName("TempName");
%brick2 = new fxDTSbrick(:TempName);
%brick.setName(%name);
%plant = %brick2.plant();
%brick2.delete();
if(%plant == 0)
    %canplant = 1;
else
    %canplant = 0;