daanvs 0 Posted October 19, 2004 Hell there, I'm working on a mission that will require some sort of script to simulate a forward aircontroler. For people who don't know what a FAC is; it is a person on the ground (if it's done from an airplane it's called AFAC) that will guide aircraft to their targets by the means of directions thru radio or laser designator. In my mission, you are supposed to talk the aircraft to a couple of well hidden artillery pieces. Now this is all fine but it's just in my head and not ingame, where I'd like it to be.. Maybe some of you talented scripters can help me with this? Basicaly I want a script that makes some A10's or apache's show up and attack the target I'm painting with a laser designator. If this is not possible, then I'd gladly hear any alternatives from you. Thanks in advance. Share this post Link to post Share on other sites
theavonlady 1 Posted October 19, 2004 OFPEC search results for "laser". Share this post Link to post Share on other sites
daanvs 0 Posted October 19, 2004 Thank you for your reply Avon Lady but ofcourse, I've tried that prior to posting here ;) I'm not an advanced scripter nor does that article on laser designator editing describe anything close to what I need. I hope you can help me out Share this post Link to post Share on other sites
theavonlady 1 Posted October 19, 2004 I hope you can help me out You gotta be kidding! Me?! I get stuck on the most elementary problems when it comes to scripting. How about unPBOing OFP's "Laser Guide" SP mission that came with Resistance and learning by example from there? Share this post Link to post Share on other sites
daanvs 0 Posted October 19, 2004 there's a good idea (I hope hehe). See, you might have just helped me out afterall :P [EDIT] It turns out the laser designator has nothing to do with blowing up the bridge in that mission. As soon as you have passed all checkpoints you can just radio in an A10 and it'll bomb the bridge which is destroyed with: "damage (object 167793) >= 1" Any other ideas? Share this post Link to post Share on other sites
havocsquad 0 Posted October 19, 2004 Never mind. delete post.... Share this post Link to post Share on other sites
daanvs 0 Posted October 19, 2004 Oh comeon, there I was hoping for a quick reply from a scripting guru... no suggestions at all? Share this post Link to post Share on other sites
-=BT=- Matty R 0 Posted October 19, 2004 if you have an laser designator and you have it targeted.. and theres a AH-1 or any attack heli above u it will attack the laser target you have painted.. then when you move the laser the heli will move to look at the dir of the laser target.. is that what u wanted to here? Share this post Link to post Share on other sites
daanvs 0 Posted October 19, 2004 No not really. I'd like to have a few targets that are hidden somewhere, to be attacked only when discovered by the player and only that target. If I have a chopper or A10 flying there, waiting untill I paint the target, it'll attack the targets before I actually painted them. What I want is something that makes it look like I'm the one pointing the planes to the target like a real FAC does, wether it really uses the laser or not. Share this post Link to post Share on other sites
tj72 0 Posted October 22, 2004 Hello, Making the aircraft show up and fire on your lasertarget? This can be done using some basic scripting commands such as command - what it does in this case --------------------------------------------------------------- Createvehicle - create the a10 getpos player/players name - find out players position CreateUnit - create a pilot MoveinDriver - throw him in the cockpit setpos - make it all happen at players postition but at a set alltitude setdir - at the direction the player is facing AddEventhandler fired - detect if the bomb is fired EAST/WEST sidechat - make the pilot say "BOMBS AWAY!" or whatever you want over the Radio deletevehicle - delete the A10 delete the pilot --------------------------------------------------------------- heres an example script: first though, add a marker to your mission in a flat empty area called base make a trigger to call the script (in the onactivation field put - this exec "fire_ctrl.sqs") add a west pilot unit named _pilot put in the init: pilot = group this; deletevehicle this player as Black Op laser with a playername of sd and if you like scatter some armor and inf and your Artilleryobjects around a random area on the map with a nice recon position to survey from. make a sqs file in your mission dir called FAC_DROP <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;FAC_DROP.sqs by TJ72 10/22/2004 _A10 = "A10LGB" createVehicle getMarkerPos "base" _A10 AddEventHandler ["fired", {if ((_this select 4) == "LaserGuidedBomb") then {[] exec "schat.sqs"}}] _A10 setpos [getpos sd select 0, getpos sd select 1, (getpos sd select 2) +513] _dh= getdir player _A10 setdir _dh ~2 _pilot = this "SoldierWCrew" createUnit [getMarkerPos "base", pilot,"_pilot = this",0.9, "MAJOR"] _pilot MoveinDriver _A10 ~5 deletevehicle _A10 deletevehicle _pilot exit make a sqs file in your mission dir called fire_ctrl <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;fire_ctrl.sqs ~2 [] exec "FAC_DROP.sqs" ~2 [] exec "FAC_DROP.sqs" ~3 [] exec "FAC_DROP.sqs" ~2 [] exec "FAC_DROP.sqs" exit make a sqs file in your mission dir called schat <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;schat.sqs leader pilot sidechat "BOMBS AWAY!" ------------------------------------------------------------------------ Take out the LD and target something when the script is run and see what happens. Other than that you might want a plane to come and fly into the area to activate this script with presence trigger. The plane itself will be set to hold fire or no ammo and simulate the timing but it should have a dynamic waypoint. So it can fly to your vicinity wherever you are on the map. Search Results just a quick search for dynamic waypoints because I dont know how to do them but Ive ben meaning to learn. Try OFPEC.com ain addition to the Search here. let me kniw if that was any help to you to everyone: any help improving/enhancing the above script or any comments/insights etc. on it would be greatly appreciated. Share this post Link to post Share on other sites
daanvs 0 Posted October 22, 2004 thanks for trying to help me out but I get an error: 'Exec |#| FAC_DROP.sqs"': Error unknown operator. what could be wrong? Share this post Link to post Share on other sites
RED 0 Posted October 22, 2004 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">exec "FAC_DROP.sqs" Should be: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[] exec "FAC_DROP.sqs" RED Share this post Link to post Share on other sites
tj72 0 Posted October 22, 2004 Oh yeah that is the problem exactly. It should work after that. ill update my post Thanks RED FYI my mission has only ben tested on everon and in the daytime. Also the range is limited in this setup but not bad around 350 meters to target and beyond that the A10 chance of firing is almost nil. the eventhandler will tell you when the bombs is dropped so you can guide it in to beyond 350 meters but only so much. Perhaps implementing Snypir's solution (its in the OFPEC search results from Avonladys post above) to spawn A10 directly over laser target position would fix that. hmm..... Share this post Link to post Share on other sites