Hey guys,
i got a function to cut a tree but uhmm
how can i make a function that tells me that the tree is cutted?
Hey guys,
i got a function to cut a tree but uhmm
how can i make a function that tells me that the tree is cutted?
Beginner: if FindColor(TreeStump, x, x1, y, y1) then
TreeCut;
Intermediate: Same as above but with TPA
Another Option: if not Animating then
TreeCut;
I prefer to save the x and y where you cut the tree and search for the tree color in a 10 pixel box around that area. Once the tree color isn't found anymore then you move onto your next tree.
You can also just keep hovering the tree and watch the uptext, once the uptext is gone then move to a new tree.
“Ignorance, the root and the stem of every evil.”
I would say make a box using ATPA's around the tree you want to cut. Remove any Points outside of that box, and pretty much do what blumblebee said, except i would have done a bounds check instead of a color check :P The other responses look more then solid though =]
Don't Troll, Don't Fight, Just keep the Respect
Status : Offline
Feel free to re-make my scripts ;D
Community Member
Simple =]. Just check the bounds of the box you just made.
SCAR Code:Tree.ATPA := SplitTPAEx(Tree.TPA, Tree.W, Tree.H);
// Made sure u got ur correct tree and everything.
Tree.Box := GetTPABounds(Tree.ATPA[{TheTPA}]);
while ((Tree.Box.X2 - Tree.Box.X1) >= {Width}) and ((Tree.Box.Y2 - Tree.Box.Y1) >= {Height} do
//Wait or Keep Checking the Bounds or w/e
just a simple example on what i meant :P Just checkin the bounds n stuff. I like your color method as well =]
Last edited by Heavenguard; 08-13-2010 at 05:46 AM.
Don't Troll, Don't Fight, Just keep the Respect
Status : Offline
Feel free to re-make my scripts ;D
Community Member
Don't Troll, Don't Fight, Just keep the Respect
Status : Offline
Feel free to re-make my scripts ;D
Community Member
There are currently 1 users browsing this thread. (0 members and 1 guests)