[SOLVED] Winston AI | Classic Jump

Hey Guys can someone help me, i search for the code

example:
Bot A ( Winston ) facing player B (widow) …
he is walking to her…
jumps in the air (90 degree or 45) in direction to the widow…

but i struggling with the facing while he is jumping… can someone help me ?

There’s two approches.

The first is consedering this like a maths problem, it is probably the best but it requires andvanced maths and actual to be smart enough to implant it in a good way

The second is you botch it.
You do something like set facing(direction towards (bot A player B) + Vector(0,1,0))
Here’s an example code, set where you want to jump by pressing interact and get the where you need to look to be close by pressing right click.
5A30K

Thats f***ing way more better as i though lol :smiley: PERFECT

how i can set condition between arround 20-30 meters and not only < 30 meter or 15-25 meters etc

conditions
{
Distance Between(Event Player, Players On Hero(Hero(Widowmaker), All Teams)) < 30;
}

1 Like

You can do that with an AND logical linking with two Distance Between to compare with bounds, the first condition of the AND link is the lower bound means the distance needs to be greater or equal to 20 the second condition of the AND expression is the upper bound where the distance needs to be less than or equal to 30, if the distance evaluates in the game between 20 and 30 so the range in bound, then the Rule will trigger.

It will look like this in pseudo code:

conditions
{
(Distance Between(Event Player, Players On Hero(Hero(Widowmaker), All Teams)) >= 20) && (Distance Between(Event Player, Players On Hero(Hero(Widowmaker), All Teams)) < =30)
}

Edit: Or express it in a more workshop element saving way it will look like this(the optimized version can be copy and pasted from text here directly into the workshop editor):

conditions
{
	Is True For Any(Players On Hero(Hero(Widowmaker), Opposite Team Of(Team Of(Event Player))), Distance Between(Event Player,
		Current Array Element) >= 20 && Distance Between(Event Player, Current Array Element) <= 30) == True;
}
2 Likes

Idk can you link me a workshop code who are you done this command i cant reply that in my workshop im to stupid for the && without inline a ( ) , what im doing wrong here ?

The first one is pseudo code, if you wanna hve the optimized version you just highlight over it in the quote box, then after you mark and highlight it press right click with mouse and select copy as the option, its now in your clipboard, after you copy you go into the workshop editor in game, create a new rule and in the condition section you press the paste option it will formate the textual workshop condition snippet, you copied into the clipboard, into the actual workshop structure, it should be done, if that doesn’t work i can provide a code.

Edit: To skip everything told above, you can use this code: 8QG5H

2 Likes

long time ago, but thank you again dude :slight_smile: didnt forgot your help here!

1 Like