Results 1 to 8 of 8

Thread: needing help with Woodcutter:

  1. #1
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    175
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default needing help with Woodcutter:

    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?

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Beginner: if FindColor(TreeStump, x, x1, y, y1) then
    TreeCut;
    Intermediate: Same as above but with TPA

    Another Option: if not Animating then
    TreeCut;

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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.”

  4. #4
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    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

  5. #5
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Heavenguard View Post
    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 =]
    curious, what do you mean by bounds check? I'm interested
    “Ignorance, the root and the stem of every evil.”

  6. #6
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    curious, what do you mean by bounds check? I'm interested
    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

  7. #7
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Heavenguard View Post
    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

    just a simple example on what i meant :P Just checkin the bounds n stuff. I like your color method as well =]
    ah okay so in other-words you refind the TPA and check it against the original width and height, similar to the color method just checking a different aspect of the TPA. Cool, thanks
    “Ignorance, the root and the stem of every evil.”

  8. #8
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Blumblebee View Post
    ah okay so in other-words you refind the TPA and check it against the original width and height, similar to the color method just checking a different aspect of the TPA. Cool, thanks
    Yup =] You got it bro. Np
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •