Jump to content

Calling FightClass from Product


krycess

Recommended Posts

Hi! I'm writing a new product but I don't quite know how to call a fight class from it.

 

for another bot, I simply called

CustomClasses.Instance.Current.Fight(ObjectManager.Instance.Units.Where(x => x.IsInCombat));

but for wRobot, I don't quite know what to call...

 

do I simply do this?

    internal class Fight : TreeTask
    {
        public override int Priority => 1000;

        public override bool Activate()
        {
            return Party.GetParty().Any(x => x.InCombat) && !ObjectManager.Me.IsSwimming;
        }

        public override void Execute()
        {
            CustomClass.LoadCustomClass();
        }
    }

 

Edited by krycess
Link to comment
Share on other sites

You only load CustomClass once when the product starts. The fightclass runs on its own thread. For starting an actual fight, look into the "Grinding" state .

Link to comment
Share on other sites

image.png.4643a5be5ed2151c57b2fc7357854538.png

It still isn't clicking for me. Is this the right "state" that you are talking about?

 

    internal class Fight : TreeTask
    {
        public Fight()
        {
            GrindingState = new Grinding();
        }

        public override int Priority => 1000;

        public override bool Activate()
        {
            return Party.GetParty().Any(x => x.InCombat) && !ObjectManager.Me.IsSwimming;
        }

        public override void Execute()
        {
            GrindingState.Run();
        }

        Grinding GrindingState { get; }
    }

 

Edited by krycess
Link to comment
Share on other sites

If you're not using the FSM, you need to write your combat behavior completely from scratch.
Look into what the class "Fight" actually does. Just instantiating a state does nothing. 

Decompile and look at it. Take a look at the Grinder project that Droidz uploaded as an example for products.

Link to comment
Share on other sites

yeah I wasn't planning on using the FSM so I would need to add combat behavior from scratch.

I have written all of this before for another platform so I would just have to port it over.

It would require a totally different type of "fightclass" however... so maybe it should be all inclusive before I release

image.png.05ba1b7f8f6aa8eec5ec82e788c038b6.png

Edited by krycess
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...