Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Alright! Amazing!success! i got it to work via the init file, thanks for the help man! though for some reason i cant seem to get the sirens to play, i scrapped the idea of the original sounds, and re edited the description and uploaded yours but they wont play either., nothing in the RPT file, just shows the AIRRAID start up with no problems
Hey man, I've been working on it, but the server I'm testing on is semi populated and it's slow going. I guess I should install a local server instance to test on.Any luck with getting the nuke option to work yet?
Preferably, no.Do you want it to do damage?
@Dlcoates1
Would you mind pointing it out? I must have missed something in my edits, hard to see errors after coding all day.
I'll make two versions, one with random number of selections too, don't worry, I think that's a great feature too. I would like to understand it better so I can make the next version even better. Thanks in advance, and thanks for letting me know!
I'm still learning arma scripting so there are bound to be mistakes and inefficiencies, I will work on them.
I'm working on a general script to select from a massive array of locations ["city name",[x,y,z]] using the same floor(random) switch case method, but I've been running into errors on server start (missing a semi colon it says, but I can't say where).
I won't actually be at my machine until later tonight to test guys, I will continue to try to respond on my phone.
_rndLoc=floor(random 6);
_place=
switch (_rndLoc) do
{
case 0: {"Electro"};
case 1: {"Berezino"};
case 2: {"NEAF"};
case 3: {"Stary"};
case 4: {"Vybor"};
case 5: {"Gorka"};
};
diag_log format ["AIRRAID: Random Location: %1 | %2",_rndLoc,_place];
_position=
switch (_rndLoc) do
{
case 0: {[10480.6, 2217.8, 1.5]};
case 1: {[12043.9, 9091.3, 1.5]};
case 2: {[12073.9, 12724.3, 1.5]};
case 3: {[6143.6, 7721.5, 1.5]};
case 4: {[3815.1, 8865.0, 1.5]};
case 5: {[9659.0, 8795.3, 1.5]};
};
From my current knowledge of C++ and what I have worked on in Garry's Mod on Expression 2 (A dumbed down version of C++ and C# as well as Lua), you need to make 2 separate calls. You are currently using 1 expression to call the amount of locations and the positions of the locations for the bombings.
You should separate this into 2 different functions. 1 function will call a random location and attempt to execute the script, while the second will check to see if only one location is checked, and if it turns out that only 1 was called, it will continue the script and the raid will commence.
Sometimes, it is easier to be simple with things. If need be, just dumb it down, no need to do anything extremely complex. ArmA 2's engine can honestly handle the simplest of C++ code.
_rndLoc=floor(random 6); //pick random number 0-5, whole numbers only
_place=
switch (_rndLoc) do
{
case 0: {"Electro"}; //here I'm simply setting _place as a string to give a diag.
case 1: {"Berezino"}; //_place string is only used in the next diag_log to make it easy to see where
case 2: {"NEAF"};
case 3: {"Stary"}; //as I understand it, switch case selects only one of the cases based on the number _rndLoc
case 4: {"Vybor"};
case 5: {"Gorka"};
};
diag_log format ["AIRRAID: Random Location: %1 | %2",_rndLoc,_place]; //display location number choice _rndLoc and name of place _place
_position=
switch (_rndLoc) do
{
case 0: {[10480.6, 2217.8, 1.5]}; //here I'm setting _position to an array of numbers
case 1: {[12043.9, 9091.3, 1.5]}; //again, only one set of numbers should be selected by switch case with _rndLoc value
case 2: {[12073.9, 12724.3, 1.5]};
case 3: {[6143.6, 7721.5, 1.5]};
case 4: {[3815.1, 8865.0, 1.5]};
case 5: {[9659.0, 8795.3, 1.5]};
};
_loc = ["BalottaAirstrip",1.5,4829.9868,2450.1104];
_city = "BalottaAirstrip";
_x = 4829.9868;
_y = 2450.1104;
_z = 1.5;
_coords = [_x,_y,_z];
_tries = 20;
diag_log format ["RANDOM WORLDSPACE: Initializing... %1 | %2 %3 %4|",_city,_x,_y,_z];
sleep 1;
///////////////////////////////////////////////selector
While {_tries > 1} do {
_rndSel=floor(random 49); //select random number 0-49, then set loc based on the case number
_loc=
switch (_rndSel) do {
case 0: {["BalottaAirstrip",1.5,4829.9868,2450.1104]};
case 1: {["Berenzino",1.5,12954.624,9783.1533]};
case 2: {["Bereznio2",1.5,12043.963,9091.3477]};
case 3: {["BlackMountain",1.5,10276.416,12049.6640]};
case 4: {["Bor",1.5,3320.1643,3938.3496]};
case 5: {["Cherno",1.5,6743.8853,2581.1865]};
case 6: {["DevilsCastle",1.5,6891.9189,11438.73]};
case 7: {["DonsCamp",1.5,7788.2856,12613.048]};
case 8: {["Drozhino",1.5,3442.2849,4955.7129]};
case 9: {["Dubrovka",1.5,10445.011,9868.9912]};
case 10: {["Electro",1.5,10480.69,2217.8027]};
case 11: {["Factory",1.5,13060.078,7094.0596]};
case 12: {["Gorka",1.5,9659.084,8795.334]};
case 13: {["Grishno",1.5,5979.6953,10343.341]};
case 14: {["Guglovo",1.5,8517.8682,6676.3276]};
case 15: {["Gvozdno",1.5,8614.4316,11868.967]};
case 16: {["Kabanino",1.5,5318.8369,8602.6328]};
case 17: {["Kamyshovo",1.5,12127.406,3496.2185]};
case 18: {["Khelm",1.5,12290.833,10904.328]};
case 19: {["Komarovo",1.5,3654.0908,2475.9468]};
case 20: {["Kozlovka",1.5,4483.6777,4616.1675]};
case 21: {["Krastonav",1.5,11212.624,12256.609]};
case 22: {["Lopatino",1.5,2780.3135,10018.82]};
case 23: {["Moglievka",1.5,7544.5845,5148.7822]};
case 24: {["Msta",1.5,11275.323,5495.4053]};
case 25: {["Myshkino",1.5,2019.2487,7327.7178]};
case 26: {["Nadezhdino",1.5,5846.4434,4706.708]};
case 27: {["NEAF",1.5,12073.906,12724.305]};
case 28: {["Nizhnoye",1.5,13002.393,8285.8574]};
case 29: {["NovySobor",1.5,7074.4854,7683.4883]};
case 30: {["NWAF",1.5,4480.0781,10375.544]};
case 31: {["Orlovets",1.5,12146.174,7266.5801]};
case 32: {["Pavlovo",1.5,1693.9392,3845.0657]};
case 33: {["Petrovka",1.5,5014.1143,12493.039]};
case 34: {["Pogorevka",1.5,4473.5957,6411.3198]};
case 35: {["Polana",1.5,10753.393,8132.6606]};
case 36: {["Prigorodki",1.5,7976.5557,3299.5386]};
case 37: {["Pulkovo",1.5,4915.0903,5605.6401]};
case 38: {["Pusta",1.5,9156.2549,3897.7598]};
case 39: {["Pustoshka",1.5,3072.9629,7945.4404]};
case 40: {["Rogovo",1.5,4808.0024,6805.0518]};
case 41: {["Shakhovka",1.5,9654.5244,6555.2583]};
case 42: {["Solnichny",1.5,13454.279,6233.647]};
case 43: {["Soosnovka",1.5,2528.7561,6354.9839]};
case 44: {["Staroye",1.5,10140.659,5434.4302]};
case 45: {["StarySobor",1.5,6143.6167,7721.5176]};
case 46: {["Tulga",1.5,12803.296,4450.7466]};
case 47: {["Vybor",1.5,3815.0635,8865.0938]};
case 48: {["Vyshnoye",1.5,6590.3159,6029.1128]};
case 49: {["Zelenogorsk",1.5,2758.7144,5304.3457]};
};
_city = _loc select 0;
_z = _loc select 1;
_x = _loc select 2;
_y = _loc select 3;
_coords = [_x,_y,_z];
diag_log format ["RANDOM WORLDSPACE: %1 | %2",_city,_coords];
sleep 1;
diag_log format ["RANDOM WORLDSPACE SELECTED: %1 | City: %2 | Coords: %3 %4 |||Try %5",_rndSel,_city,_x,_y,_tries];
_tries = _tries - 1;
};
sleep 2;
diag_log format ["RANDOM WORLDSPACE: %1 | Going to shutdown",_tries];
exit