Home   Help Search Login Register  

Author Topic: Improving Perception  (Read 1138 times)

0 Members and 1 Guest are viewing this topic.

Offline Lone~Wolf

  • Mission Tools & Mods
  • Members
  • *
  • Vladimir Dmitri Mikhail Andreevich Stamenov
Improving Perception
« on: 27 Mar 2010, 12:22:30 »
Hi AGAIN!  :D

I'm sorry for making so many topics, but I am in the middle of a time of scripting furiously to meet deadlines.

My problem this time is how to make soldiers notice enemies when it is extremely dark.

Without any augmentation, OFP A.I. will let the enemy practically walk all over them before they consider removing their weapon from their back.

I have made the following script to attempt to improve the soldier's perception, but to no avail:

Code: [Select]
_p = _this select 0
closesttarget = preprocessFile "closesttarget.sqf";
#L
~(random 2)
_t = [gblallenemies, _p] call closesttarget
? (_p distance _t) < 50 : goto "R"
goto "L"
#R
hint "REVEAL"
_p reveal _t
goto "L"

The hint does appear, suggesting that my system of identifying when an enemy is near does activate, but the reveal function does nothing to make the soldiers notice their enemies!

Can anyone suggest a better method for making my soldiers smarter?

 Thanks in advance,
     Lone-Wolf  ;)
Snarling creature, lurking in the background, still writing in .sqs

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Improving Perception
« Reply #1 on: 27 Mar 2010, 13:18:58 »
First, make sure they are created in a group recognized as enemy.
Second, you could try the setskill command for the soldiers and the addrating command with a (-) for the enemy.

Offline Lone~Wolf

  • Mission Tools & Mods
  • Members
  • *
  • Vladimir Dmitri Mikhail Andreevich Stamenov
Re: Improving Perception
« Reply #2 on: 27 Mar 2010, 14:43:15 »
I already had all of those implemented at the start of my problem.

It's not that the A.I. don't recognise the enemies as enemy, it's that their ability to see in the dark is somewhat lacking and their response times are risible.

But thanks anyway.
Snarling creature, lurking in the background, still writing in .sqs

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Improving Perception
« Reply #3 on: 27 Mar 2010, 16:14:48 »
I realize giving them NVG's would ruin the story but perhaps you could give them to the leaders and then reveal the enemy to the leader for him to call him out to his subordinates.