Praetor 0 Posted February 2, 2007 I'm looking for information on how I could include mortar-sized explosions at specific locations on the map...when triggered. For example, 5-10 mortars fall in your general area 3 seconds after you destroy target x. General grenade sized explosions spontaneously appearing is fine too. How would I do this? Share this post Link to post Share on other sites
Praetor 0 Posted February 2, 2007 With 31 views and no replies I assume nobody has an answer for this? Share this post Link to post Share on other sites
Praetor 0 Posted February 2, 2007 Using the IED script could I place small objects in an area and have them go off from a trigger caused by friendly troops entering its circle? Share this post Link to post Share on other sites
Victor_S. 0 Posted February 2, 2007 I knew how to do this in ofp, but arma scripting is slightly different.  Hmmm I did it so the grenades would be shot up at random angles so they would land randomly around the center. here is a script I used in ofp.  I changed some things so it might work in arma, but  no garantee. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_limit = _this select 0 _count = 0 #loop ?_limit == _count: exit _shell = "handgrenade" camcreate [getpos tag select 0,getpos tag select 1,+40] _shell setvelocity [0+(random 45)-(random 45),0+(random 45)-(random 45),(random 10)+20] _count = _count + 1 ~1 goto "loop" put a game logic down where the mortars will originate. tag being the name of the game logic.  You might try different things is handgrenade doesnt work. Make a trigger and in the on activation line put [# of mortars] exec mortar.sqs put the code above in an sqs file in the mission folder and name it mortar.sqs.  replace # of mortars with how many you want.  also you can adjust the ~1 at the end of the code to whatever number you want, it is the time inbetween mortars.  Hope this helps. Share this post Link to post Share on other sites
Praetor 0 Posted February 2, 2007 Thanks but I figured it out a different way. I might switch to that later because it seems to allow replayability. I'm simply having some invisible H's explode with the IED script. When you enter the trigger zone it goes off. Share this post Link to post Share on other sites
Victor_S. 0 Posted February 2, 2007 that way works too. But if you do it the way I said you can actually see the grenades coming in, and if you change the grenade to something that has a sound like rockets did in ofp you can hear them comming in. Either way works fine though. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted February 2, 2007 There are a TON of ways to do this, you just have to be creative... artillery.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_pos = _this select 0; _radius = _this select 1; _number = _this select 2; _interval = _this select 3; _types = _this select 4; waitUntil{ _random = random (count _types); _random = _random - (_random mod 1); _round = createVehicle [(_types select _random),[(_pos select 0),(_pos select 1),(100+random 50)],[],_radius,"NONE"]; _round setvelocity [-15+random 30,-15+random 30,-30-random 20]; _number = _number - 1; sleep _interval; _number <= 0 }; Ex: init of an Invisible H or Game Logic: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[(getpos this),200,10,3,["GrenadeHand","Sh_105_HE"]] execVM "artillery.sqf" That will drop 10 randomly chosen munition types, either hand grenades or 105mm shells, in a random circle 200m in radius from the position of the object in intervals of approximately 3 seconds. Share this post Link to post Share on other sites
Praetor 0 Posted February 3, 2007 Cool, thanks. Can I just add that in my script, or do I have to use the artillery script? Share this post Link to post Share on other sites
Big Dawg KS 6 Posted February 3, 2007 I'd make it an individual script, that way you can use it again whenever/wherever/however you want, etc... Share this post Link to post Share on other sites
Victor_S. 0 Posted February 3, 2007 I keep a folder in the arma directory of all of the scripts I have made. That way if I need it in the future I dont have to dig through my mission folders for it. So when you find the arty script you like put it in that folder for future use. Share this post Link to post Share on other sites
charonos 0 Posted February 3, 2007 No intention to divert the topic of the thread, just a little sidenote. I would always go for game logics rather than invisible Hs, because if you have lots of invisible Hs in your map and call for chopper extraction later the chopper might land on one of those (if not intended) except you use a script that sticks an invisible H right under the chopper. You can of course setpos [0,0] the invisibleH after you have created the grenades. Anyway, can't wait for CoC's Arty converted for Arma, as it's so much nicer to have ballistic mortar shells than "faking" them. Share this post Link to post Share on other sites
december 0 Posted February 3, 2007 Looks like a very useful script but I get error, "Type script, expected nothing" When I put [(getpos this),200,10,3,["GrenadeHand","Sh_105_HE"]] execVM "artillery.sqf" in the init of a gamelogic. Share this post Link to post Share on other sites
fabrizio_t 58 Posted February 4, 2007 then try <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> foo = [(getpos this),200,10,3,["GrenadeHand","Sh_105_HE"]] execVM "artillery.sqf" Share this post Link to post Share on other sites
december 0 Posted February 4, 2007 hmmm, the actual script has errors also. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted February 4, 2007 hmmm, the actual script has errors also. Ooops, my bad. It's all fixed now. Share this post Link to post Share on other sites
december 0 Posted February 5, 2007 Cheers. Nice script Share this post Link to post Share on other sites
Jack-UK 0 Posted February 25, 2007 Cool script, i'm new to scripting and mission editing (tried a little in OFP but never had much will power lol) Just wondering how i would go about being able to activate that script by a radio command, after an OPFOR "Not present" trigger is activated. Cheers! EDIT: Or how would i make a game logic activate once the trigger is true? Share this post Link to post Share on other sites
Opticalsnare 12 Posted February 26, 2007 Yeh this is great Share this post Link to post Share on other sites
DecimusAquila 0 Posted February 26, 2007 Salute, I was just wondering, can't artillery or mortars be fired on targets using simple editor commands like eg. heli land "LAND"...were you get a chopper to land than using scripts? Thankyou. Share this post Link to post Share on other sites