Jump to content

jakkob4682

Member
  • Content Count

    252
  • Joined

  • Last visited

  • Medals

Everything posted by jakkob4682

  1. size(_loc) returns an array, it is the size of the location, so yes _area would select the 2nd element in the size array. _num is just a tag I used for user defined number of positions to get. and yes I have a functions module present because when I use (round(floor(random _num - 1))) it doesnt seem to work. And yes you are correct nearestLocation uses a passed position [_pos,_params] that was my fault. Will test with [(getPosATL player,["NameCity"]. As far as location variables https://community.bistudio.com/wiki/Category:Command_Group:_Locations, that is where I am getting my information from for getting size,position,type etc
  2. another work around is instead of using east not present do the opposite Activation: West Present (T or F) Condition: east countSide thisList == 0 onAct: what ever you want.
  3. how do I find the average distance between units that are in an array if possible? i.e. _cluster = []; _tgts = _var nearTargets 100; { if(_x select 2 == east)then { _cluster set [(count _cluster),_x]; }; }forEach _tgts; I want to calculate the average distance between units that are in _cluster
  4. activation = east not present; condition field = player in thisList
  5. how do I create waypoints from a count to eliminate redundancy? i.e. for "_i" from 1 to _wpCount do { _wp = _grp addWaypoint [_somePos,_someArea,(currentWaypoint _grp) + 1]; } tried that but doesnt work I have a seperate code that spawns a defined number of groups, I want those groups to patrol in a certain pattern around a position. i.e. how would I create a square shaped, octagon shaped, pentagon shaped patrol without having to use the addWaypoint command over and over.
  6. i.e. - _location = nearestLocation [player,"nameCity"]; _position = position _location; _grp = _params call BIS_fnc_spawnGroup; the next question is, how do you spawn groups from within a for-from loop? for "_i" from _minCount to (_minCount + (round(floor(random 4))) do { _grp = _params call BIS_fnc_spawnGroup; }
  7. without writing a book this is the question.... I have function1 which selects a random position within a specified radius, function2 which creates a marker on that location, my question is - is there a way to spawn groups at random positions within that marker? and if so how then would i refer to those groups INDIVIDUALLY in another script/function so that i can have one group defend the position and have the groups patrol the area? Basically what I'm trying to do is create a patrol/defend function that spawns groups in random positions within a marker area. Note these are all separate functions, i.e. not one script. i.e. loc1 = [] call findLocations; loc2... so on so forth mrk1 = [loc1] call markArea; null = [mrk1] call spawnGroups; etc etc
  8. _locations = nearestLocations [player,["StrongpointArea"],500]; { mrk = createMarker [str(random 100),position _x]; mrk setMarkerShape "Ellipse"; mrk setMarkerSize [100,100]; mrk setMarkerColor "ColorRed"; _grp = [(position _x),east,(configFile>>"CfgGroups">>"EAST">>"BIS_TK_INS">>"Infantry">>"TK_INS_Patrol")] call BIS_fnc_spawnGroup; null = [(leader _grp),mrk,"spawned","onroad"] execVM "scripts\upsmon.sqf"; }forEach _locations; Am I doing something wrong? When the groups are spawned I am getting a surrendered message.
  9. just as the title say: script in the spoiler, in init.sqf I have ambush = compile preprocessFileLineNumbers"ambush.sqf"; _spot = _this select 0; _pos = position _spot; _buildings = nearestObjects [_spot,["Building"],1000]; _building = _buildings select (round(floor(random (count _buildings)))); _bPos = position _building; _road = (_bPos nearRoads 100)select 0; _grp = createGroup east; for "_i" from 1 to 4 do { _man = _grp createUnit ["INS_Soldier_1",getPos _road,[],random 5,"FORM"]; missionNameSpace setVariable ["Insurgent" + str(_i),_man]; }; for "_j" from 1 to 3 do { _man2 = _grp createUnit ["INS_Soldier_AR",getPos _road,[],random 5,"FORM"]; missionNameSpace setVariable ["InsurgentMG" + str(_i),_man2]; }; _man3 = _grp createUnit ["INS_Soldier_Medic",getPos _road,[],random 5,"FORM"]; null = [_grp,getPos _road] call BIS_fnc_taskDefend; _road2 = (_bPos nearRoads 100)select (count (_bPos nearRoads 100)); _houses = nearestObjects [getPos _road2,["Building"],50]; _house = _houses select (count _houses); _hPos = getPos _house; _grp2 = createGroup east; _sniper = _grp2 createUnit ["Ins_Soldier_Sniper",_hPos,[],random 25,"FORM"]; _sniper doMove getPos _road; _sniper setUnitPos "DOWN"; _sniper setBehaviour "Stealth"; _sniper setCombatMode "RED"; iedMan = _grp2 createUnit ["Ins_Soldier_Sapper",_hPos,[],random 25,"FORM"]; iedMan addMagazine "BAF_IED_v1"; iedMan doMove getPos _road2; iedMan fire ["BAF_IED_v1_muzzle"]; _trigger = createTrigger ["EmptyDetector",getPos _road2]; _trigger setTriggerArea [7,7,0,False]; _trigger setTriggerActivation ["West","Present",False]; _trigger setTriggerStatements ["this","iedMan action ['TOUCHOFF',iedMan]",""]; sleep 4; iedMan doMove _hPos; iedMan setBehaviour "Stealth"; iedMan setCombatMode "BLUE"; true ---------- Post added at 11:44 PM ---------- Previous post was at 11:43 PM ---------- in the trigger used for calling the function I have null = [player] call ambush should I be using spawn instead? ---------- Post added at 11:46 PM ---------- Previous post was at 11:44 PM ---------- like the title says, and still no errors in the rpt ---------- Post added 03-19-2014 at 12:12 AM ---------- Previous post was 03-18-2014 at 11:46 PM ---------- Halp me plx
  10. jakkob4682

    ARMA 2 Shot Dispersion.

    \To be honest... dispersion is more along the lines of a config issue, rather than a skill issue, atleast that's what I have found. There might be an addon that allows changes the dispersion for certain units out there etc etc, but the best advice I can give is to create a custom script that uses setDir to change dispersion since mostly the AI shoot in a straight line.
  11. how do you create unique variable names for markers that are going to be created on each location of an array? i.e. using nearestLocations
  12. so would this snippet work? _locations = nearestLocations [getPos player,["nameCity","nameVillage"],12000]; _idx = 0; _townNum = _idx + 1; _pos = locationPosition (_locations select _idx); { _marker = createMarker [format ["town%1",_townNum],_pos]; _idx = _idx + 1; _townNum = _townNum + 1; _marker setMarkerShape "Ellipse"; _marker setMarkerColor "ColorRed"; _marker setMarkerSize [300,300]; }
  13. I'm trying to make a simple function that uses nearTargets and suppressFor for a QRF group. My question is can you use sleep within a "called" function? I.E. _handle = { //createGroup and createUnit code //use nearTargets to define threats and targets code { _x commandTarget _tgt _x suppressFor 10; }forEach units _group; sleep 5; }; I hope that makes sense, can't seem to get the formatting down using text editor in the forums.
  14. jakkob4682

    Tasks

    waitUntil{taskState _task == "SUCCESSFUL"}
  15. make a script using a text editor. In the script file _battery = _this select 0;//the name of the artillery module you place in the editor _tgt = _this select 1;//the name of the target, again has to be placed and named in the editor for simplicity _fm = []; _fmType = "Timed"; _rndType = "HE"; _delay = 3;//seconds between shots _duration = _someTime;//however long you want the mission to last _fm = [_fmType,_rndType,_delay,_duration]; if(! _battery getVariable "ARTY_ONMISSION")then { [_battery,getPosATL _tgt,_fm] call BIS_ARTY_F_executeTemplateMission; }; name the above script something like arty.sqf. Create another script in your mission folder and name it init.sqf. In the init.sqf file run this script using null = [_battery,_tgt] execVM "arty.sqf". I would use an empty helipad rather than a marker though since the artillery target has to get a 3 digit coordinate to work, and you can't use getPosASL or getPosATL on markers. community.bistudio.com/wiki/Artillery_Module‎ provides plenty of information, since there are other variables you can use to make it more dynamic.
  16. Hopefully not beating a dead horse, but can you use the "in" command to check if a unit is in a waypoint? i.e. a created a waypoint in a script and need to check if the unit the waypoint belongs to is "in" the waypoint in order for the unit to call another function.
  17. i think you can use getWPPos and run a distance check also to see if the waypoint is reached. I.E. if the waypointCompletionRadius is 50 then you could simply check if vehicles distance from the waypoint is <= 50 jsut checked and the distance check using getWPPos does indeed work. placed a waypoint for the player, placed a trigger. In the trigger condition field "player distance (getWPPos [group player,1]) < 100)" in the activation "hint 'complete'. and that did the trick. Assuming the distance is equal to the completion radius should work fine. Next step is to add an eventHandler for landed i guess to check that the helo/plane has indeed landed.
  18. is there a better way to do it? you can't use local variable inside of waypointStatements or trigger statements so i'm not really sure how to tell the script when to create the second waypoint since I don't know how to check if the waypoint is complete without using waypoint statements, which as I stated won't work since the group the waypoint belongs to is created locally. ---------- Post added at 09:45 PM ---------- Previous post was at 09:38 PM ---------- I guess one simple solution is to make the group a global variable, and create a seperate function to add the next waypoint and call that from the waypointStatements?
  19. yes. I.E. _i = 1; _wp = currentWaypoint _group; _wpIdx = _wp + _i; //if(_wp completed?) or if(_veh in list _wp) then { //create another waypoint // _rtb = _group addWaypoint [_rtbPos,50,_wpIdx]; }
  20. I know how to setwaypointStatement what I want to know is how to check when the waypoint is complete. I.E. waitUntil {currentWaypoint _grp complete} or waitUntil {_vehicle in list _wp} something along those lines.
  21. I really don't get into MP scripting because there's a whole slough of issues I'd need to know more about. As far as factions and subfactions yes GUE is a sub of IND. From the eventHandler page on the wikie MP notes: "Killed" and "Hit" eventhandlers are executed where given unit is local.
  22. So basically I am trying to create a mission where you start as an IND soldier or GUE soldier and through a series of combat scenario's you have the choice to pick which side of the war you want to fight on, completing sets of tasks for the side you choose raises your "reputation" with that side and lowers it for the other side. So I'm curious as to the basic script structure and whether it's going to have to include a set of functions to handle the task sets.
  23. The problem is that you can't setFriendly for one unit its a side - side relation. I know how to create the functions and even how to use a variable to represent the "reputation" and raise and lower with each task completed. The only thing missing is how to setFriend only one unit. The other option is to only use the player unit as the "IND" or "GUE" side, that way I can conversely effect each friendly status... i.e. if you complete a mission it increases setFriend for one side the exact opposite it does the other. Another idea I'm thinking about is increasing the skill forEach unit of the opposite side you're friendly with each you time you lower your friend variable with them so each time you encounter them the fire fights become more difficult.
  24. _locations = nearestLocations [getPos LeaderHQ,["nameCity","nameVillage"],7000]; { _mrk = createMarker ["mrk",getPos _x]; }forEach _locations; //how do I then setMarkerShape,Size,Color,etc for each marker i create? or create a trigger on each locationPosition? Trying to create a semi-dynamic mission using HETMAN and DAC is the reason I'm asking
×