shuko 59 Posted September 8, 2013 I wanted to spawn enemies in front of the player group. How to get the right direction and thus position? Using the built-in "getDir" command would be simple, but what if you happen to use it when the group leader has turned around to check up on his group? Then you would be spawning enemies in completely wrong direction. This script will tracking a group and record it's positions in given interval. You can call the function any time to get the average direction, aka a guesstimate/overall direction where the group to heading to. Starting Tracking Required Parameters: 0 Group/Object Group to track. Optional Parameters: 1 Number Recording interval, delay in seconds between position checks. 2 Number History size, number of newest positions to remember. Starting Examples: nul = dude1 execvm "SHK_intercept.sqf"; nul = grpWest1 execvm "SHK_intercept.sqf"; nul = [dude2,5,20] execvm "SHK_intercept.sqf"; Getting the Direction Function's name is SHK_intercept_getDir. It takes an object or a group as a parameter and returns a direction between 0 and 360. Required Parameters: 0 Group/Object Group to track. Optional Parameters: 1 Number Position info age when calculating direction. Given number is the Nth newest position to compare the current position. Example: positions are [a,b,c,d,e,f,g], you give 3 as info age. The position to be used for direction calculation is e. Float Range 0-1, which is applied to the size of the history. Example: size is 10 and age is 0.5, the dir will be calculated from the 5th position in the history. Or 0.2, the position would be 9th (2nd newest). 2 Number Sample size. Number of positions between newest and the one determined by info age, which is included in the average calculation as well. Examples: dir = grpWest1 call SHK_intercept_getDir; dir = [grpWest1,0.3] call SHK_intercept_getDir; dir = [grpWest1,10,5] call SHK_intercept_getDir; 2021 reupload https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Feel free to use anyway you like, or dont. 🙂 3 Share this post Link to post Share on other sites
Rydygier 1309 Posted September 9, 2013 Really useful. Can be extrapolated also average displacement speed in that direction, so also expected, approximated position after given time. Similar stuff was used in some AI arty scripts in Arma 2 for targeting (FO predicting, where moving target will be at impact (if known arty shell's TOF), and sending shells there). Not sure, if such scripting still needed for A3 arty (haven't A3, so can't check). Also for non-spawning interception, eg when AI group is chasing someone in more smart manner than only following cyclically towards current position, with that could calculate, if/where with its own expected speed (ETA) have a chance to cut fugitive's route/set ambush. If someone is in even more ambitious mood, can even try to predict on such basis final destination of such group eg be checking, if in that or similar direction (angle range) there is some possibly important place ahead (a city, road, group of units, enemy position, position often visited by this/other group in the past...) and script some guesstimated AI decisions on that. Share this post Link to post Share on other sites
Guest Posted September 10, 2013 Release frontpaged on the Armaholic homepage. SHK Intercept [bETA] v0.1 =================================================== We have also "connected" these pages to your account on Armaholic. This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have. When you have any questions already feel free to PM or email me! Share this post Link to post Share on other sites
Hatchet_AS 201 Posted September 10, 2013 Nice. Much appreciated, once again. :) Share this post Link to post Share on other sites
r.flagg 11 Posted September 10, 2013 As always, it's very kind of you to share your work. Thank you. I wanted to spawn enemies in front of the player group. I would love that too. Yet I lack the required skill to take this script to that level. Is there any chance you could be persuaded to share one of your missions that makes use of this intercept script with actual enemies spawning in front of the player group. So those of us who lack your skills can open it in editor and see how to actually take this script to that final 'pay-off' level. Share this post Link to post Share on other sites
jtgibson 18 Posted September 10, 2013 Fantastic scripting work. I'm always thrilled when I see really creative scripts -- none of this "move squad into helicopter" example nonsense that anyone can figure out with 20 minutes' work, but rather well-thought out solutions to problems that people might not have even really conceived of before: like this. Well done! Share this post Link to post Share on other sites
shuko 59 Posted September 11, 2013 I would love that too. Yet I lack the required skill to take this script to that level. Is there any chance you could be persuaded to share one of your missions that makes use of this intercept script with actual enemies spawning in front of the player group. So those of us who lack your skills can open it in editor and see how to actually take this script to that final 'pay-off' level. A quick 15min example: _example_shk_intercept.Stratis.zip After the spawning you can make them patrol or start hunting the player group etc. 1 Share this post Link to post Share on other sites
r.flagg 11 Posted September 11, 2013 Thank you very much Shuko! ;) 1 Share this post Link to post Share on other sites
Neviothr 102 Posted October 25, 2015 (edited) A quick 15min example: _example_shk_intercept.Stratis.zip After the spawning you can make them patrol or start hunting the player group etc. Do you happen to have another link for that? Edit: found it, http://shuko.kapsi.fi/arma3/ Edited October 25, 2015 by mal7house Share this post Link to post Share on other sites
shuko 59 Posted October 26, 2015 Fixed the links. 2 Share this post Link to post Share on other sites
johnnyboy 3793 Posted October 29, 2015 By conincidence, I started writing my own intercept script yesterday, but this is far superior, so I'm using this now. Plus your library of other functions looks super useful as well. Thanks much for these well documented and useful functions! Share this post Link to post Share on other sites
Undeceived 392 Posted October 29, 2015 Cool, thanks, Shuko! Share this post Link to post Share on other sites
shuko 59 Posted June 14, 2021 Blast from the past. Reuploaded https://drive.google.com/drive/folders/1XXrSZbu7nCaW2UkOVsaVbKmX0ZmfFUtg?usp=sharing Feel free to use anyway you like, or dont. 🙂 3 Share this post Link to post Share on other sites
Joe98 91 Posted June 16, 2021 Armaholic seems to be down. I have not been there in ages. Hope everybody is well. Share this post Link to post Share on other sites
Harzach 2517 Posted June 16, 2021 10 hours ago, Joe98 said: Armaholic seems to be down. I have not been there in ages. Hope everybody is well. It's all gone. C'est la vie. Share this post Link to post Share on other sites