Rob 1 Posted November 27, 2001 in my mission i need an artillary script that will activate once i go through a trigger and start barraging the land about 50m in front so that it looks like the enemy have just missed us. can someone make me one or is there one design specifically for that? Share this post Link to post Share on other sites
Space Cadet 1 Posted November 27, 2001 Certainly, try this:- _Target = this select 0 _Ord = this select 1 _Rounds = this select 2 _Counter = 0 #LOOP _Ord camCreate [(getpos _Target) select 0 + 50, (getpos _Target) select 1, (getpos _Target) select 2 + 20] ~2 _Counter = _Counter+1 ?(_Counter < _Rounds):goto "LOOP" exit Its pretty basic but should do the job You need to pass 3 arguments in this order:- the unitname you want the barrage 50 meters in front of the type of ordanance you want to use - look at the ammo types to get this (it also needs quotes around it) something like "Heat120" The number of shots in the barrage You might want to play around with this bit [(getpos _Target) select 0 + 50, (getpos _Target) select 1, (getpos _Target) select 2 + 20] as if you change the values being added to the 3 elements you can change the distance and height of the barrage from the Target unit. Share this post Link to post Share on other sites
Space Cadet 1 Posted November 27, 2001 Certainly, try this:- _Target = this select 0 _Ord = this select 1 _Rounds = this select 2 _Counter = 0 #LOOP _Ord camCreate [(getpos _Target) select 0 + 50, (getpos _Target) select 1, (getpos _Target) select 2 + 20] ~2 _Counter = _Counter+1 ?(_Counter < _Rounds):goto "LOOP" exit Its pretty basic but should do the job You need to pass 3 arguments in this order:- the unitname you want the barrage 50 meters in front of the type of ordanance you want to use - look at the ammo types to get this (it also needs quotes around it) something like "Heat120" The number of shots in the barrage You might want to play around with this bit [(getpos _Target) select 0 + 50, (getpos _Target) select 1, (getpos _Target) select 2 + 20] as if you change the values being added to the 3 elements you can change the distance and height of the barrage from the Target unit. Share this post Link to post Share on other sites
MP 0 Posted November 27, 2001 If you think that Space Cadet's script (excellent by the way) might be too strong try this one----->>>>>> _Centre = _this select 0 _area = _this select 1 _guns = _this select 2 _freq = _this select 3 _rounds = _this select 4 _delay = _this select 5 _CentrePos = GetMarkerPos _Centre _cx = _CentrePos select 0 _cy = _CentrePos select 1 _areaX2 = _area * 2 ~_delay _ammoType = "Grenade" #Update ? (ariStop == 1) : goto "End" _a = _guns + 1 _a = _a - 1 #Salvo _tempObj = _ammoType camCreate[_cx + Random(_areaX2) - _area,_cy + Random(_areaX2) - _area,50] ~0.01 ~0.4 _a = _a - 1 _tempObj = objNull ? (_a > 0) : goto "Salvo" _rounds = _rounds - _guns ~_freq - (_guns * 0.4) ? (_rounds > 0) : goto "Update" #End exit In the activation filed of a trigger or waypoint put: ["Targetmarker",Spread,Guns,Reloadtime,Ammo,Delay] exec "light barrage.sqs" e.g: ["marker1",100,4,10,100,15] exec "light barrage.sqs". Marker1 being the marker to target 100 being the spread from the center in meters 4 being the number of guns in the Artillary 10 being the reload time for each gun 100 being the total ammo for the strike 15 being the time it takes for the shell to fly to the target. This is an excellent script (if I don't say so myself) as you can actually hear the shell's falling. Share this post Link to post Share on other sites
MP 0 Posted November 27, 2001 If you think that Space Cadet's script (excellent by the way) might be too strong try this one----->>>>>> _Centre = _this select 0 _area = _this select 1 _guns = _this select 2 _freq = _this select 3 _rounds = _this select 4 _delay = _this select 5 _CentrePos = GetMarkerPos _Centre _cx = _CentrePos select 0 _cy = _CentrePos select 1 _areaX2 = _area * 2 ~_delay _ammoType = "Grenade" #Update ? (ariStop == 1) : goto "End" _a = _guns + 1 _a = _a - 1 #Salvo _tempObj = _ammoType camCreate[_cx + Random(_areaX2) - _area,_cy + Random(_areaX2) - _area,50] ~0.01 ~0.4 _a = _a - 1 _tempObj = objNull ? (_a > 0) : goto "Salvo" _rounds = _rounds - _guns ~_freq - (_guns * 0.4) ? (_rounds > 0) : goto "Update" #End exit In the activation filed of a trigger or waypoint put: ["Targetmarker",Spread,Guns,Reloadtime,Ammo,Delay] exec "light barrage.sqs" e.g: ["marker1",100,4,10,100,15] exec "light barrage.sqs". Marker1 being the marker to target 100 being the spread from the center in meters 4 being the number of guns in the Artillary 10 being the reload time for each gun 100 being the total ammo for the strike 15 being the time it takes for the shell to fly to the target. This is an excellent script (if I don't say so myself) as you can actually hear the shell's falling. Share this post Link to post Share on other sites
Rob 1 Posted November 28, 2001 thanks guys i didn't know u posted anything cuz the forum is f**ked. it never updates. Share this post Link to post Share on other sites
dkraver 1 Posted November 28, 2001 MP and Space Cadet just tried to make both of your scripts And nothing seems to happend probely me doing something wrong (im a newbie in scripting hehe) so could you please make a small guide for me as and example on how to make it work Share this post Link to post Share on other sites
Rob 1 Posted November 28, 2001 copy all of the script they just sent... paste it into notpad and save it as "light barrage.sqs" u add .sqs at the end of the name u want to save it as. put the file into ur mission directory and in the mission make a trigger and make it detect west and all that...... in the on activation field use ["marker1",100,4,10,100,15] exec "light barrage.sqs" click on markers at the top of the screen and make one just infront of the player where u want the artillary to fall and call it marker1. make sure that the trigger and the maker r close but make sure the marker is a good distance from urself so that u dont get hit. i aint tested it either cuz im at school but i will tonight. Share this post Link to post Share on other sites
Rob 1 Posted November 28, 2001 copy all of the script they just sent... paste it into notpad and save it as "light barrage.sqs" u add .sqs at the end of the name u want to save it as. put the file into ur mission directory and in the mission make a trigger and make it detect west and all that...... in the on activation field use ["marker1",100,4,10,100,15] exec "light barrage.sqs" click on markers at the top of the screen and make one just infront of the player where u want the artillary to fall and call it marker1. make sure that the trigger and the maker r close but make sure the marker is a good distance from urself so that u dont get hit. i aint tested it either cuz im at school but i will tonight. Share this post Link to post Share on other sites