|
Re: Indicative scared roach (+4)
So, I got to thinking about the fact that the script for the Scared Roach uses more than twenty variables to define where the flashlight is. That's a lot of variables. I figured that there must be a more efficient way to do that.
Well, the flashlight uses build markers to indicate it's cone of influence, so I made it so the roaches just look for whether they're standing on a build marker.
It was kind of an interesting problem, making them able to detect the flashlight on both the start and end of their move. I had to actually make them check if the square they're about to move to has a build marker before they move to it.
This means it's also fully compatible with any flashlight shape you make out of build markers.
(By the way, I put the script for the flashlight in the "yellow markings" version of the roach. It wears multiple hats.)
As a bonus, I also set it up so that they can handle invisibility and alternate targets. The rule I came up with is that they will be attracted to things like normal roaches, but always flee from the player if they get scared, and will keep fleeing in the same direction even if they can't see the player.
____________________________
The internet is no place to act like a wild animal.
[Last edited by averagemoe at 05-14-2024 12:35 AM]
|