Check if bot see a projectile

Discussions about Coding and Scripting
Post Reply
User avatar
Vankuss
Experienced
Posts: 111
Joined: Wed Jan 25, 2012 6:35 pm

Check if bot see a projectile

Post by Vankuss »

Hi guys.

It's again me, the noob that know nothing about coding. Anyway, I need again your help.

I know the function .LineSightTo, or something similiar. The par is an actor, and the function is very useful. But what I need is another thing. As you know (no, you really don't know) I'm trying to make a Betrayal mode, and I am a good point (lol, really).

Basically, if player A shoots with the secondary fire of his weapon (the modified InstaGib version), and a bot (specifically, one of player's mates) sees it, THEN DO X.

The problem is the part of the bot seeing the projectile (the beam of the InstaGib rifle) but in another mode. I could trying to do something like if a player shoots with the secondary rifle and his crosshair is near the bot, THEN DO X. But it would be not an ideal solution.

What do, guys?
User avatar
Voodoo Doll
Average
Posts: 42
Joined: Wed Aug 03, 2011 2:27 am
Location: Russian Federation

Re: Check if bot see a projectile

Post by Voodoo Doll »

maybe need to execute foreach(visiblecollidingactors(class<Projectile_class>)) checking on appropriate bot via special inventory class or mutator bot class, etc. but this way eats CPU much...
MrLoathsome
Inhuman
Posts: 958
Joined: Wed Mar 31, 2010 9:02 pm
Personal rank: I am quite rank.
Location: MrLoathsome fell out of the world!

Re: Check if bot see a projectile

Post by MrLoathsome »

Perhaps you could modify the InstaGib weapon itself, so the alt fire triggers bots within the radius you need to do X.

The foreach search in that case should be less harsh on the CPU I think.

Correct me if I am wrong.
blarg
Post Reply