Jump to content

Spriterfight

Member
  • Content Count

    50
  • Joined

  • Last visited

  • Medals

Everything posted by Spriterfight

  1. I want that if the unit sees a target or detects a target then it will trigger an acton for him.My idea is i would create a radius for the unit attach to them and if the unit is in that radius then the trigger will activate.But i i have no idea how can i make an araea or radius for an unit via script ,i tried createMarker and attach it to the unit but markers can not be attached to units.Any idea?Maybe if i add an firednear eventhandler and filter the unit's side...
  2. So i have this: while {alive _gunner} do { _list = nearestObjects [_gunner,["Man"],400]; _listfiltered = _list select {side _x == EAST}; if (count _listfiltered > 0) then { _target = _listfiltered select 0; } else { _target = nil; ); if (_target distance _gunner < 400) then { //gives an error at this line it gives me an error that undefined variable in expression _target but i defined if the unit is in the radius of gunner then t will be _listfiltered select 0; but i dont understand that ,how can i bypass this ?should a _target = nil; work in the else statement?I tried with private _target = nil; before the while loop but didnt work
  3. Oh thank you very much.Now it dosent gives me errors.
  4. How should i skip these error if i have an local variable that will be defined in a if statement ? it works if one of east units are within the radius but if there are none then its gives me an error.Tried this ,dosent work; while {alive _gunner} do { _list = nearestObjects [_gunner,["Man"],400]; _listfiltered = _list select {side _x == EAST}; private _target = nil; if (count _listfiltered > 0) then { private _target = _listfiltered select 0; }; if (private _target distance _gunner < 400) then {
  5. So my problem is when i create a unit via createUnit the side of those units arent the side of the group in what i spawn them. ex: _gunnerGrp = createGroup [east, true]; _gunner = _gunnerGrp createUnit ["I_NORTH_FIN_Rifleman", getPos player, [], 10, "NONE"]; _assistantgunner = _gunnerGrp createUnit ["I_NORTH_FIN_Submachinegunner_SGT", getPos _gunner, [], 0, "NONE"]; they should be east but when i spawn them the circle is green and they are firing at me. I dont understand,it supposed to be on the side of the group thah i already created.The unit type is independent btw but should the side of the unit type influence its side when it is spawned?
  6. _gunner = mortar_gunner; _assistantgunner = mortar_assistant_gunner; _gunnerGrp = group mortar_gunner; while {alive _gunnerGrp} do { _totEnemy = {alive _x && side _x == EAST} count allUnits; if ( _totEnemy > 0) then { _list = nearestObjects [_gunner,["Man"],500]; _listfiltered = _list select {side _x == west}; _target1 = sleectRandom _listfiltered; }; 23:02:08 Error in expression <nemy > 0) then { _listoftargets = _list = nearestObjects [_myUnit,["Man"],500]; > 23:02:08 Error position: <= nearestObjects [_myUnit,["Man"],500]; > 23:02:08 Error Missing ; 23:02:08 File C:\Users\tibcs_000\Documents\Arma 3\missions\weapondeployment%20script.tem_ihantalaww\weapondeployment.sqf..., line 12
  7. Spriterfight

    HELP With script

    Thank you very much!
  8. How can i select an already spawned unit? So i have a unit in the editor and i want to select it with select command because i dont want to use global variable _unit = _this select 0; _playerGrp = group _unit; _pos1 = getMarkerPos "tankwest1"; _wp = _newGrp addWaypoint [_pos1,0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "Full"; _wp setWaypointBehaviour "Aware"; I put this in his init but the unit doesnt move.So how can i use select command to select the current unit without give it a globalvariable?
  9. Spriterfight

    Help with _this select 0;

    Thank you for your observation i didnt notice it
  10. Spriterfight

    Help with _this select 0;

    Ohhh, yess
  11. Spriterfight

    Help with _this select 0;

    the unit is assigned to a group
  12. Spriterfight

    Help with _this select 0;

    _playerGrp = group this; _pos1 = getMarkerPos "tankwest1"; _wp = _newGrp addWaypoint [_pos1,0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "Full"; _wp setWaypointBehaviour "Aware"; still dosn't move
  13. I have been making a surrender script but i am stuck with this part _groups = allgroups select { count (units _x) < 3 ;}; _groupsselect = _groups select 0;//this is the part where i am stuck because i can select only one gorup,how can i sleect all groups form my array? { if (side _groupsselect == east) then { { _x setCaptive true; _x action ["Surrender", _x]; } forEach units _groupsselect; }; } forEach allGroups; So i want that every group surrender if their unit count drops below 3 but i cant get the allgroup working correctly and i dont understand it.How can i loop the allgroup array to make the units surrender?
  14. Spriterfight

    HELP With surrender script

    Thank you very much!
  15. _crew = crew t1; unassignVehicle t2; {doGetOut _x} forEach _crew; this is my script the ai moves back,there are two groups one who drive the vehicle and the infantry. i set a waypoint for the infantry but they are not move there ,they are move back to the vehicle.
  16. I want that any unit from a specified group is in the area and activates trigger, but i need 5 units from 5 groups to be there because i want them to wait eachoter but if i set a trigger only for the leaders with a variable name ,if they got killed in action the trigger dosent activates
  17. So i want a dead body(t4) to be spawned after the vehicle(t1) is destroyed.My code is this: _pos = getPos [t1,0]; _unit = [t4,0]; _unit setPos [_pos,0]; _unit setDamage 1; its says getpos:string expected object,location
  18. Thank you guys!I solved it with this _pos = position t1; _unit = t4; _unit setDamage 1; _unit setPos _pos; it works
  19. I want to put a wallet on a plane s wing and i tried this attachTo [plane1] but the wallet isnt on the wings what can i do to define where i want to attach an object
  20. Spriterfight

    [HELPattachTo

    Thank you very mutch!
  21. I usually make separate script file with waypoints for the ai to move there every time if they respawn so their waypoint dosent get disapeared but are there an easier method to do this than make every individual group a script.sqf?
  22. i make them playable and via multiplayer respawn markers and add them eventhadnler when respawn thats gives them waypoint
  23. Thank you guys!Usually i dont use spawn module because its limited and it's a lot of work to configure it.
  24. So there are 4 one seated planes and i want my 4 men squad to get in those vehicles and fly to the destination.I tried get in nearest but just one men gets in the vehicle the others go by foot to the location what should i do?I dont want them to spawn in the vehicle immediately because the planes are synced to the vehicle respawn module. thx for your help guys!
×