Funkman 10 Posted June 12, 2010 Hello, I am making a movie, and I want some tanks to fire shells at a running man. I want the shells to miss and explode around him to look impressive. Originally, I was placing markers, and using this code: T1 (the tank) doTarget Marker1;Sleep 1.5; T1 fire "D81"; It didnt work I dont know why, So I tried using camera.sqs to get a location beside where he runs, I now tried this: T1 doTarget [-90285.16,11845.05,-7337.04];Sleep 1.5; T1 fire "D81"; This isnt working either. Any suggestions? Share this post Link to post Share on other sites
Fuzzy Bandit 10 Posted June 12, 2010 Sounds like doing that might require a lot of annoying things! :D Maybe try creating an invisible target (included in ACE) in the places you want the tank to fire, and then make the man "Neutral" by using: unit setCaptive true; Failing that, MP might be a good way to go! :D Share this post Link to post Share on other sites
wokstation 0 Posted June 12, 2010 T1 selectWeapon "D81"; (driver T1) selectweapon "D81"; (driver T1) lookAt (getMarkerPos Marker1); (driver T1) doTarget (getMarkerPos Marker1); Sleep 1.5; T1 fire "D81"; ? Share this post Link to post Share on other sites
Funkman 10 Posted June 13, 2010 What do you mean "never mind"? I want a solution please! Wokstation, thanks for the suggestion, I will try that, but is "driver" the right person to be doing the targeting throughout? Share this post Link to post Share on other sites
Fuzzy Bandit 10 Posted June 13, 2010 :D By "never mind" he means that someone else has already solved the problem. I'm sure Wokstation's suggestion will work. Share this post Link to post Share on other sites
Funkman 10 Posted June 13, 2010 Well if that is what he meant then s(he) should have said so. Unhelpful at best. Share this post Link to post Share on other sites
wokstation 0 Posted June 13, 2010 What do you mean "never mind"? I want a solution please!Wokstation, thanks for the suggestion, I will try that, but is "driver" the right person to be doing the targeting throughout? No, you're right. Do gunner instead, silly me :) Share this post Link to post Share on other sites
Funkman 10 Posted June 14, 2010 Well, Wokstation, I am afraid it did not work for me, I substituted "gunner" for "driver", but still no luck. Share this post Link to post Share on other sites
wokstation 0 Posted June 14, 2010 It may be the marker that's the problem then - you need some other target...? Share this post Link to post Share on other sites
f2k sel 164 Posted June 14, 2010 (edited) The code does work with a little changing, for some reason I can't get it to work using an array of targets. Anyway this will fire on four gamelogics named targ1,targ2,targ3,targ4. T1 dowatch Targ1; sleep 2; T1 selectWeapon "D81"; gunner T1 selectweapon "D81"; gunner T1 lookAt targ1; gunner T1 doTarget targ1; Sleep 1.5; T1 fire "D81"; sleep 4; T1 dowatch Targ2; sleep 2; T1 selectWeapon "D81"; gunner T1 selectweapon "D81"; gunner T1 lookAt targ2; gunner T1 doTarget targ2; Sleep 1.5; T1 fire "D81"; sleep 4; T1 dowatch Targ3; sleep 2; T1 selectWeapon "D81"; gunner T1 selectweapon "D81"; gunner T1 lookAt targ3; gunner T1 doTarget targ3; Sleep 1.5; T1 fire "D81"; sleep 4; T1 dowatch Targ4; sleep 2; T1 selectWeapon "D81"; gunner T1 selectweapon "D81"; gunner T1 lookAt targ4; gunner T1 doTarget targ4; Sleep 1.5; T1 fire "D81"; sleep 4; Now if someone could get it working using an array of targets that would be better. Has anyone noticed how the barrel of the T72 at distance always points to the front of the tank even when firing in opposite direction. . Edited June 14, 2010 by F2k Sel Share this post Link to post Share on other sites
Cyborg11 10 Posted June 14, 2010 (edited) Should work: _targetArray = [Targ1, Targ2, Targ3, Targ4]; _tank = T1; { _tank dowatch _x; sleep 2; _tank selectWeapon "D81"; (gunner _tank) selectweapon "D81"; (gunner _tank) lookAt _x; (gunner _tank) doTarget _x; sleep 1.5; _tank fire "D81"; sleep 4; } forEach _targetArray; Edited June 14, 2010 by Cyborg11 Share this post Link to post Share on other sites
Chris Death 0 Posted June 14, 2010 By "never mind" i guess he meant he posted something that has already been said in this thread or that he came to the conclusion that what he originally posted didn't make sense, so he did overwrite the already existing post with the "never mind" thingy. At least that's the way i've seen ppl doing in posts. ;) ~S~ CD Share this post Link to post Share on other sites
f2k sel 164 Posted June 14, 2010 Thanks Cyborg112 the only correction was the array _targetArray = [Targ1, Targ2, Targ3, Targ4]; Share this post Link to post Share on other sites
wickedstigma 10 Posted June 16, 2010 Does someone knows the classname of the invisible targets? Ive been trying to make an A10 fire its main gun to the middle of a marker and despite everything I tried nothing worked. So I think by creating an invisible target in the marker I could do that. Share this post Link to post Share on other sites
Funkman 10 Posted June 18, 2010 Hmm, thanks for the scripts Sel, I will try them out tomorrow. Stigma, good luck with that, as the A10 gun is not aimable, you will have to get the A10 to fly right at the target before you can fire.... 'select weapon' command, combined with 'disableAI' to stop it changing the weapon back? Then doTarget, doFire? Share this post Link to post Share on other sites
f2k sel 164 Posted June 18, 2010 I think if your just doing an cam script then the best solution would be to get the tank to fire at an object out of sight using the script and then spawn a bomb it the exact location as it would be more accurate. Cyborg has corrected his script now and should work fine. Share this post Link to post Share on other sites
CarlGustaffa 4 Posted June 18, 2010 @wickedstigma: Invisible ACE targets can be found here. No solution for vanilla game. Probably BIS doesn't want us to "break the AI rules" or something :p Share this post Link to post Share on other sites
f2k sel 164 Posted June 18, 2010 That's what it looks like but BIS cheat by having invisible fences that aren't listed in the editor. Share this post Link to post Share on other sites
CarlGustaffa 4 Posted June 18, 2010 If you know about any invisible BIS targets, I would be extremely happy to know about them. I have many uses for them. If you know the classnames, please share them, or where they are found :) Share this post Link to post Share on other sites
f2k sel 164 Posted June 18, 2010 If you know about any invisible BIS targets, I would be extremely happy to know about them. I have many uses for them. If you know the classnames, please share them, or where they are found :) They're not targets just invisible fences of different sizes, I gues you could place them on rooftops to stop the ai falling off while allowing them to move. I find it best to make one in the mission.sqm as then you can place them using the editor. BIS_fence1 = createVehicle ["InvisibleFence2", getpos gamelogic, [], 0, "CAN_COLLIDE"]; BIS_fence1 = createVehicle ["InvisibleFence3", getpos gamelogic, [], 0, "CAN_COLLIDE"]; Share this post Link to post Share on other sites
CarlGustaffa 4 Posted June 18, 2010 Ok. Useful to know, never heard of those before. So, putting one of them out does work for doTarget (for infantry). But doFire will not. And if you do the fire command on an infantry, well let's just say he won't be hitting the target. Action ["useweapon"...] was also futile, for infantry. So it seems the only way to make an "addon free mission" these days is to include a mission specific addon? I must say, that kind of sucks. :mad: Watch a machinegunner fire "M240" while prone, and be amazed :( I think I'll open a new A2 CIT ticket for improvements to the fire command. Share this post Link to post Share on other sites
f2k sel 164 Posted June 18, 2010 When you consider how often this subject comes up it does seem odd that we still have a struggle getting units to target certain objects and fire at them. Share this post Link to post Share on other sites
Funkman 10 Posted June 19, 2010 So the gist here is that creating an invisible fence can be used for doTarget but not doFire? What about doTarget followed by "fire" (Weapon) once the unit has targeted the object? Share this post Link to post Share on other sites
CarlGustaffa 4 Posted June 20, 2010 Try, and see how you like the results. I know I didn't... Share this post Link to post Share on other sites