{"name":"knowsAbout","operator":null,"title":"knowsAbout","type":"command","url":"https://community.bistudio.com/wiki/knowsAbout","revid":347557,"updated":"2023-09-28T09:45:05Z","groups":["Object Manipulation","Sides"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":null,"server_exec":false},"exec":null,"description":"Checks if a group or a side knows about target.\n- Enemy knowledge is instantly shared among the group units\n- Units in the same group always perfectly know about each others\n- AI knowledge cannot check beyond current viewDistance and it resets to zero as soon as the target's distance is over it\nNote: neither fog nor daylight affect this behaviour\n- Losing sight of a target for more than 120 seconds resets its knowsAbout to zero as well\n- **Magic number** is the value that must be reached for a unit to shoot at an enemy (used by \"Detected by\" triggers as well):\n\n|  |  |  |  |  |  |  |\n|---|---|---|---|---|---|---|\n| Game | Operation Flashpoint v1.46 | Operation Flashpoint: Resistance v1.96 | Armed Assault v1.18 | Arma 2 v1.11 | Arma 2: Operation Arrowhead v1.62 | Arma 3 v1.82 |\n| Magic value | 0.7 | 0.105 | ? | ? | ? | ? |","syntaxes":[{"syntax":"who knowsAbout target","since":null,"effect":null,"exec":null,"params":[{"name":"who","type":"Object, Group or Side","optional":false,"default":null,"description":"if a unit, unit's group is considered; if a vehicle, vehicle commander's group is used.","types":["Object","Group","Side"],"since":null,"text":"who: Object, Group or Side - if a unit, unit's group is considered; if a vehicle, vehicle commander's group is used."},{"name":"target","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"target: Object"}],"returns":{"type":"Number","types":["Number"],"description":"in range of 0..4, where 4 is maximum knowledge.","text":"Number - in range of 0..4, where 4 is maximum knowledge."},"form":"binary","operator":null,"left":{"text":"who","types":["Object","Group","Side"]},"right":{"text":"target","types":["Object"]}}],"examples":[{"text":"```sqf\n_knowledge = player knowsAbout _target;\n```","code":["_knowledge = player knowsAbout _target;"]},{"text":"```sqf\n_knowledge = (group player) knowsAbout _target;\n```","code":["_knowledge = (group player) knowsAbout _target;"]},{"text":"```sqf\n_knowledge = (side player) knowsAbout _target;\n```","code":["_knowledge = (side player) knowsAbout _target;"]}],"multiplayer":"*who* **must** be local, while *target* can be remote.","problems":null,"aliases":[],"see_also":["nearTargets","reveal","getHideFrom","targetKnowledge","targetsAggregate","targetsQuery","forgetTarget"],"notes":[{"user":"Hardrock","date":"2006-08-04T10:55:00Z","text":"Operation Flashpoint: Resistance v1.91\n- As soon as An AI unit gets hit with a bullet his knowsAbout level for the unit that shot him will instantly jump to 1.5, even if the shooter is 1000m away.\nVice versa is also true. If An AI soldier's knowsAbout level for an enemy is 0.7 and the soldier fires and hits the enemy, his knowsAbout level about the enemy will instantly jump to 1.5.\n- Some editors have found, whilst using this command over the years, that the following characteristics have cropped up:\n  - AI enemies have a very limited amount of peripheral vision, it is not nearly as good as a human player's. A target must be in front of the unit for him to be noticed, so if you sprint right behind an enemy, this value doesn't increase.\n  - Depending on the unit's skill level, it can take a little time for the unit to notice a target. So if you run right past a unit, this value might not increase.\n  - Bushes between the unit and the target seem to have little effect on this value, and trees definitely have no effect. You may be in a forest and can't see the unit, but he can see you."},{"user":"Bdfy","date":"2007-01-16T16:25:00Z","text":"`the magic knowsAbout number is 0.105` It's not that simple. Maybe true for infantry but not all vehicles:\n\nReveal command sets knowsAbout to 1, but planes still won't fire at soldiers on the ground.\nThere's only one known way to pass through this - designate target with another fake infantry unit near the target.\nAs soon as this fake unit see the target knowsAbout lifts up to 2.5-4 and even single enemy soldiers are attacked from the air (of course if plane has suitable munition :))"},{"user":"Kju","date":"2012-06-14T10:01:00Z","text":"According to **Suma**:\n\nAll friendly units within a view distance to each unit [are revealed (to the player? or each friendly?)] on the mission start.\nThe code is half broken, as it does not make the units known, it only sets the \"accuracy\" value for them.\n\nNote: This is not affecting enemy units at all."},{"user":"Helling3r","date":"2013-03-27T23:25:00Z","text":"Arma 2: Operation Arrowhead v1.62 infantry tests:\nIt is still true that the command returns values between 0 (lowest) and 4 (most). Freshly Spotted units will have at least 1.5, slowly decreasing when the target disappeared.\nThe following table shows my test results on a clear day in Takistan using the Vector. Please note that the returned values vary considerably depending on weather and time. Moonlight however seems to not have any considerable effect.\n\n|  |  |  |\n|---|---|---|\n| \\|  \\|  \\|  \\|<br>\\|---\\|---\\|---\\|<br>\\| 12:00, sunlight, clear sky \\| Distance \\| knowsAbout \\|<br>\\| 1530 \\| 1.5 \\|  \\|<br>\\| 1370 \\| 1.5 \\|  \\|<br>\\| 1250 \\| 1.5 \\|  \\|<br>\\| 1135 \\| 1.5 \\|  \\|<br>\\| 1055 \\| 1.52 \\|  \\|<br>\\| 1022 \\| 1.64 \\|  \\|<br>\\| 990 \\| 1.74 \\|  \\|<br>\\| 833 \\| 2.5 \\|  \\|<br>\\| 720 \\| 3.37 \\|  \\|<br>\\| 600 \\| 3.81 \\|  \\|<br>\\| 505 \\| 3.86 \\|  \\|<br>\\| 400 \\| 3.92 \\|  \\|<br>\\| 380 \\| 4 \\|  \\|<br>\\| 365 \\| 4 \\|  \\| | \\|  \\|  \\|  \\|<br>\\|---\\|---\\|---\\|<br>\\| 21:00, bright half moon, clear sky \\| Distance \\| knowsAbout \\|<br>\\| 285 \\| 1.5 \\|  \\|<br>\\| 120 \\| 1.5 \\|  \\|<br>\\| 88 \\| 1.89 \\|  \\|<br>\\| 75 \\| 2.3 \\|  \\|<br>\\| 61 \\| 3.9 \\|  \\| | \\|  \\|  \\|  \\|<br>\\|---\\|---\\|---\\|<br>\\| 23:00, pitch black, clear sky, NVG on \\| Distance \\| knowsAbout \\|<br>\\| 600 \\| 1.5 \\|  \\|<br>\\| 487 \\| 1.5 \\|  \\|<br>\\| 390 \\| 1.5 \\|  \\|<br>\\| 289 \\| 2.22 \\|  \\|<br>\\| 278 \\| 2.4 \\|  \\| |"},{"user":"Lou Montana","date":"2018-06-03T10:46:00Z","text":"Arma 3 v1.82 knowsAbout tests, player moving towards enemy AI, facing each other:\n\n|  |  |  |  |  |  |  |  |  |\n|---|---|---|---|---|---|---|---|---|\n| + Tests executed in VR, default date (2035-05-28), with AI behaviour \"AWARE\" | Daytime | AI equipment | AI skill and rank | player stance and speed | player outfit | first detection distance | first detection value | max detection (4) |\n| 13:37 | Katiba + ACO (Green) | 0.5 - private | Standing, running | B_Soldier_F | 245.663 | 0.148076 | 132.863 |  |\n| 13:37 | Katiba + ACO (Green) | 0.5 - private | Standing, running | **underwear only**, rifle | 246.815 | 1.19377 | 132.9 |  |\n| 13:37 | Katiba + ACO (Green) | 0.5 - private | Standing, running | B_Soldier_F, **no uniform** | 241.885 | 1.24 | 132.56 |  |\n| 13:37 | Katiba + ACO (Green) | 0.5 - private | Standing, running | **B_Sniper_F** | 156.715 | 2.95534 | 133.019 |  |\n| 13:37 | Katiba + ACO (Green) | 0.5 - private | **Lying down, running** | B_Soldier_F | 105.401 | 4 | 105.401 |  |\n| 13:37 | Katiba + ACO (Green) | 0.5 - private | **Crouching, running** | B_Soldier_F | 193.232 | 1.94615 | 134.556 |  |\n| 13:37 | Katiba + ACO (Green) | 0.5 - private | **Standing, sprinting** | B_Soldier_F | 235.001 | 1.3146 | 134.445 |  |\n| 13:37 | Katiba + ACO (Green) | **0.2 - private** | Standing, running | B_Soldier_F | 214 | 0.166763 | 124.553 |  |\n| 13:37 | Katiba + ACO (Green) | **1.0 - private** | Standing, running | B_Soldier_F | 293.065 | 1.11004 | *140.088* |  |\n| 13:37 | Katiba + ACO (Green) | **0.5 - colonel** | Standing, running | B_Soldier_F | 245.641 | 1.20426 | 132.113 |  |\n| 13:37 | **no weapon** | 0.5 - private | Standing, running | B_Soldier_F | 421.959 | 0.283476 | 109.274 |  |\n| 13:37 | **Katiba + LRPS** | 0.5 - private | Standing, running | B_Soldier_F | 244.962 | 4 | 244.962 |  |\n| **20:00** | Katiba + ACO (Green) | 0.5 - private | Standing, running | B_Soldier_F | 132.089 | 0.62443 | 49.4895 |  |\n| **20:00** | **Katiba + ACO (Green), no NVG** | 0.5 - private | Standing, running | B_Soldier_F | 10.6837 | 4 | 10.6837 |  |\n\nCode used (click on \"Expand\" to the right):\n\n```sqf\nplayer allowDamage false;\nplayer enableFatigue false;\n\nplayer setPosATL [0,0,0];\nplayer setDir 0;\nunit setPosATL [0,500,0];\nunit setDir 180;\n\nwaitUntil { speed player > 0 };\n\n[unit, player] spawn {\n    params [\"_unit1\", \"_unit2\"];\n    private _time = time;\n    private _knowsAboutData = [\n        format [\"world = %1\\ndate = %2\\nanim = %3\\nweapon/scope = %4/%5\\nskill/rank = %6/%7\\nplayerType = %8\",\n            worldName,\n            date,\n            animationState player,\n            primaryWeapon _unit1,\n            (_unit1 weaponAccessories primaryWeapon _unit1) select 2,\n            skill _unit1,\n            rank _unit1,\n            typeOf _unit2\n        ]\n    ];\n    private \"_knowsAbout\";\n    private \"_entry\";\n    while { alive _unit1 && alive _unit2 } do\n    {\n        _knowsAbout = _unit1 knowsAbout _unit2;\n        _entry = [_unit1 distance _unit2, _knowsAbout];\n        _knowsAboutData pushBack _entry;\n        systemChat format [\"time: %1 - %2\", round (time - _time), _entry];\n        copyToClipboard str _knowsAboutData;\n        sleep 1;\n    };\n};\n```"},{"user":"ComradeCheekiBreeki","date":"2021-09-01T04:16:29Z","text":"As of at least Arma 3 v2.04, all sides appear to always perfectly know about props (`knowsAbout` of 4) unless they are beyond max view distance. Direction of the observer, distance between observer and object (excluding those which are beyond the max view distance) and amount of obstructions between them do not seem to affect it. However, there is a short ~0.5 second delay after mission start before units perfectly know about props.\n\nIn addition, props appear to always have a `knowsAbout` value of 0 regardless of side or other object checked, including other props."}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Command Group: Sides","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}