OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Lone~Wolf 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:
_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 ;)
-
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.
-
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.
-
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.