Hi Is am getting a biut puzzled I am working on a OderTag. So making a ProfileBehavior with the usual suspects I know from the log message that it actually goes into this action But then I do not see any movement or path request. Vector is also checked and has valid coordinates. Any idea why my Char is still standing without even moving a toe. I hope making the Vector inside the action isn't a problem. Any Ideas are welcome. Thanks Code: public class MoveTag : ProfileBehavior ... int Distance=1; float DistanceToTarget =999; String Name="Test"; .. protected override Composite CreateBehavior() { .... new Decorator(ret => DistanceToTarget > Distance , new Action(r => { Logging.Write("I am actually in the Action"); Vector3 Positiion= new Vector3(classvar.x,classvar.y,classvar.z); CommonBehaviors.MoveAndStop(ret => Position, Distance, stopInRange: true, destinationName: Name), DistancetoTarget=Core.Me.Location.Distance(Position) ; }) ), ....
Why would distancetotarget ever be 999, that's massive. If you need to understand how movement works for custom tags, check my Fish tag or something like my GroundTargeting tag in my questing profile.
I hope I understnd how it works. And the distancetotarget is only set in the beginning to 999 so that the decorator goes to the action. As you see after the movement i update the distance to target. Or since moveTo always returns success the action terminates and doesn't execute the line afterwards. But anyhow even then the MoveTo should has valid coordinates wihtin a short distance. That I checked with the Goto.cs when I enter there the coords it works. What is my misunderstanding wiht the Prio selector and decoratior /actions ? from your code: Code: new Decorator(ret => Vector3.Distance(Core.Player.Location, FishSpots.CurrentOrDefault.XYZ) > 1, CommonBehaviors.MoveAndStop(ret => FishSpots.CurrentOrDefault.XYZ, 1, stopInRange: true) Whats the big difference? Do yo say if for any reason the Vecotor3.Distance returns 999 which is bigger than 1 your code would not work either ?
Read up on behavior trees and TreeSharp for understanding. CommonBehaviors.MoveAndStop is a composite, so don't call it from within an Action.
Doh big Shame on my. thanks I cant believe that I did not see this. Readinf the documentation closer would have saved me a lot of time. I owe you some. Sorry