Jump to content

magicpanda

Member
  • Content Count

    160
  • Joined

  • Last visited

  • Medals

Everything posted by magicpanda

  1. Hi, I'm learning how to script stuff for Arma and decided to do a little script that creates ambient burning wrecks in the distance as the player travels and deletes them when gone. I've hit a bit of a brick wall with looping and cleaning up . Here is what is working so far. I'm thinking I need some kind if statement using player distance to delete _wreckcomp and "wreckmarker"; then start the whole process over again at random times. Also would using BIS_fnc_findSafePos; be better instead of SHK? I could nearly call it my own script then :) call compile preprocessfile "SHK_pos\shk_pos_init.sqf"; _PosA = [getpos player,[800,1000],random 360,0,[],heli] call SHK_pos; _wreckPos = _posA isFlatEmpty[2, 50, 0.5, 5, 0, false, heli]; while {(count _wreckPos) < 1} do { _PosA = [getpos player,[800,1000],random 360,0,[],heli] call SHK_pos; _wreckPos = _posA isFlatEmpty[2, 50, 0.5, 5, 0, false, heli]; }; _wreckMarker = createMarker ["wreckMarker",_wreckPos]; _wreckMarker setMarkerShape "ELLIPSE"; //for testing _wreckMarker setMarkerColor "ColorOPFOR"; _wreckMarker setMarkerSize [50, 50]; _wreckMarker setMarkerBrush "Solid"; _wreck1 = [["Land_Wreck_HMMWV_F",[0.758789,3.6582,0.0207825],0,1,0,[],"","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck2 = [["Land_Wreck_Truck_F",[0.326172,3.39844,0],0,1,0,[],"","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck3 = [["Land_Wreck_Car2_F",[0.424805,2.31836,0],103.117,1,0,[],"","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck4 = [["Land_Wreck_Car_F",[-0.428711,2.60156,0],116.565,1,0,[],"","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck5 = [["Land_Wreck_Hunter_F",[0.118164,4.66016,0],133.172,1,0,[],"","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck6 = [["Land_Wreck_Slammer_F",[-0.129883,6.14258,0],0,1,0,[],"","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck7 = [["Land_Wreck_Slammer_hull_F",[0.268555,4.48828,0],107.918,1,0,[],"","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck = [_wreck1, _wreck2, _wreck3, _wreck4, _wreck5, _wreck6, _wreck7]; _wreckComp = _wreck call BIS_fnc_selectRandom; 0 = [(getmarkerPos "wreckMarker"), random 360, _wreckComp] call BIS_fnc_ObjectsMapper; //sleep 10; //_cleanup = if (player distance "wreckmarker" > 2000) then [ { "true" }, { "false" } ]; //hint _cleanup; sleep (60 + (random 120)); // while {(count _wreckComp) < 1} do { // do everything all over again?
  2. EDIT: Moved question to a more relevant thread
  3. Or https://community.bistudio.com/wiki/BIS_fnc_findSafePos _randomPos = [getPos player, //center position (Array) 700, //minimum distance from the center position (Number) 1500, //maximum distance from the center position (Number) 3, //minimum distance from the nearest object (Number) 0, //water mode (Number) 0: cannot be in water 1: can either be in water or not 2: must be in water 20, //maximum terrain gradient (average altitude difference in meters - Number) 0, //shore mode (Number): 0: does not have to be at a shore 1: must be at a shore [], //(optional) blacklist (Array of Arrays) [] //(optional) default positions ] call BIS_fnc_findSafePos; e.g: _randomPos = [getPos player,700,1500,2,0,20,0] call BIS_fnc_findSafePos; _randomPos = [getMarkerPos "marker1",0,1500,2,0,20,0] call BIS_fnc_findSafePos; https://community.bistudio.com/wiki/isFlatEmpty
  4. :D Occam's Razor. I'm going to punch myself in the face a few times. Thanks (again!)
  5. Thanks kauppapekka, that's very useful. Generally it's only buildings that need the adjustment, everything else falls into place nicely with careful use of isFlatEmpty ir the safePos function.
  6. magicpanda

    BIS_fnc_garage

    That's superb Larrow. I wonder, is it possible to disable the crew part of the UI? Oh, and add fade to black, skip time and fade in when you close it? :P
  7. I don't even know if this is Trigonometry, this is how bad it is :D Basically I'm trying to create and get 2 end points along a line for a flyby and could use some help. Here is what I have so far. I think the idea is correct its just the code is wrong 1 Get a random direction 2 Get the opposite direction 3 Get the middle point (e.g. a player but later a random pos) and get the positions of the end points 1.5k away of the player each direction _dir1 = getDir random 360; _dir2 = -(getDir _dir1); _posA = [player, 1500, _dir1] call BIS_fnc_relPos; _posB = [player, 1500, _dir2] call BIS_fnc_relPos; _ambientFly = [_posA,_posB] call BIS_fnc_ambientFlyBy;
  8. Cheers Larrow. Never thought to check it at night. Not in HTML and CSS country now. I will fiddle with findSafePos later to replace all the SHKpos stuff
  9. <3 kylainia _wreckTrigger setTriggerStatements ["!(player in thislist)", "deleteVehicle _wreckTrigger; deleteMarker 'wreckMarker'; {if (typeOf _x == '#particlesource') then {deleteVehicle _x}} forEach (burning nearObjects 10); deleteVehicle burning; hint 'Fuck yeah'; nul = execVM 'randomWreck.sqf'", ""];
  10. Cheers cracked that part, just deleted = this after burning. It's deleting the fire effect that's the next problem :wacko:
  11. Kind of solved it with a trigger and it works fine but it's throwing up an error. call compile preprocessfile "SHK_pos\shk_pos_init.sqf"; _PosA = [getpos player,[800,1000],random 360,0,[],heli] call SHK_pos; _wreckPos = _posA isFlatEmpty[2, 50, 0.5, 5, 0, false, heli]; while {(count _wreckPos) < 1} do { _PosA = [getpos player,[800,1000],random 360,0,[],heli] call SHK_pos; _wreckPos = _posA isFlatEmpty[2, 50, 0.5, 5, 0, false, heli]; }; _wreckMarker = createMarker ["wreckMarker",_wreckPos]; _wreckMarker setMarkerShape "ELLIPSE"; //for testing _wreckMarker setMarkerColor "ColorOPFOR"; _wreckMarker setMarkerSize [2000, 2000]; _wreckMarker setMarkerBrush "Solid"; _wreckTrigger = createTrigger ["EmptyDetector", getMarkerPos "wreckMarker"]; _wreckTrigger setTriggerArea [1500, 1500, 0, false]; _wreckTrigger setTriggerActivation ["ANY", "PRESENT", false]; _wreckTrigger setTriggerStatements ["!(player in thislist)", "sleep 1; deleteVehicle _wreckTrigger; deleteMarker 'wreckMarker'; deleteVehicle burning; hint 'Fuck yeah'; sleep 2; nul = execVM 'randomWreck.sqf'", ""]; _wreck1 = [["Land_Wreck_HMMWV_F",[0.758789,3.6582,0.0207825],0,1,0,[],"burning = this;","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck2 = [["Land_Wreck_Truck_F",[0.326172,3.39844,0],0,1,0,[],"burning = this;","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck3 = [["Land_Wreck_Car2_F",[0.424805,2.31836,0],103.117,1,0,[],"burning = this;","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck4 = [["Land_Wreck_Car_F",[-0.428711,2.60156,0],116.565,1,0,[],"burning = this;","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck5 = [["Land_Wreck_Hunter_F",[0.118164,4.66016,0],133.172,1,0,[],"burning = this;","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck6 = [["Land_Wreck_Slammer_F",[-0.129883,6.14258,0],0,1,0,[],"burning = this;","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck7 = [["Land_Wreck_Slammer_hull_F",[0.268555,4.48828,0],107.918,1,0,[],"burning = this;","OnFire = 'test_EmptyObjectForFireBig' createVehicle (getPos this);OnFire attachTo [this,[0,1,-1]]",true,false]]; _wreck = [_wreck1, _wreck2, _wreck3, _wreck4, _wreck5, _wreck6, _wreck7]; _wreckComp = _wreck call BIS_fnc_selectRandom; 0 = [(getmarkerPos "wreckMarker"), random 360, _wreckComp] call BIS_fnc_ObjectsMapper;
  12. Or try this one. 1. Stick a Mortar down name it mortar1 2. Stick a trigger down with Activation being Blufor detected by Opfor repeatedly. 3 In the on Activation list stick. mortar1 commandArtilleryFire [getposatl (thislist select 0), "8Rnd_82mm_Mo_shells", 4]; /change the 4 to however many shells. 4. Stick yourself and a couple of Opfor down and get thier attention. 5. Run like buggery.
  13. For Vehicle types you will want the classname from here: https://community.bistudio.com/wiki/Arma_3_CfgVehicles_WEST Or open the Config Viewer in the editor (ctrl - G) e.g B_MBT_01_mlrs_F is the MRLS Also this post might help if you wanted to do it with real units firing on markers. https://forums.bistudio.com/topic/154838-finally-got-artillery-working-right/
  14. magicpanda

    On screen wind debris Help

    Very subtle effect. ////////////////////////////////////////////////////////////// // MADE BY MOERDERHOSCHI // EDITED VERSION OF THE ARMA2 ORIGINAL SCRIPT // ARMED-ASSAULT.DE // 06.11.2013 ////////////////////////////////////////////////////////////// //--- Ash _pos = position player; _parray = [ /* 00 */ ["A3\Data_F\ParticleEffects\Universal\Universal", 16, 12, 8, 1],//"A3\Data_F\cl_water", /* 01 */ "", /* 02 */ "Billboard", /* 03 */ 1, /* 04 */ 4, /* 05 */ [0,0,0], /* 06 */ [0,0,0], /* 07 */ 1, /* 08 */ 0.000001, /* 09 */ 0, /* 10 */ 1.4, /* 11 */ [0.05,0.05], /* 12 */ [[0.1,0.1,0.1,1]], /* 13 */ [0,1], /* 14 */ 0.2, /* 15 */ 1.2, /* 16 */ "", /* 17 */ "", /* 18 */ vehicle player ]; _snow = "#particlesource" createVehicleLocal _pos; _snow setParticleParams _parray; _snow setParticleRandom [0, [10, 10, 7], [0, 0, 0], 0, 0.01, [0, 0, 0, 0.1], 0, 0]; _snow setParticleCircle [0.0, [0, 0, 0]]; _snow setDropInterval 0.01;
  15. magicpanda

    On screen wind debris Help

    Check out the Nuke script. http://www.armaholic.com/page.php?id=23963 MIght be something in there of use as there is a nice dust effect. also https://community.bistudio.com/wiki/BIS_fnc_sandstorm Not sure it works in arma 3 though. newspapers (Optional): Boolean - true if flying newspapers will be present (default is true) Edit, just tested, does work although the newspapers are toned back from what I remember. [player, 0.2, 0.8, true] call BIS_fnc_sandstorm;
  16. magicpanda

    Strategic Map with Tasks

    Nice script! I'm trying to adapt it to get use spawned marker positions instead of x,y,z for the missions. Pretty new to this so I tried the below with no joy. Am I on the right track? Cheers. _m1pos = getMarkerPos "AO"; //Mission examples //0: ARRAY - mission position in format [x,y,y] or [x,y] _m1 = [[_m1pos],{player setPos param [0,[0,0,0]];},"Airfield","Move to Airfield","player","images\exampleImage.jpg",1,[]]; Here is the full thing without the color tags etc. /* Author: Revo Description: Creates a Strategic Map Call via addAction like this: _unit addAction ["Strategic Map","openStrategicMap.sqf",[_viewPos,_viewNight,_overcast]]; Parameter(s): 0: _target -> addAction 1: _caller -> addAction 2: _action -> addAction's id 3: ARRAY - default view position in format [x,y,y] or [x,y] 4: BOOL - true for night version of strategic map (darker with blue tone) 5: NUMBER - value in range <0-1> defining weather on strategic map (i.e. density of clouds). If not defined, 0 is used. Returns: - */ _target = param [0,objNull]; _caller = param [1,player]; _action = param [2,0]; _viewPos = (_this select 3) param [0,[0,0,0]]; _viewNight = (_this select 3) param [1,false]; _overcast = (_this select 3) param [2,0]; _m1pos = getMarkerPos "AO"; /*Mission examples 0: ARRAY - mission position in format [x,y,y] or [x,y] 1: CODE - expression executed when user clicks on mission icon 2: STRING - mission name 3: STRING - short description 4: STRING - name of mission's player 5: STRING - path to overview image 6: NUMBER - size multiplier, 1 means default size 7: ARRAY - parameters for the -on click- code; referenced from the script as (_this select 9) */ _m1 = [[_m1pos],{player setPos param [0,[0,0,0]];},"Airfield","Move to Airfield","player","images\exampleImage.jpg",1,[]]; _m2 = [[2458,5660,0],{player setPos param [0,[0,0,0]];},"FOB","Move to FOB","player","",1,[]]; _m3 = [[6472,5367,0],{player setPos param [0,[0,0,0]];},"Kamino Firing Range","Move to Kamino","player","",1,[]]; _m4 = [[2982,1876,0],{player setPos param [0,[0,0,0]];},"LZ Connor","Move to LZ Connor","player","",1,[]];; _m5 = [[3291,2928,0],{player setPos param [0,[0,0,0]];},"Camp Maxwell","Move to Camp Maxwell","player","",1,[]]; _m6 = [[4331,3852,0],{player setPos param [0,[0,0,0]];},"Air Station Mike-26","Move to Air Station Mike-26","player","",1,[]]; _m7 = [[5023,5905,0],{player setPos param [0,[0,0,0]];},"Camp Rogain","Move to Camp Rogain","player","",1,[]]; _m8 = [[2026,3554,0],{player setPos param [0,[0,0,0]];},"Camp Tempest","Move to Camp Tempest","player","",1,[]]; _m9 = [[4488,6786,0],{player setPos param [0,[0,0,0]];},"Kill Farm","Move to Kill Farm","player","",1,[]]; _m10 = [[2623,611,0 ],{player setPos param [0,[0,0,0]];},"The Spartan","Move to The Spartan","player","",1,[]]; /*Marker examples ARRAY - list of markers revealed in strategic map (will be hidden when map is closed) */ _marker1 = ""; _marker2 = ""; _marker3 = ""; /*ORBAT examples 0: ARRAY - group position in format [x,y,y] or [x,y] 1: CONFIG - preview CfgORBAT group 2: CONFIG - topmost displayed CfgORBAT group 3: ARRAY - list of allowed tags 4: NUMBER - maximum number of displayed tiers */ _orbat1 = [[2500,600 ],configFile >> "CfgORBAT" >> "BIS" >> "B_1_B_3_3",configFile >> "CfgORBAT" >> "BIS" >> "B_1_B_3_4",["BLUFOR", "USArmy","Kerry"],5]; _orbat2 = [[4000,1000],configFile >> "CfgORBAT" >> "BIS" >> "B_1_B_3_3",configFile >> "CfgORBAT" >> "BIS" >> "B_1_B_3_4",["BLUFOR", "USArmy","Kerry"],5]; _orbat3 = [[1500,4000],configFile >> "CfgORBAT" >> "BIS" >> "B_1_B_3_3",configFile >> "CfgORBAT" >> "BIS" >> "B_1_B_3_4",["BLUFOR", "USArmy","Kerry"],5]; /*Image examples 0: STRING - texture path 1: ARRAY - colour in format [R,G,B,A] 2: ARRAY - image position 3: NUMBER - image width (in metres) 4: NUMBER - image height (in metres) 5: NUMBER - image angle (in degrees) 6: STRING - text displayed next to the image 7: BOOL - true to display shadow */ _image1 = ["images\exampleImage.jpg",[1,1,1,1],[50,50,0],7,5,0,"Example Image",true]; _image2 = []; _image3 = []; //Function call with above set parameter [nil,_viewPos,[_m1,_m2,_m3,_m4,_m5,_m6,_m7,_m8,_m9,_m10],[_orbat1,_orbat2,_orbat3],[_marker1,_marker2,_marker3],[_image1,_image2,_image3],_overcast,_viewNight] call BIS_fnc_strategicMapOpen;
  17. magicpanda

    Placing Triggers Randomly with Random Size?

    Go and grab the SHKpos script. It's incredible at finding random positions. https://forums.bistudio.com/topic/153382-shk-pos/
  18. magicpanda

    SHK_pos

    Ok so i'm getting somewhere with spawning a house or 2 by using isFlatEmpty but it sends my PC mental for 30 seconds at the start of the mission looking for a spot and I could use a little help. I'm assuming I've got the values a little out as I don't fully understand them (beginner!). AO is a 5k marker on the west of altis (quite hilly) heli is an empty Huron. house1 is a house of the same the comp im spawning. call compile preprocessfile "SHK_pos\shk_pos_init.sqf"; _pos = ["AO", 0, //searches all over the 5k AO Marker, no water [], //[empty blacklist marrker array], [500,heli]] call SHK_pos; //[finds a spot with 500m, of the pos that will fit a Churon?] _startTask4Pos = _pos isFlatEmpty[5, //Check new _pos is not with 5m of anything, 1, //not 100% sure what this does 0.7, //0.7 gradient, is that steep? 5, //not 100% sure what this does 0, //no water false, //no water house1]; //object around the same size as I want to find. while {(count _startT4Pos) < 1} do { //Loop if it cant find a spot _pos = ["AO", 0,[],[500,heli]] call SHK_pos; _startTask4Pos = _pos isFlatEmpty[5, 1, 0.3, 40, 0, false, house1]; }; Any help greatly appreciated :)
  19. Ok so i'm getting somewhere by using isFlatEmpty but it sends my PC mental for 30 seconds at the start of the mission looking for a spot. I'm assuming I've got the values a little out as I don't fully understand them. AO is a 5k marker on the west of altis (quite hilly) heli is an empty Huron. house1 is a house of the same type in above pics. call compile preprocessfile "SHK_pos\shk_pos_init.sqf"; _pos = ["AO", 0,[],[500,heli]] call SHK_pos; //searches all over the 5k AO Marker, no water, [empty blacklist marrker array], [finds a spot with 500m, of the pos that will fit a Churon?] _startT4Pos = _pos isFlatEmpty[5, 1, 0.7, 5, 0, false, house1]; //Check new _pos is not with 5m of anything, not 100% sure what this does, 0.7 gradient?, not 100% sure what this does, no water, no water? while {(count _startT4Pos) < 1} do { //Loop if it cant find a spot _pos = ["AO", 0,[],[500,heli]] call SHK_pos; _startT4Pos = _pos isFlatEmpty[20, 1, 0.3, 40, 0, false, house1]; }; Any help greatly appreciated :)
  20. Here is what I mean in the piccy below. I could probably do with tweaking my SHKpos call to not pick such heavy gradients but I'm not sure how at the moment. (Heli is a chinook which is pretty big). call compile preprocessfile "SHK_pos\shk_pos_init.sqf"; _startT4Pos = [shkOne,[0,3500],random 360,0,[0],[500,heli]] call SHK_pos; _t4marker = createMarker ["t4marker1",_startT4Pos]; _t4marker setMarkerShape "ELLIPSE"; _t4marker setMarkerColor "ColorOPFOR"; _t4marker setMarkerSize [500, 500]; _t4marker setMarkerBrush "DiagGrid";
  21. magicpanda

    Easy Hostage Script (E.H.S)

    Cheers Jshock, worked perfectly.
  22. magicpanda

    SHK_pos

    Superb script this, amazing work. Cheers for doing it. This may be a stupid question but re the space for Vehicle part. Can it use any named object or does it have to be an actual vehicle? e.g I spawn a big house somewhere in my init, call it house1 then search for a really big and flat empty space based on that to spawn a base composition for example? _startT4Pos = [shkOne,[0,3500],random 360,0,[0],[500,house1]] call SHK_pos; Also, as a beginner, this would really benefit from a more newby friendly and full examples for people to get the most out of it if anyone has the time. The ones in the mission are pretty advanced imho. Took me ages to get my head around it and I still dont think Im getting the best out it I found this type of thing so helpful with EOS for example.
  23. magicpanda

    Vcom AI V2.0 - AI Overhaul

    :) That gave me a proper belly laugh. Straight out of a monty python sketch
  24. I used Zeus to spawn a guer camp at the airport and then grabbed that. When it all spawns randomly via Shk pos everything is mapped to the gradient of the land so my unit usually gets a table to the face :) Both vectorup solutions work great for buildings. Its the rest of it, ill post some screens when I get a chance, its hard to explain.
  25. magicpanda

    Easy Hostage Script (E.H.S)

    Cheers for the script, it's good stuff. Is it possible to change the activation distance on the addAction. Telekinesis is breaking the immersion :)
×