smilz0 / Left4Bots

Improvements for the L4D2 survivor bots
https://steamcommunity.com/sharedfiles/filedetails/?id=3022416274
34 stars 4 forks source link

Check for gascans when throwing molotovs #61

Open smilz0 opened 10 months ago

smilz0 commented 10 months ago

Don't throw molotovs if there are gascans nearby and scavenge is active.

Mystik-Spiral commented 2 days ago

I am not familiar with vscript, but I think molotov throws are done with a constant velocity, so the landing location of a molotov throw should be possible to calculate using the angle/gravity (and maybe a vscript equivalent of a trace?). If so, and you have an array with the xyz location of all gascans (location stored when entity spawned then updated by timer), then you can check the distance/height of the molotov landing location to each gascan location, and if too close, then abort the throw.