AgentFox2 0 Posted May 13, 2005 Hey, everyone! Some time ago I began working on a script that would allow the player (and AI) to call for suppressive fire on a position. Over time, I wanted to do more with it, and the features just kept piling on and on. Anyway, I've come to a point where I think it's best to release what I have and get feedback before I continue updating it. I call it ITMS, or Invisible Target Management System, which is a really fancy name for a bunch of really sloppy code. Basically, this set of scripts allows you to spawn and manipulate a set of invisible objects (invisible targets) that the AI can target and attack. Four examples are included in the example mission; infantry suppressive fire, close air support, close air support (with smoke activation), and ground vehicle support. They are all pretty similar, with the main differences being in presentation. I also created a new set of invisible target objects, based on Lester's awesome work. The difference is that now there are also new units for engagement priority. Lester's targets were great, but the main problem was that if a "real" enemy attacked the firing units, they wouldn't take on the new threat, but rather focus on the invisible target. This new version solves that issue with multiple groupings of differing engagement priority, based on type. Anyway, I have submitted the script and addon to OFPEC, so it can be found there for those interested. I'd like to get as much feedback and bug reports as possible, especially concerning the new low and medium priority targets and experiences with "real" enemies. Thanks in advance. Share this post Link to post Share on other sites
Blanco 0 Posted May 13, 2005 Sounds good, gonna try it in a moment Share this post Link to post Share on other sites
Blanco 0 Posted May 17, 2005 It' really good, easy to use and it works pretty well. Two Q's. 1/ What happens when you click a position which is out of range of the "shooter"? Does he move closer so he's able to hit it? 2/ Is it possble to use this with mortars? Indirect fire like GB's script. Share this post Link to post Share on other sites
AgentFox2 0 Posted May 17, 2005 It' really good, easy to use and it works pretty well. Thanks, I appreciate it. Quote[/b] ]Two Q's.1/ What happens when you click a position which is out of range of the "shooter"? Does he move closer so he's able to hit it? As far as I've tested it, the firing AI reacts to the targets like they would to any enemy. That is, an AI squad will probably move to engage. But in testing, the player's squad did not. Units using any of the examples should have a little more leeway than usual with range. Just after the script spawns the target it shoves it right in the gunner's face, then once he recognizes it as an enemy, the script moves the target to the position originally passed to the script. This takes advantage of the knowsAbout only gradually reducing after losing sight. I've been able to get machine gunners to light up targets almost 700m away with this. Quote[/b] ]2/ Is it possble to use this with mortars? Indirect fire like GB's script. Only with direct line of sight to the position. Truly indirect fire would probably be better handled by Barron's awesome script. I should mention that the examples I supplied in the demo are very simple. But I am hoping that some users will try and use some of the basic functions in new and better ways than I could have thought up. The key thing to remember is that AI reacts to the targets exactly as if they were enemy units. Bug report (for myself ): Just realized I left in a hint for the life duration script. Woops. That'll be fixed in the next update. If it's really annoying to anyone, the offending line is in ITMS_Timer.sqs Just delete this line: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hint format ["Time Limit: %1\n\nTime elapsed: %2", _tLimit, _counter] Thanks again for your questions and comments, keep 'em comin'. Share this post Link to post Share on other sites
-HUNTER- 1 Posted May 17, 2005 I used to place many inviz targets so that I could have MG's firing cover fire so I could advance with meh squad. But I only need to have the mg gunner engage the target for like 100 rounds, but it keeps shooting till it runs out of ammo, is there some way you could make the inviz target die so the mg gunner stops after some rounds! also maybee you could make a cluster of targets, so the mg gunner wouldnt fire straight at 1 point all the time but move the gun arround a bit for a better spread nice work, I must be honest and tell you I have not YET tried it! But it really sound very nice because I love the cover fire situations and they can be put to good use on certain maps that are coming soon! (old city of Najaf by Goon) Share this post Link to post Share on other sites
Wadmann 0 Posted May 17, 2005 Sounds like a great system AgentFox2, but I have not been able to take a look at it yet. I had been using Lester's targets but ran into some of the issues that you seem to have eliminated! I hope to have some time this weekend (if not, the next for sure!) to see how well this works and respond with my thoughts. @ manhunter09 You will have to either setdammage 1 (have not tried) or deletevehicle Lester's targets to get the AI to stop firing on them. Wadmann Share this post Link to post Share on other sites
-HUNTER- 1 Posted May 17, 2005 yeah but what triggers it....? I mean im not that good at scripting and well I can make triggers and such, but how do I say like fire a bit of rounds on target1 and stop and then move over to another target so(deletevehicle target1) and start firing on target2 for a few rounds and so on, but with random number of shots on each target. Like between 20-100 rounds per target...? Share this post Link to post Share on other sites
Blanco 0 Posted May 17, 2005 Instead of deleting the target, why don't you move it around with setpos? Quote[/b] ]Just after the script spawns the target it shoves it right in the gunner's face Ok, AFAIK GB's script (for grenadiers) Â does the same thing with the difference that the invisble target stays on a certain height, so the shooter fires the target while it's floating in the air. The further the unit has to fire, the higher the target will be spawned in front of the "shooter". Well not exactly, it's more difficult then that, I'm not good in that kind of math and formulas. Â But I think the same thing is possible with your script, but I dunno how. Â I tried your script in a testmission. I ordered my men to fire at a building, a bit like the famous Full Metal Jacket scene with the female VC sniper... I clicked on the map (on the building) but nobody fired, because the invisible target ("man" type) was spawned in the building and my men were not able to see it... Share this post Link to post Share on other sites
AgentFox2 0 Posted May 17, 2005 Man, I'm so terrible at documenting my own work. I'll admit it right up front. The covering fire example has the features you want, manhunter. The express purpose, infact, of keeping track of who all the groups who and their targets is so you can delete them when you're done. In the case of Covering Fire, the leader will get an action menu item saying "CEASE FIRE!" which simply deletes all of the group's targets. For other stuff (including your own target spawned using the function ITMSSpawn), there are other options. If you want to delete all targets in a ITMS-tracked group array, you can use the function ITMSClear, called like so: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[group index, group type] call ITMSClear Group index is its index in the global ITMS_**Groups array Group type is the two-letter string signifier for whichever example system the group is using. "CF" for covering fire "AS" for Air Support "AS2" for Air Support (w/ smoke activation) "VS" for Vehicle support Otherwise, there is also an option life duration argument for ITMSSpawn, which is called like so: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[Type ("Man" or "Armor" or "IR" or "Laser"), Side ("West", "East", "Res"), position, <duration>, <priority level>] call ITMSSpawn Most of that is pretty self-explanatory. Duration and priority level are both optional, so if not defined, the target will default to indefinite life and low priority against "real" enemies. For example, using this line in a radio activation field: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">["Laser", "East", (getpos bunker1), 30] call ITMSSpawn This would generate a laser target that all capable West aircraft would attempt to attack for 30 seconds. After 30 seconds, the target is deleted. You might use this as a scripted command to order a friendly aircraft to take out the enemy bunker position. As for dispersion, the script also does this. The execution line for the infantry covering fire example is like so: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[unit array, position, target side, map click shift key, random dispersion offset, ROF boolean, <rate of fire>, <rate of non-fire>] exec "FOX2_ITMS\ITMS_CoverFire.sqs" The 5th element there defines the random movement of spawned targets. In the example mission it is set at 5 meters, but setting it to 20 would result in a pretty random spread. Quote[/b] ]Instead of deleting the target, why don't you move it around with setpos? This is how the rate-of-fire function of the Covering Fire example works. You must pass "ROF boolean" as true and then define the rate of fire and "non-fire". The first being how long for the units to fire and how long between firings. This was added a t the request of one of the testers, since it ate up a lot of ammo otherwise. The problem with this is that to do so I had to move the target far away, occasionally, then move it back and tell the soldiers to re-target. The problem is that doing so makes the AI act quirky, and since you're telling him to re-target the same object repeatedly, it makes his targeting a bit inflexible. Again, sorry for my lack of proper documentation originally. Hopefully I'll smarten up in the next update. If anyone has any questions in the meantime, feel free to post them. Share this post Link to post Share on other sites
sanctuary 19 Posted May 18, 2005 I missed that thread, shame on me. After testing , i can only say this is very good and it should be really usefull on a variety of situations for missions. I appreciate particularly the possibility of customisation for the suppressive fire simulation, very handy to define the area to "suppress". Great job AgentFox2 Share this post Link to post Share on other sites