camelot10 155 Posted March 30, 2017 Share Posted March 30, 2017 is it possible for fightclass always try to move to target back/behind? Link to comment https://wrobot.eu/forums/topic/5526-how-to-make-fightclass-move-behind-target/ Share on other sites More sharing options...
reapler 154 Posted March 30, 2017 Share Posted March 30, 2017 Yes, i think you can do it by lua or moveto(i prefered on other bots to use lua if character was close enough to the target to strafe and set rotation). There must be also an movementevent that you can block which is set on the fightclass. Here's an example to get the target's back vector: public Vector3 BackofVector3(Vector3 from, float radius) { if (from != null && from != Vector3.Empty) { //abit ugly float rotation = -robotManager.Helpful.Math.DegreeToRadian(robotManager.Helpful.Math.RadianToDegree(ObjectManager.Me.TargetObject.Rotation)+90); return new Vector3((System.Math.Sin(rotation)*radius) + from.X, (System.Math.Cos(rotation)*radius) + from.Y, from.Z); } return new Vector3(0, 0, 0); } and to see the point where it is just add this in initialize method: Radar3D.OnDrawEvent += () => { if (ObjectManager.Me.TargetObject != null) Radar3D.DrawCircle(BackofVector3(ObjectManager.Me.TargetObject.Position, 2f), 0.3f, Color.Blue); }; if you decide to use it, i recommend to also set your own rotation by atan2 to your target(it looks more smooth) and disable it on npcs because it looks awful when the bot is running around on its target indefinitely. . Link to comment https://wrobot.eu/forums/topic/5526-how-to-make-fightclass-move-behind-target/#findComment-25280 Share on other sites More sharing options...
camelot10 155 Posted March 30, 2017 Author Share Posted March 30, 2017 i dont want convert figthclass into C#, is there any possibility to run this code while in fight with xml? Link to comment https://wrobot.eu/forums/topic/5526-how-to-make-fightclass-move-behind-target/#findComment-25281 Share on other sites More sharing options...
Arcangelo 105 Posted March 30, 2017 Share Posted March 30, 2017 1 hour ago, camelot10 said: i dont want convert figthclass into C#, is there any possibility to run this code while in fight with xml? type the code in where you add spells and set it to "not spell, is c# code" in the spell settings Link to comment https://wrobot.eu/forums/topic/5526-how-to-make-fightclass-move-behind-target/#findComment-25282 Share on other sites More sharing options...
reapler 154 Posted March 30, 2017 Share Posted March 30, 2017 Yep you can also paste the code to the fightclass for e.g. Gobehindtest.xml as i wrote it in the last post, i prefer to use lua(but it's more difficult to code) else it looks abit jagged with moveto and by the way if you wanna see the point just enable 3dRadar. Link to comment https://wrobot.eu/forums/topic/5526-how-to-make-fightclass-move-behind-target/#findComment-25283 Share on other sites More sharing options...
Trustjah 0 Posted August 27, 2017 Share Posted August 27, 2017 None of the above is working for me, ayone got an aswer to this? I've been trying to make a rogue fightclass and moving behind an enemy is just the thing i want it to do. [F] 02:30:48 - [FightClass] Launch C# code: public Vector3 BackofVector3(Vector3 from, float radius) { if (from != null && from != Vector3.Empty) { //abit ugly float rotation = -robotManager.Helpful.Math.DegreeToRadian(robotManager.Helpful.Math.RadianToDegree(ObjectManager.Me.TargetObject.Rotation)+90); return new Vector3((System.Math.Sin(rotation)*radius) + from.X, (System.Math.Cos(rotation)*radius) + from.Y, from.Z); } return new Vector3(0, 0, 0); } [E] 02:30:48 - Compilator Error : c:\Users\Dean\AppData\Local\Temp\szwfbcwc.0.cs(20,5) : error CS1513: } expected c:\Users\Dean\AppData\Local\Temp\szwfbcwc.0.cs(30,6) : error CS1597: Semicolon after method or accessor block is not valid c:\Users\Dean\AppData\Local\Temp\szwfbcwc.0.cs(32,1) : error CS1022: Type or namespace definition, or end-of-file expected Link to comment https://wrobot.eu/forums/topic/5526-how-to-make-fightclass-move-behind-target/#findComment-31171 Share on other sites More sharing options...
Droidz 2738 Posted August 28, 2017 Share Posted August 28, 2017 On 27/08/2017 at 2:36 AM, Trustjah said: None of the above is working for me, ayone got an aswer to this? I've been trying to make a rogue fightclass and moving behind an enemy is just the thing i want it to do. [F] 02:30:48 - [FightClass] Launch C# code: public Vector3 BackofVector3(Vector3 from, float radius) { if (from != null && from != Vector3.Empty) { //abit ugly float rotation = -robotManager.Helpful.Math.DegreeToRadian(robotManager.Helpful.Math.RadianToDegree(ObjectManager.Me.TargetObject.Rotation)+90); return new Vector3((System.Math.Sin(rotation)*radius) + from.X, (System.Math.Cos(rotation)*radius) + from.Y, from.Z); } return new Vector3(0, 0, 0); } [E] 02:30:48 - Compilator Error : c:\Users\Dean\AppData\Local\Temp\szwfbcwc.0.cs(20,5) : error CS1513: } expected c:\Users\Dean\AppData\Local\Temp\szwfbcwc.0.cs(30,6) : error CS1597: Semicolon after method or accessor block is not valid c:\Users\Dean\AppData\Local\Temp\szwfbcwc.0.cs(32,1) : error CS1022: Type or namespace definition, or end-of-file expected How(where) do you use this code? Link to comment https://wrobot.eu/forums/topic/5526-how-to-make-fightclass-move-behind-target/#findComment-31209 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