Hello, i am a relativly new workshop dev and i have been playing around with a torbjörn turret replacement. I have made a bastion sentry mode turret that automatically places himself down to where the cursor is pointing using the 1st ability as torb. The current problem i am facing is that bastion sometimes does not detect any enemies. I have yet to find any way of setting a detection radius for only the enemies.
As the title states, how does one go about implementing a detection system that uses both a ray and a radius system?
(Here is the code: K4EG2. As of writing this rn, i am online in a lobby, join me if you want.)
Try to avoid using ray hits because it has a very high cost for your game room. Think other way, if a bot can see your bastion then bastion also can see that bot that is why you are using
Is In Line of Sight (Bot, Bastion)
of each bot that comes to the bastion. And if it is true then check
Is In Line of Sight (Bastion, Bot)
to be sure there is nothing preventing bastion to see a bot. that’s all.
This way it costs much less and works 100%.
More info about me and my game mods you can find here.
Ty for the response. I have managed to implement your suggestion in the current find and track methods which are responsible for finding a player within line of sight. The implementation is checking whenever the target can still see the turret. If it cant see the turret, the function removes the saved target and thus attempts to find a new one.
In short, the system works wonderfully.
Now, i am having quite a problem with balancing the placement and cooldown on the turret itself. The ideal solution would be to replace the actual turret that torbjörn is placing with the bastion. However, i have no idea how to get a reference to the player object that bastion is placing. Do you know any means to get such a reference?
You can’t reference player owned objects, like turrets, teleporter, bob, riptire etc.
Instead you could disable torbs ability 1 completely. To place bastion you check for “is button held(event player, ability1) == true”, wich works regardless of the availability of the ability, and use custom cooldown management.
I see. Its a bummer that i cant use the game’s preexisting logic on the torbjörn’s placement and cooldown as it works the best for what i am going for. Thank you for your input though, i got a rough idea of where to continue.