Jump to content

Calling FightClass from Product


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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...