krycess 8 Posted March 7, 2020 Share Posted March 7, 2020 (edited) 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 March 7, 2020 by krycess Link to comment https://wrobot.eu/forums/topic/11922-calling-fightclass-from-product/ Share on other sites More sharing options...
Matenia 628 Posted March 8, 2020 Share Posted March 8, 2020 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 https://wrobot.eu/forums/topic/11922-calling-fightclass-from-product/#findComment-57017 Share on other sites More sharing options...
krycess 8 Posted March 8, 2020 Author Share Posted March 8, 2020 (edited) 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 March 8, 2020 by krycess Link to comment https://wrobot.eu/forums/topic/11922-calling-fightclass-from-product/#findComment-57018 Share on other sites More sharing options...
Matenia 628 Posted March 8, 2020 Share Posted March 8, 2020 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 https://wrobot.eu/forums/topic/11922-calling-fightclass-from-product/#findComment-57019 Share on other sites More sharing options...
krycess 8 Posted March 8, 2020 Author Share Posted March 8, 2020 (edited) 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 Edited March 8, 2020 by krycess Link to comment https://wrobot.eu/forums/topic/11922-calling-fightclass-from-product/#findComment-57020 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now