Jump to content

rejenorst

Member
  • Content Count

    427
  • Joined

  • Last visited

  • Medals

Everything posted by rejenorst

  1. Try this: {_x addscore (0 - 1);} forEach thislist;
  2. isFlatempty can on occassion return nothing if there just isn't a space in the assigned radius where it should look. You've only allowed it to look in the space of 1 meter I think and you've asked for it to have a minimum distance of 50 meters from any object which is unlikely in a forest: _newPos = (getPos _TskmarkerRandomPos) isFlatEmpty[50, 1, 0.5, 10, 0, false, player]; Try: _newPos = (getpos _TskmarkerRandomPos) isflatempty [2,50,1,2,0,false,player];
  3. Ah yeah sorry in that case as Horner says: {deleteVehicle _x;} forEach _array;
  4. You can put it in the init but make sure you put your switchmove line first then the setdir line and then the disableanim line.
  5. Don't forget: while {true} do { _unit switchMove "cooper_c0briefing"; waitUntil {animationState _unit != "cooper_c0briefing"}; _unit setdir 180; }; This could work but there may be some jerkiness in the switchmove transition.
  6. If you want a unit to sit and not stand up make sure he is in safe mode. If you doing it with a specific anim: _unit disableai "anim"; (use this after you've got him to sit down. It will stop him from changing anims but its like pausing him totally. Some animations are looped while others are not. If this anim isn't looped automatically he will stand up unless you disableai anim. Once you have him sitting down use: _unit setdir 180; to make him face the opposite direction.
  7. Yes I think you can. or make a variable _plist = playableunits; then foreach _plist. If you want a random position around an object: _spawnpos = (getpos _player) //--change this to whichever player is the target. _angle = random 360; _distance = random 500; //-- remove random if you want a minimum distance and replace 500 with whatever distance u want. _pos =[(_spawnpos select 0) + _distance*(cos _angle),(_spawnpos select 1) + _distance*(sin _angle), 0];
  8. Well you could use the objectstodestroy = nearestobjects variable (as Horner suggested) from a given position and distance which would save the data into an array then you could just {_x setdammage 1} foreach objectstodestroy;
  9. If its an SQF from an SQF file I find that this works: [] execVM "checkloop.sqf"; without the null = Outside of an SQF file such as a trigger ingame its a different story.
  10. rejenorst

    Case statement Advise

    Ah cheers Cruel :D Fixed it! There was a " missing infront of Orange. private["mymarkercolour "]; _tempvariable = ["ColorRed","Coloryellow","ColorGreen","ColorBlue","ColorOrange","ColorRedAlpha","ColorKhaki","ColorBrown","ColorPink"]; _cv = (count tempvariable) - 1; mymarkercolour = tempvariable select (ceil (random _cv)); switch (mymarkercolour) do { case "ColorRed": { hint "Red marker"; }; case "Coloryellow": { hint "yellow"; }; case "ColorGreen": { hint "green"; }; case "Colororange": { hint "Orange"; }; case "ColorRedAlpha": { hint "ColorRedAlpha"; }; case "ColorKhaki": { hint "ColorKhaki"; }; case "Colorbrown": { hint "brown"; }; case "Colorpink": { hint "Pink"; }; };
  11. rejenorst

    Case statement Advise

    Di you place the functions module on your map? To get around using the BI function try and use this: private["mymarkercolour "]; _tempvariable = ["ColorRed","Coloryellow","ColorGreen","ColorBlue","ColorOrange","ColorRedAlpha","ColorKhaki","ColorBrown","ColorPink"]; _cv = (count tempvariable) - 1; mymarkercolour = tempvariable select (ceil (random _cv)); switch (mymarkercolour) do { case "ColorRed": { hint "Red marker"; }; case "Coloryellow": { hint "yellow"; }; case "ColorGreen": { hint "green"; }; case "Colororange": { hint Orange"; }; case "ColorRedAlpha": { hint "ColorRedAlpha"; }; case "ColorKhaki": { hint "ColorKhaki"; }; case "Colorbrown": { hint "brown"; }; case "Colorpink": { hint "Pink"; }; };
  12. 1) deleting all the markers or just the markers of the areas cleared? (needs to be very specific. If you want to delete all of them it would be as simple as putting the line of code: {deletemarker _x} foreach mymissionmarkers; However you would need to terminate the script I gave you before hand otherwise you'd get errors popping up if you suddenly delete markers that a script is still using. If you just want to delete markers as they go green (when captured by friendlies then add the following: private["_temvariable","_cv","_sc","_vardone","_vardone2","_objects","_marker","_eastside","_westside"]; _vardone = 0; while {_vardone == 0} do { _temvariable = []; {if ((count (nearestObjects [(getmarkerpos _x),["MAN"],25])) > 0) then {_temvariable = _temvariable + [_x]};} foreach mymissionmarkers; sleep 0.1; _cv = count _temvariable; if (_cv > 0) then { _sc = 0; _vardone2 = 0; while {_vardone2 == 0} do { if (_sc < _cv) then { _marker = _temvariable select _sc; _objects = nearestObjects [(getmarkerpos _marker),["MAN"],25]; _westside = []; _eastside = []; {if (side _x == WEST) then {_westside = _westside + [_x]};} foreach _objects; {if (side _x == EAST) then {_eastside = _eastside + [_x]};} foreach _objects; if ((count _westside) > (count _eastside)) then { _marker setMarkerColorLocal "ColorGreen" [b]_temvariable = _temvariable - - [_marker]; mymissionmarkers = mymissionmarkers - [_marker]; deletemarker _marker; _cv = count _temvariable;[/b] } else { if (count _eastside > 0) then { _marker setMarkerColorLocal "ColorRed" }; }; _sc = _sc + 1; } else { _vardone2 = 1; }; }; }; }; However this would defeat the purpose of the markers going green since they would be deleted so fast unless you want to put a seconds wait before the deletion which would be done via sleep 1; If you planning to exit the script and delete all the markers after they are all green then: private["_temvariable","_cv","_sc","_vardone","_vardone2","_objects","_marker","_eastside","_westside"]; _vardone = 0; while {_vardone == 0} do { _temvariable = []; {if ((count (nearestObjects [(getmarkerpos _x),["MAN"],25])) > 0) then {_temvariable = _temvariable + [_x]};} foreach mymissionmarkers; sleep 0.1; _cv = count _temvariable; if (_cv > 0) then { _sc = 0; _vardone2 = 0; while {_vardone2 == 0} do { if (_sc < _cv) then { _marker = _temvariable select _sc; _objects = nearestObjects [(getmarkerpos _marker),["MAN"],25]; _westside = []; _eastside = []; {if (side _x == WEST) then {_westside = _westside + [_x]};} foreach _objects; {if (side _x == EAST) then {_eastside = _eastside + [_x]};} foreach _objects; if ((count _westside) > (count _eastside)) then { _marker setMarkerColorLocal "ColorGreen" } else { if (count _eastside > 0) then { _marker setMarkerColorLocal "ColorRed" }; }; _sc = _sc + 1; } else { _vardone2 = 1; }; }; }; sleep 0.1; _temvariable = []; {if ((getMarkerColor _x) == "ColorGreen") then {_temvariable = _temvariable + [_x]};} foreach mymissionmarkers; _cv = count _temvariable; if (_cv == (count mymissionmarkers)) then { _vardone = 1; }; }; {deletemarker _x} foreach mymissionmarkers; mymissionmarkers =[]; As for the other question my head is spinning and its late so I'll try and answer it next time,
  13. A very inefficient way of doing it, add this to any sqf script then launch the script with this: 0 = [] execVM "scriptname.sqf"; LAUNCH IT AFTER YOU HAVE CREATED THE MARKERS AND SENT THEM TO THE GLOBAL VARIABLE: mymissionmarkers Copy paste this into a script. I've tested it out and it will loop and continually check whether there are more WEST than BAD over a particular marker and change color accordingly. private["_temvariable","_cv","_sc","_vardone","_vardone2","_objects","_marker","_eastside","_westside"]; _vardone = 0; while {_vardone == 0} do { _temvariable = []; {if ((count (nearestObjects [(getmarkerpos _x),["MAN"],25])) > 0) then {_temvariable = _temvariable + [_x]};} foreach mymissionmarkers; sleep 0.1; _cv = count _temvariable; if (_cv > 0) then { _sc = 0; _vardone2 = 0; while {_vardone2 == 0} do { if (_sc < _cv) then { _marker = _temvariable select _sc; _objects = nearestObjects [(getmarkerpos _marker),["MAN"],25]; _westside = []; _eastside = []; {if (side _x == WEST) then {_westside = _westside + [_x]};} foreach _objects; {if (side _x == EAST) then {_eastside = _eastside + [_x]};} foreach _objects; if ((count _westside) > (count _eastside)) then { _marker setMarkerColorLocal "ColorGreen" } else { if (count _eastside > 0) then { _marker setMarkerColorLocal "ColorRed" }; }; _sc = _sc + 1; } else { _vardone2 = 1; }; }; }; }; ---------- Post added at 10:56 AM ---------- Previous post was at 10:55 AM ---------- I should mention that I haven't placed any terminate conditions so the script will loop forver. You can add a condition that will set _vardone = 1 for the script to exit the loop. ---------- Post added at 10:58 AM ---------- Previous post was at 10:56 AM ---------- Markers react to units within 25 meter distance of marker. ---------- Post added at 10:59 AM ---------- Previous post was at 10:58 AM ---------- Also if you want them to react to tanks, cars, helis etc then add: ,"TANK","AIR","CAR","TRUCK" etc to wherever you see "MAN" ---------- Post added at 11:08 AM ---------- Previous post was at 10:59 AM ---------- Just in case your not sure what to do (sorry just want to help u as fast as possible) copy paste the code into a wordpad and save it into your mission root directory under a name like: markerloop.sqf At the bottom of your initial Task1.sqf (at the very bottom to make sure this executes after task1.sqf has finished_: 0 = [] execVM "markerloop.sqf"; And that should do it. Warning though: To many markers and this script will probably slow your performance down quite a bit. Like I said its not efficient in the least but I hope it helps you as a temporary script.
  14. Yep sorry forgot about the set method. So Yes, or alternatively: mymissionmarkers = []; private ["_mkr","_var","_pos","_houses"]; /// get all houses in location////// _houses = [markerpos "taskarea1",600, 3, true] call findHouses; { _pos = _x call getGridPos; _mkr = str _pos; if (getMarkerPos _mkr select 0 == 0) then { _mkr = createMarkerLocal[_mkr, _pos]; _mkr setMarkerShapeLocal "RECTANGLE"; _mkr setMarkerTypeLocal "SOLID"; _mkr setMarkerSizeLocal [50,50]; _mkr setMarkerAlphaLocal 0.6; _mkr setMarkerColorLocal "ColorGreen"; }; // would I add it here if so is this correct ? mymissionmarkers set [count mymissionmarkers, _mkr]; } forEach _houses; TRIGGER AND SCRIPT POSSIBILITY 1: Yep now all you would have to do in the trigger is: {_x _setMarkerColorLocal "ColorGreen"} foreach mymissionmarkers; TRIGGER AND SCRIPT POSSIBILITY 2: However if you just want to change marker colors that are within a _radius of a particular _unit or object then: [_unit,_radius] execVM "scriptname.sqf"; This may have to be: 0 = [_unit,_radius] execVM "scriptname.sqf"; Change the scriptname to whatever you want (just make sure the scriptname.sqf is changed accordingly) then copy paste this in: private["_closestmarkers","_radius","_unit"]; _unit = _this select 0; _radius = _this select 1; _closestmarkers = []; {if ((_unit distance (getmarkerpos _x)) <= _radius) then {_closestmarkers = _closestmarkers + [_x]};} foreach mymissionmarkers; if ((count _closestmarkers) > 0) then { {_x setMarkerColorLocal "ColorRed"} foreach _closestmarkers; }; This will check how far the unit is away from the markers you placed in the mymissionmarkers variable and if they are less than or equal to the distance of the radius you specified they will change to color red (change as you see fit). TRIGGER AND SCRIPT POSSIBILITY 3: Alternatively you could put this in the trigger: [_unit] execVM "scriptname.sqf"; This may have to be: 0 = [_unit] execVM "scriptname.sqf"; And then use this code to turn the first 3 closest markers to the unit red: private["_temparray","_tempvariable","_unit"]; _unit = _this select 0; _tempvariable = mymissionmarkers ; { _closestmarker = _tempvariable select 0; {if (((getmarkerpos _x) distance _unit) < (_closestmarker distance _unit)) then {_closestmarker = _x}} forEach _tempvariable; _temparray = _temparray + [_closestmarker]; _tempvariable = _tempvariable - [_closestmarker] } forEach _tempvariable; if ((count temparray) > 0) then { (temparray select 0) setMarkerColorLocal "ColorRed"; if ((count temparray) > 1) then { (temparray select 1) setMarkerColorLocal "ColorRed"; if ((count temparray) > 2) then { (temparray select 2) setMarkerColorLocal "ColorRed"; }; }: };
  15. Best to create a global array such as: mymissionmarkers = []; then store local variables which you need to access later into that array via: mymissionmarkers = mymissionmarkers + [_markername1,_markername2, etc...]; You could then find the nearest marker to whichever unit has triggered the particular condition ( I am not sure what the conditions are that your planning to use so this is just a guess).
  16. I use the following command server side to have it heard on all clients (incl server): [nil,unit1,rSAY,"talk1_1"] call RE; For the actual say description if I want it to sound direction I do this: class talk1_1 { name = "talk1_1"; // Name for mission editor sound[] = {\sounds\talk1_1.ogg, db+10, 1.0, 0.15}; titles[] = {0,""}; }; 0.15 makes it sound like its coming from a particular direction and will not be heard further away.
  17. Alternatively you can use the say command (just say and not say3d) (if say3d isn't working out for you) and have the lines for the description.ext like this: class sound1 { name = ""; sound[] = {"\sound\sound1.ogg", 0.15, 1}; titles[] = {""}; }; The bolded part should be 0.10 - 0.25 or anywhere in between for good balanced effect.
  18. I am sure you've tried this but thought I'd double check: Hi Hebrew Hammer, have you tried moving the waypoints around a bit just incase the position is on a rock/static object? I have noticed that groups will sometimes fail to move if the waypoints are placed on objects such as trees/rocks etc. You can also try and make two waypoints for each group.
  19. rejenorst

    Increase enemy gunfire volume?

    _unit setskill ["aimingShake",1]; The higher the aimshake skill the less time the unit will take to aim and fire his weapon. This means you can have a higher volume of fire while accuracy doesn't need to be set to 1. Accuracy could be: _unit setskill ["accuracy",(random 1)];
  20. rejenorst

    [COOP] Zargmout

    Hi Rojas, that shouldn't be to hard to implement. I'll keep it in mind for the next update of the mission. Thanks for the feedback :)
  21. rejenorst

    Rejenorst's Missions [SP/MP/COOP]

    Thanks Suicidecommando and Katipo66 :) I'll check out Aliabad. Also here is a link to v1.2 on Armaholic. Martyrdom 2 (@) v1.2
  22. rejenorst

    Rejenorst's Missions [SP/MP/COOP]

    Updated Martyrdom2 to v1.2 LINK Version 1.2: http://www.rejenorst.com/projects/[sP]Martyrdom2.fallujah.rar 1.2 -Fixed Airstrikes -Fixed improper use of the currentcommand -Buffed friendly unit stats for long range engagements (did the same in Martyrdom v1.1)
  23. rejenorst

    [COOP] Zargmout

    Cheers mate :)
  24. rejenorst

    [COOP] Zargmout

    I've changed the download link to include two versions of this mission: http://www.rejenorst.com/projects/zargmout_v13.rar Version 1.3 [COOP]Zargmout_revive1_v1_3.Zargabad.pbo uses Norrin's revive script. I've had one friend of mine report a CTD while testing this version on a dedicated server. His server however uses a lot of different mods so it may be better to use [COOP]Zargmout_revive2_v1_3.Zargabad.pbo which uses R3F revive and is a less complicated script (I cannot be certain that there is a conflict however but R3F was used in the last version which had no CTDs on the various servers used). Should you experience any CTD's please let me (Rejenorst) know at: http://forums.bistudio.com/showthread.php?136243-COOP-Zargmout The R3F revive version now has the player call out in pain every 10-20 seconds as well until revived/respawned. Feedback is desperately needed on COOP missions in order to improve on them and to add to them Thank you very much!
×