Home   Help Search Login Register  

Author Topic: Random Artillary Rounds  (Read 590 times)

0 Members and 4 Guests are viewing this topic.

Smoshy

  • Guest
Random Artillary Rounds
« on: 02 Oct 2003, 05:38:14 »
I haven't been able to find this in any FAQ so hopefully someone may be able to help me out here.

I want artillary fire (2-3 shells) to drop in a specific zone say in the vicinity of a village at random intervals throughout a mission.

Any help appreciated  :)

Thanks


m21man

  • Guest
Re:Random Artillary Rounds
« Reply #1 on: 02 Oct 2003, 07:23:38 »
Random? How random?!? Like this, maybe ??? :

#Start
_i = 0
_artpos = getmarkerpos "artmarker"
_ax = _artpos select 0
_ay = _artpos select 1

#RandomTime
~(45 + (random 30))
_power = "heat125"

#Main
?(_i = 3): goto "start"
_tempob1  = _power camcreate [_ax + (random 15), _ay + (random 15), 50
~1
_tempobj1 = objnull
_i = _i + 1

#exit
exit

The location randomizer I included is a piece of simple junk. I'd make it more complex, but I'm too tired now. I hope this works, I haven't tested it...

Smoshy

  • Guest
Re:Random Artillary Rounds
« Reply #2 on: 03 Oct 2003, 06:43:21 »
Would it be too much to ask how this script works?  :-*

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Random Artillary Rounds
« Reply #3 on: 03 Oct 2003, 11:44:19 »
The script looks to me pretty much like it will do what you want.     If you're not very familiar with scripts head over to the Ed Depot and read snYpir's Friendly Introduction to Code Snippets and Johan Gustafsson's Scripting Tutorial.

If it's particular commands in the script that are confusing you then look them in the command reference.      There is also a topic in the command reference called Scripting Topics which is essential reading.

If there is a particular bit about the script that you're having trouble figuring out we'd be glad to help.   :)   But it's almost impossible to answer a general question like "how does it work?" since it amounts to "how does scripting work" which takes an Ed Depot full of tutorials to explain.    

Plenty of reviewed ArmA missions for you to play

m21man

  • Guest
Re:Random Artillary Rounds
« Reply #4 on: 03 Oct 2003, 20:56:16 »
The script works as follows: Dump everything from #start line to the exit line into a text editor (Like Notepad) and save it as arty.sqs. Put into the folder of the mission that you're making and put a marker named "artmarker" (Without the quotes :) ) a bit to the SW of where you want the bombardment to hit. Now execute the script with a trigger with this in the "On Activation" line:
this exec "arty.sqs"

Edit- Smoshy, check your PM account!
« Last Edit: 03 Oct 2003, 20:59:04 by m21man »

Smoshy

  • Guest
Re:Random Artillary Rounds
« Reply #5 on: 05 Oct 2003, 08:52:15 »
Thanks guys.

m21man I've replied  :)

Smoshy