What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Combat Routine Question

Beast

Member
Joined
Apr 22, 2010
Messages
618
I am working on making a combat routine for my Lancer, I am new to coding but I have this:

Code:
        protected override Composite CreatePull()
        {
            if (settings.PullSpell == false)
            {
                return new PrioritySelector(
                    r => Actionmanager.InSpellInRangeLOS("Piercing Talon", Core.Target),
                    new Decorator(r => (r as SpellRangeCheck?) == SpellRangeCheck.ErrorNotInRange, new Action(r => Navigator.MoveTo(Core.Target.Location))),
                    Cast("Piercing Talon", r => (r as SpellRangeCheck?) == SpellRangeCheck.Success || (r as SpellRangeCheck?) == SpellRangeCheck.ErrorNotInFront));
            }
            else
            {
                return new PrioritySelector(
                    r => Actionmanager.InSpellInRangeLOS("True Thrust", Core.Target),
                    new Decorator(r => (r as SpellRangeCheck?) == SpellRangeCheck.ErrorNotInRange, new Action(r => Navigator.MoveTo(Core.Target.Location))),
                    Cast("True Thrust", r => (r as SpellRangeCheck?) == SpellRangeCheck.Success || (r as SpellRangeCheck?) == SpellRangeCheck.ErrorNotInFront));
            }   
        }

and in the settings I have PullSpell as a public bool where true is using true thrust and false is piercing talon ... It seems to not be working correctly. Any thought?
 
CreatePull is called once and then the composite it returns is used over and over. You need modify more then just what spell to choose and add to the behavior tree.
 
CreatePull is called once and then the composite it returns is used over and over. You need modify more then just what spell to choose and add to the behavior tree.

Thanks for the reply! Unfortunately I don't have the knowledge of C#. Could you give an example?
 
Thanks for the reply! Unfortunately I don't have the knowledge of C#. Could you give an example?
instead of using CLR code like " if (settings.PullSpell == false)" use the Behavioral Trees the way they are meant to be used. Something like "new Decorator (r=> !settings.PullSpell, new PrioritySelector (... etc" also remember that BTs use a succeed/fail status check. If a delegate function succeeds it will stop running the rest of the branch. Read up on BTs.
Good luck.
Twist
 
Back
Top