Blitzen 10 Posted January 18, 2011 Since the day that I installed Operation Flashpoint on my computer, I've looked and looked for an AC-130 Spectre addon. I suppose my intrest in this well armed beasty has been sparked by recent movies (Transformers!) and video games (Modern Warfare...) I must say that I was quite disappointed when I found out that a true AC-130 is impossible because the Operation Flashpoint engine does not support side mounted/turrent'd airplanes. However, I was wondering how hard and plausible it would be to make an AC-130 gun cam? What I am suggesting is the creation of something along the lines of a targeting computer. Since a picture is worth a thousand words, here is a video of something similar from ARMA: ARMA AC-130 Simulation This video captures the principle of what I'm trying to suggest: Instead of trying to build an AC-130 and thereby try to by-pass the game limitations, we instead let the player control a targeting computer. Let me say that I believe that it would be possible to do this because numerous other people have already created addons that are similar to this idea. For example, the addon with the most potential is this Satellite Script Addon (pictured below) This addon simulates overhead satellite coverage. The really niffty thing is that it allows for tracking of an object/human. After looking at the scripting, of which I have very limited knowledge, I think it would be possible to camcreate an explosion on the tracked object thereby simulating an AC-130 round. However, the imagery is taken from an overhead view (as would be expected from a satellite). I know this can be fixed/changed for a moving object because numerous other addons allow a player to view a camera feed from a moving object (UAV addons come to mind:)) Honestly, if I had the knowledge and skills to create something like this then I would already be working on it. I just wanted to post my ideas here and see what other people think about it. Hopefully it is possible and someone will take up the challenge (*fingers crossed*) Thanks, Blitz Share this post Link to post Share on other sites
SilverRanger 11 Posted January 18, 2011 The problem with these types of scripts is that they are all dialogue based. you control the movement of the camera by clicking on buttons on the dialogue screen or at best by using a control script similar to camera.sqs. In either case you can't actually point and fire with the mouse as if you were a gunner on vehicle, which would result in horrible and frustrating targeting. One discussion I seemed to remember, offered the solution of creating an invisible vehicle with gunner only and attaching it to the bottom of the plane through a SetPos script. I don't know if anyone actually tried it, but so far I saw no such release. There are however some script that simulate an AC130 attack. Poke around in Editor's Depot and you might find some. If you don't I've written a pretty good sim script myself that's dying to get tested :) It's still in beta, since I'm too lazy and too busy to actually refine it, but worked 99% so far in my tests. If however what you actually want is something similar to Modern Warfare's AC130, you're better off switching to . Share this post Link to post Share on other sites
Blitzen 10 Posted January 18, 2011 SilverRanger said: The problem with these types of scripts is that they are all dialogue based. you control the movement of the camera by clicking on buttons on the dialogue screen or at best by using a control script similar to camera.sqs. In either case you can't actually point and fire with the mouse as if you were a gunner on vehicle, which would result in horrible and frustrating targeting. I suppose you could add a button that would enable you to fire? With the tracking feature, I dont think it would be very frustating as the shell would always hit near the target. It would, however, not be very interactive. SilverRanger said: One discussion I seemed to remember, offered the solution of creating an invisible vehicle with gunner only and attaching it to the bottom of the plane through a SetPos script. I don't know if anyone actually tried it, but so far I saw no such release. Once again, I dont really know much about scripting/making addons but Im pretty sure this could be done. I remember Footmunch's Tu-22 Backfire had a rear tailgunner (LINK) and [APS]Gnat took it a step farther and added "tailgunners" to an AC 130 (LINK) creating, in principle, an AC-130 Spectre SilverRanger said: There are however some script that simulate an AC130 attack. Poke around in Editor's Depot and you might find some. If you don't I've written a pretty good sim script myself that's dying to get tested :) It's still in beta, since I'm too lazy and too busy to actually refine it, but worked 99% so far in my tests. I've been looking around on the Editor's Depot for AC-130 scripts but all the ones I've found have dead links. I would really love to try yours out :D! Thanks for the input, Blitz Share this post Link to post Share on other sites
SilverRanger 11 Posted January 18, 2011 Haven't seen the Tu-22 but I think it's the same concept as the Gnat's B52. In that addon the tail gun is AI controlled only! I haven't checked out his AC130, but now that you've pointed it out, I'll give it a try. Anyway, here is the sim script I wrote. I've included a detailed readme and an example mission. Let me know what you think of it... Share this post Link to post Share on other sites
Blitzen 10 Posted January 19, 2011 SilverRanger said: Haven't seen the Tu-22 but I think it's the same concept as the Gnat's B52. In that addon the tail gun is AI controlled only! I haven't checked out his AC130, but now that you've pointed it out, I'll give it a try. I dont think he ever released anything with the AC-130. I know that the turrents would be AI controlled but as long as they can pick up targets easily, I would be fine with that. Im downloading your script now and will try to play around with it later tonight. Thanks for the quick reply and the script :D Share this post Link to post Share on other sites
BronzeEagle 2 Posted January 19, 2011 good job men! keeping the spirit of flashpoint alive, thank you guys. Share this post Link to post Share on other sites
Blitzen 10 Posted January 19, 2011 (edited) Im trying to fool around with the B52 and the backfire to try and re-create what Gnat did with the AC-130. Here goes nothing **EDIT** Okay, I fail at editing config files :banghead: If someone is going to re-create what Gnat did, its not going to be me :( Ranger, I tried your script and I liked what I saw (especially the chain guns :)). I wasnt that big of a fan of the radio messages though; it would be neat if there were replaced by dialouge. In your readme you say: Quote The chain gun shots are actually created at a random position inside a 500m radius from the selected target at an altitude of 500m. Each shot is then “guided†towards the target using the intercept.sqf. It is possible to have them all originate from an actual c130 flying over the area, but there is no way to avoid line of sight issues or the erratic behaviour of AI pilots. What would this actually look like with shots originating from the AC-130? Also, I think it would be really cool if you mixed in some tracers with the chaingun fire. Lastly, I know that someone had once upon a time released a "holding pattern" script for aircraft. This would cause a plan to circle an area while it waited for a certain condition to be met. I was wondering if anyone has a download link for this? It seems like it would be a good way to have an AC-130 circling an area. Edited January 19, 2011 by Blitzen Share this post Link to post Share on other sites
SilverRanger 11 Posted January 19, 2011 Blitzen said: What would this actually look like with shots originating from the AC-130? you can try if you want but be ready to face frustration :D place a c130 (or any type of plane), place 4 waypoints in the 4 corners of the area you want the plane to cover, place a 5th Cycle waypoint next to the 1st and set the 1st waypoint to Careless/Limited. in the init.sqs add these lines plane=theNameOfTheAC130 plane setCaptive true plane FlyInHeight 500 "[group plane,_x] setWPpos [(getWPpos [plane,_x] select 0),(getWPpos [plane,_x] select 1),500]" forEach [0,1,2,3,4] now open the ac130.sqs, find this line _randompos = [(getpos _target select 0)+ _randposx,(getpos _target select 1)+_randposy,500] and replace it with this one _randompos = [(getpos plane select 0),(getpos plane select 1),(getpos plane select 2)-15] this should have all shots originate 15m below your plane, to avoid hitting it keep in mind that while this will look more or less good on a flat plain or over a large empty area, if you try it in mountains you'll see some pretty stupid stuff happening :p mountains, hills and canyons naturally effect the height of the plane, which often makes the dumb AI pilots stall and crash. meanwhile it is impossible to define line of sight so the plane will look like it's attacking the side of a hill, when in reality the target is simply on the other side of that hill :D also in some of my earlier tries I seem to remember loading from a save and the plane would just take a nose dive for no apparent reason and crash head on to the ground:rolleyes: Share this post Link to post Share on other sites
Blitzen 10 Posted January 20, 2011 SilverRanger said: you can try if you want but be ready to face frustration :Dkeep in mind that while this will look more or less good on a flat plain or over a large empty area, if you try it in mountains you'll see some pretty stupid stuff happening :p mountains, hills and canyons naturally effect the height of the plane, which often makes the dumb AI pilots stall and crash. meanwhile it is impossible to define line of sight so the plane will look like it's attacking the side of a hill, when in reality the target is simply on the other side of that hill :D also in some of my earlier tries I seem to remember loading from a save and the plane would just take a nose dive for no apparent reason and crash head on to the ground:rolleyes: I must admit that I havent tried those changes yet but I was wondering what you think of this.... Awhile ago I got some help making a script for AI controlled planes that would "stop" them from doing their stuka styled dive bomb attacks. Here is a copy of it Quote _plane = _this select 0#diveLoop @(getpos _plane select 2) <= 50 _x = velocity _plane select 0 _y = velocity _plane select 1 _z = velocity _plane select 2 ? _z <= 0 : _z = _z + 25; _plane setvelocity [_x,_y,_z] ?! alive _plane : goto "end" ?!((driver _plane) in _plane) : goto "end" ~.05 goto "diveLoop" #end exit Although I dont really understand much about the script itself, in-game it adds height to an aircraft if it is below a certain altitude. This enables a plane to recover from steep/swoop dive bombs without crashing as it adds altitutde (consequently, the movement of the plane can get choppy). Maybe this could be taken to the extreme with an AC-130 so that it never goes below an altitude of 500? Then, when the altitude does need to be adjusted it can be adjusted in small increments if it is above a certain altitdue (say 300) and a bigger increment if it is below a certain altitude (say 200)? Anyways, maybe it will help :). Also, have you considered attaching the engagement trigger to an AC-130, so that it will follow the plane around? This would simulate the gun range of the plane. Additionally, would you be able to add the tracers to the gun fire? With how the script is setup now, you cant tell where fire is coming from, which is fine if its not supposed to be coming from a specific plane. However, if you are trying to make the gunfire appear as if it is coming from an actual plane, then it would be soooo much cooler if there were tracers, so you can trace the fire back to the plane. Share this post Link to post Share on other sites
SilverRanger 11 Posted January 20, 2011 LOL:D:D:D I think you may be forgetting who gave you the script to keep the planes from stalling :D but to answer your questions it's easy enough to attach tracers to the 25mm rounds, although the ammo I use in the script are the original BIS ones that already have tracers. I intentionally had the example mission take place at night so you can see them more clearly. If you wish to add others though, all that is needed is to create a drop and give it the same velocity as the rounds. give it a try and if you can't do it, I'll be happy to make them. as to your other point, attaching the trigger to the plane is also easy. still, this script was written for a specific mission, so I added a parameter inside the script that terminates it once that trigger has no enemy units inside it's radius. an easy fix, but given that the plane would need some additional time to circle back into firing position, you would have to change all the delay parameters as well, otherwise it would take way too long between shots. now regarding the firing position, I know that the shots come from a different direction each time and that's supposed to simulate the plane flying around. it does however look a bit off sometimes when it fires a second time at the same target because the firing position has changed. that is a dumb mistake I neglected to fix, but all that's actually needed is to take the position generator line outside the loop. I'll try to find some time the next couple of days to fix it. btw, thanks for all the feedback... Share this post Link to post Share on other sites
Blitzen 10 Posted January 23, 2011 SilverRanger said: I think you may be forgetting who gave you the script to keep the planes from stalling :D[/Quote] Ah, so that was you eh? :p I must apologize if I made it sound as if I had made that script. I dont wanna come off as someone who is unthankful for all of the help I've received on these forums. I am especially grateful to you because, as I stated, this is something that I've always wanted in this game :notworthy:. SilverRanger said: but to answer your questions it's easy enough to attach tracers to the 25mm rounds, although the ammo I use in the script are the original BIS ones that already have tracers. I intentionally had the example mission take place at night so you can see them more clearly. If you wish to add others though, all that is needed is to create a drop and give it the same velocity as the rounds. give it a try and if you can't do it, I'll be happy to make them. I figured out that I cant seem to see tracers because of something having to do with the FFUR-SLX mod. When I tried the scripts in vanilla OFP I saw the tracers and I must say that it looks soooooo much better with tracers :635:. I also tried adding the admendments you posted to make fire appear as if it is coming from a specific plane. There is problem with doing this: Once the plane starts to engage infantry, the shots actually appear and detonate on the ground that is immediately below the plane (instead of appearing 15 meters below it and moving towards the target). I also found another error having to deal with a "divide by zero" issue: I dont know if this is really that big of a problem as the script continued to run without any problems other problems. Once again, thank you very much for your help on this. I know OFP is an outdated game but I believe that the community it has is one of the main reasons as to why people still play it today. Blitz Share this post Link to post Share on other sites
SilverRanger 11 Posted January 24, 2011 didn't mean to imply you were stealing my script man. it was just a bit funny to be getting back my own advice :D anyway, the division by zero error comes from the intercept.sqf. probably something to do with the specific angle of the round that results is 0. nothing to worry about as it doesn't happen often and has little effect on the rest of the script... as for the problem with the rounds exploding under the plane, I saw the same thing. It's a well known problem, caused by the stupidity of the script's author:p try this instead #FireRounds _addx = random 10 _addz = random 10 ? _addx > 5 : _addx = _addx -10 ? _addz > 5 : _addz = _addz -10 _APround = "Cannon25HE" camcreate [(getpos plane select 0),(getpos plane select 1),(getpos plane select 2)-15] _APround setvelocity [1,1,-500] _AProundspeed = [_APround,_target,_count,_addx,_addz] call Intercept _APround setvelocity (_AProundspeed select 2) Drop ["kouleSvetlo","","Billboard",0.1,5,[0,0,0],(_AProundspeed select 2),0,2,1,0,[5,5,5],[[1,0.5020,0.2510,1]],[0,0,0],0,0,"","",_APround] this should fix the problem with the rounds and also add cool looking tracers that will work with SLX. it doesn't however look too good in vanilla OFP with both the original and custom tracers, but you can either delete the drop line or change the ammo used from "Cannon25HE" to "Heat73" for example and get the same basic effect but with a bit more punch :cool: just name your aircraft as "plane" or define it as "plane" in init.sqs (or anywhere you want). you can also add a third variable to the script by adding _plane = _this select 2 in the beginning of the script, changing all "plane" instances to "_plane" and calling the script like this [unitName,Side,NameOfPlane] exec "ac130.sqs" Share this post Link to post Share on other sites
Blitzen 10 Posted January 24, 2011 Hey, I just tried it in the editor and the rounds still seem to detonate on the ground beneath the plane :(. There are tracers created and they do seem to move towards the target, but they are at ground level. Also, if I do this: Quote you can also add a third variable to the script by adding _plane = _this select 2 in the beginning of the script, changing all "plane" instances to "_plane" and calling the script like this when I call the script I can use any sort of "custom" name I want correct? If so, then do I add: Quote _plane = _this select 2 To the beginning of the AC130 file or the Init file? Thank you very much for your help :D Share this post Link to post Share on other sites
SilverRanger 11 Posted January 24, 2011 I made the same changes in my script and it worked just fine for me.:confused: maybe you skipped a step or didn't replace something. look for paragraph called #FireRounds, delete every line between that and _count = _count + 2 and paste in the code from my last post. you should also delete the three lines above the #FireRounds because those define the _randompos variable which is no longer needed since the rounds are created on the plane's position. also the _plane = _this select 2 goes on top of the AC130.sqs. Make sure every other instance of plane inside the AC130.sqs is changed to _plane and use the plane's name as the third variable when executing the script. Share this post Link to post Share on other sites
Blitzen 10 Posted January 24, 2011 SilverRanger said: I made the same changes in my script and it worked just fine for me.:confused: maybe you skipped a step or didn't replace something. look for paragraph called #FireRounds, delete every line between that and _count = _count + 2 and paste in the code from my last post. Also the _plane = _this select 2 goes on top of the AC130.sqs. Make sure every other instance of inside the AC130.sqs is changed to _plane and use the plane's name as the third variable when executing the script. I re-checked everything and the rounds continue to go directly underneath the plane:crazy_o:. Here is what I have in that section: Quote ;====== Firing AP Rounds At Infantry#FireAP "trgt1" setmarkerpos (getpos _target) "trgt2" setmarkerpos (getpos _target) ~1 _fire = _fire + 1 hint "Radio: Firing Chain Guns" _count = (random 10) -20 #FireRounds _addx = random 10 _addz = random 10 ? _addx > 5 : _addx = _addx -10 ? _addz > 5 : _addz = _addz -10 _APround = "Cannon25HE" camcreate [(getpos _plane select 0),(getpos _plane select 1),(getpos _plane select 2)-15] _APround setvelocity [1,1,-500] _AProundspeed = [_APround,_target,_count,_addx,_addz] call Intercept _APround setvelocity (_AProundspeed select 2) Drop ["kouleSvetlo","","Billboard",0.1,5,[0,0,0],(_AProundspeed select 2),0,2,1,0,[5,5,5],[[1,0.5020,0.2510,1]],[0,0,0],0,0,"","",_APround] _count = _count + 2 ~0.2 ? _count < 20: goto "FireRounds" ~2 ? not (canMove _target) : goto "Response" ? _fire == 2 : goto "NoHit" hint "Radio : No Joy! Reaquiring" ~2 goto "FireAP" I also added the _plane = _this select 2 to the top of the ac130.sqs file. I dont know what I'm doing wrong :confused: Share this post Link to post Share on other sites
SilverRanger 11 Posted January 25, 2011 I can't seem to find anything wrong with the code and it still works just fine on my pc.:confused::confused::confused: I re-uploaded the example mission with the new script and an A10 flying around at 500m. give it a try in vanilla OFP and if it works, the problem is probably with some addon or mod you are using, although I can't think of anything that would cause this:( I also recalculated the velocity of the rounds that are created to be based on the plane's altitude in case the starting velocity was causing the rounds to hit the ground before the intercept.sqf could calculate and guide the rounds to the target. if this was the cause of the problem, it's could only be caused by lag, since the calculation is supposed to be immediately after the round's creation. if this is the case, avoid using heavy addons and limit the view distance to 1000 or so.... Share this post Link to post Share on other sites
Blitzen 10 Posted January 25, 2011 (edited) SilverRanger said: Give it a try in vanilla OFP and if it works, the problem is probably with some addon or mod you are using, although I can't think of anything that would cause this:( Hey, I re-downloaded the mission and gave it a shot in both vanilla and FFUR-SLX. It worked both times and I must say that it looks friggin bad-arse :D. I then switched the A-10 for Hawk's AC-130 (makes sense to have a C-130 for an AC-130 Spectre simulation) and the rounds hit on the ground underneath the plane again. I switched back to the A-10 and everything worked fine again. I've been using Hawk's AC-130 in my previous attempts to get this to work, so Im assuming that the problem is from the addon and not the scripts. For anyone else who is interested in this "project", I downloaded Migebuff's AC-130 Gunship Addon and the scripts work perfectly with it (just be sure to remove all the weapons from the plane ;)). **EDIT** I've been playing around with the script today and I've noticed that sometimes you will get a salvo of only tracers? I've found this to almost always happen on the first salvo and then randomly after that. It doesnt really have that big of an impact as the AC-130 almost always immediately re-targets and re-engages, firing expolsives and tracers on the next salvo. **EDIT #2** I've been doing some looking at the scripts, etc. and I was wondering what is actually required to activate all this? For example, if I was starting with a blank mission and I wanted to implement this, what would I need to do? I know that I need all the files in the mission folder, but besides that, what do I need to do? For instance... I noticed in the init.sqs file that you have this: Quote [player,west,p1] exec "ac130.sqs"Does that mean I always need to have a unit named "player" and I always need to name the plane "p1"? Could I instead take this out of the init.sqs and execute it in-game via a unit's init field? Do I have to do anything to the init file if I want the plane to have more than 5 waypoints? I noticed that you put a player reveal trigger on the test island. Is it necessary for the player to know about an enemy before the script will engage it? If so, can you just combine this with the enemyzone trigger, and reveal the targets to the plane instead of the player? Edited January 26, 2011 by Blitzen Share this post Link to post Share on other sites
SilverRanger 11 Posted January 26, 2011 (edited) the reason you see the custom tracers only and not the actual rounds is because the 25mm rounds weigh more than the tracers. this allows the tracers to maintain their trajectory while the actual rounds fall to the ground faster. this is more apparent the further away the plane is. I need to play around with the tracer weight in order to match the two but I'm too lazy to do it :p if you want to give it a shot Drop ["kouleSvetlo","","Billboard",0.1,5,[0,0,0],(_AProundspeed select 2),0,[color="Red"][b]2[/b][/color],1,0,[5,5,5],[[1,0.5020,0.2510,1]],[0,0,0],0,0,"","",_APround] the red number is the weight. below 1.27 the weight is less that air density so the tracers move upwards, 1.27 they stay where they are (with no initial velocity set) and above 1.27 the are heavier than air so they fall downwards. to answer your other question, you can start the script whenever you want and use whatever parameters you want. you can even start multiple instances of the script with the same or different units. all you need to call the script is [nameOfUnit,SideToBeIgnored,nameOfPlane] exec "ac130.sqs" as long as you have a single unit, a plane flying around, some enemies and the "EnemyZone" and "SafeZone" triggers, the script should work. as for the reveal trigger, I put it there to make my tests easier and less time-consuming. as I said inside the readme, it IS necessary for the player (unit defined by the 1st parameter) to be aware of the target, before the plane can engage. once again, the script was written with the parameters of a specific mission in mind, so some oddities still exist inside. you can safely remove the reveal trigger as it is not needed by the script. now, it would make no sense to reveal targets to the plane or modify the script to engage based on the targets the plane knows about. the plane is a prop ONLY. it's just flying around aimlessly and I only put it there at your request to make it look more realistic. the plane doesn't actually engage any targets as it is set to "Careless" mode and in any case it couldn't spot infantry from 500m in the air :) one thing you can do, is open the ac130.sqs, look for ? (_player knowsabout _target) > 0.1 and (canMove _target) : _ValidList = _ValidList + [_target] and change it to ? (canMove _target) : _ValidList = _ValidList + [_target] this will eliminate the need for the unit to know about the targets before the plane can engage them keep in mind though that the _ValidList, as well as the _PriorityList are defined based on the distance of the target from the unit in the 1st parameter of the script. I made it like this to avoid hitting the unit with stray fire and also to have the unit close enough to see the whole effect. that is the reason the "EnemyZone" trigger is always repositioned on top of the player. lastly, you can have as many waypoints as you want for the plane. what the init.sqs actually does in this case, is place the 5 waypoints of the plane at an altitude of 500m so that the plane won't have to dive down all the time to activate it's waypoints. just count how many wps your plane has and adjust the script accordingly "[group _plane,_x] setWPpos [(getWPpos [_plane,_x] select 0),(getWPpos [_plane,_x] select 1),500]" forEach [0,1,2,3,4,5,6......99] of course this is all optional, but the whole effect looks awful with a plane flying at 150m or so :p Edited January 26, 2011 by SilverRanger Share this post Link to post Share on other sites
guziczek101 11 Posted December 21, 2011 Hi how is the progress of the work on the script or this is the final version?? Share this post Link to post Share on other sites
Blitzen 10 Posted December 24, 2011 guziczek101 said: Hi how is the progress of the work on the script or this is the final version?? Sort of a necropost but I will try to give you some info.... The script has been completed by SilverRanger. It is used to simulate an AC130 Gunship. The original script fired rounds from random spots in the sky to simulate an AC 130. SilverRanger later enabled the script to create the simulation rounds from a moving plane. The end result is a pretty cool effect. Here is a link for a youtube video which shows the simulation: Note that this is all controlled by the AI and that the player (still) does not have any control over targeting, etc. Now, with that being said, I have done some digging on the forums and I think it would be really, really, really cool if someone could take what SilverRanger has done and combine it with Chop's bombing sight HUD to enable a player to have some sort of control over targeting... Here is a picture of Chop's bomb script HUD (Note that the player would still not be able to fire via mouse clicks but instead would have to use the buttons) As of right now no one is working on this "project" Share this post Link to post Share on other sites
BronzeEagle 2 Posted December 24, 2011 this might be another cool add in for drongo's toolkit. Share this post Link to post Share on other sites