Jump to content
Sign in to follow this  
DanAK47

Prevent unit from watching unknown objects

Recommended Posts

I am trying to make my soldier (vehicle technically) watch a given direction no matter what. doWatch works fine until an unknown target is partially revealed ("Man, 12 oclock"). When that happens my soldier will watch that object until it is identified, and does not respond to doTarget or doWatch (only temporarily looks away).

I have tried disableAI "AUTOTARGET" which prevents the soldier from watching anything but what I tell him to, which has unintended consequences (soldier is autistic). I have even tried giving him sensitivity=0, and taking out canSee in the config. This didn't do anything.

So, I'm out of ideas. The soldier has to watch where I tell him no matter what (setDir maybe). If there is a way to reverse the disableAI command that would be perfect.

Share this post


Link to post
Share on other sites

u tried making the incoming unit setcaptive up to the point u want the AI to see him rock.gif

Share this post


Link to post
Share on other sites

Won't work that way.

It has to be handled within the unit's own scripts, and he would still watch them until they are identified.

Share this post


Link to post
Share on other sites

Yes, I've tried all of the command/do watch, target, and fire commands. The soldier momentarily looks away, but stays focused on the unknown object until it is revealed.

If there is a way to make an invisible and unidentifyable object that I could create and move around it would solve my problem.

Share this post


Link to post
Share on other sites

Can you get away with creating a "dumb" soldier with CreateVehicle. Then delete him and create a proper soldier when you want the guy to do something?

Share this post


Link to post
Share on other sites

I thought about that too, but don't think I could pull it off. The soldier would be given a different face/identity when he was recreated.

I also wasn't able to dumb the soldier down effectively. Although I made it impossible for him to see anything, when another unit or the player reports "man, 12 oclock, 500" the guy still looks at it.

The setdir thing also won't work, seeing as the vehicle uses a turret.

Share this post


Link to post
Share on other sites

saveStatus and loadStatus will work if I can figure out a way to create a unique ID string to save the persons status as every time the script is executed. I don't think I can just use _firer saveStatus "firerStatus" because that will be overwritten if the script is executed more often than once at a time.

I might make another topic for that because it's not really related to the title of this one.

Share this post


Link to post
Share on other sites

Ha, got it.

_firer saveStatus format ["%1",_firer]

_firer loadStatus format ["%1",_firer]

I guess this will have to do. Seems like if the guy was moved to a different group, while the script was running, and someone else joined the old unit in his place and executed the script, it would break. Fortunately, that is unlikely.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×