INF_MIke64 53 Posted August 7, 2018 while {true} do { { radar lookAt (radar getRelPos [100, _x]); sleep 2; } forEach [0, 90, 180, 270]; }; Figure you guys may like this little script (change as you like) What it does it make a radar rotate to look around, what it importantly does it also not stop it from focusing on a contact and tracking it for a SAM, then once the hostile is gone it returns to rotating 3 4 1 Share this post Link to post Share on other sites
Takahashi Yuuki 29 Posted November 20, 2018 while {true} do { { radar lookAt (radar getRelPos [100, _x]); sleep 2.45; } forEach [120, 240, 0]; }; I tweaked the code a little to eliminate the jerkiness as it goes from point to point. Any lower than 2.45 will result in slightly smoother rotation but will cause the radar to occasionally reverse direction back to the previous point, pause, and then start up again. Reducing the number of points to three helps make things a little smoother as well as the ai is spending more time traversing between points that are further apart. Less than three just confuses the AI, you need at least three to establish a direction of rotation. [120, 240, 0] makes the radar start spinning instantly, instead of waiting a few moments to start up. As a last note, this script does not seem to work in the init field of the radar itself. 2 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted November 20, 2018 On 7/8/2018 at 9:29 PM, INF_MIke64 said: radar lookAt Nice INF_MIke64 ! Just to ask , You mean about this radar? B_Radar_System_01_F 2 Share this post Link to post Share on other sites
Takahashi Yuuki 29 Posted November 21, 2018 B_Radar_System_01_F, and O_Radar_System_02_F Although the script will work with any AI. Apply it to a tank gunner and the turret will spin around for instance. 3 Share this post Link to post Share on other sites
INF_MIke64 53 Posted November 21, 2018 This is more or less the scan horizon command for AI 16 hours ago, Takahashi Yuuki said: while {true} do { { radar lookAt (radar getRelPos [100, _x]); sleep 2.45; } forEach [120, 240, 0]; }; I tweaked the code a little to eliminate the jerkiness as it goes from point to point. Any lower than 2.45 will result in slightly smoother rotation but will cause the radar to occasionally reverse direction back to the previous point, pause, and then start up again. Reducing the number of points to three helps make things a little smoother as well as the ai is spending more time traversing between points that are further apart. Less than three just confuses the AI, you need at least three to establish a direction of rotation. [120, 240, 0] makes the radar start spinning instantly, instead of waiting a few moments to start up. As a last note, this script does not seem to work in the init field of the radar itself. Cool thanks Share this post Link to post Share on other sites
Sertica 18 Posted February 20, 2019 This does not work . "generic error in expression" Share this post Link to post Share on other sites
pierremgi 4900 Posted February 20, 2019 46 minutes ago, Sertica said: This does not work . "generic error in expression" Probably because you're inside an unscheduled scope, not allowing the sleep command. Try: 0 = [] spawn { while {alive radar} do { { radar lookAt (radar getRelPos [100, _x]); sleep 2.45; } forEach [120, 240, 0]; }; }; Share this post Link to post Share on other sites
Sertica 18 Posted February 20, 2019 I tried that in both mission init and a trigger with true condition. It turns one rotation, then stops. I don't understand that voodoo syntax. How can you assign to an enumeration like 0, and what is "[] spawn". Share this post Link to post Share on other sites
pierremgi 4900 Posted February 20, 2019 25 minutes ago, Sertica said: I tried that in both mission init and a trigger with true condition. It turns one rotation, then stops. I don't understand that voodoo syntax. How can you assign to an enumeration like 0, and what is "[] spawn". The on act field of the trigger must return nothing (no code, no value). So, the handle of the script (here 0) is just for this aim, this "equality" returns nothing). You could write some other handles like myCode of 1 or null, as far as you don't use it further. For spawn, follow the BIKI command. And more. There is no reason to get just one rotation with my code... except if your radar (like Cronus) detects an enemy unit (even infantry! ). Once again, BI decided to do "too clever" behavior, just forgetting the aim of an Anti-Air radar. 1 Share this post Link to post Share on other sites
Tankbuster 1747 Posted December 10, 2020 Note that both O_Radar_System_02_F and B_Radar_System_01_F require a gunner for this to work. Use createUnit to make a O_UAV_AI and moveInGunner him. 2 Share this post Link to post Share on other sites
pierremgi 4900 Posted December 10, 2020 Yes. I do almost the same to man empty radar (and launcher), so to make them operational by createVehicleCrew radar; ... command, then empty them again by {radar deleteVehicleCrew _x} forEach crew radar; (same for launcher), to disable them and give them a chance to be not fired by AI enemies. 2 Share this post Link to post Share on other sites
Tankbuster 1747 Posted December 10, 2020 Oh, yes, createVehicleCrew... forgot about that! 1 Share this post Link to post Share on other sites