Jump to content

twirly

Member
  • Content Count

    1304
  • Joined

  • Last visited

  • Medals

Everything posted by twirly

  1. No worries....there was actually a "}" too many... I fixed it in the second post.
  2. You can pass the vehicle type to one .sqf that creates vehicles... so an addaction for each vehicle type. _action1_ID = player [url="http://community.bistudio.com/wiki/addAction"]addAction[/url] ["Create Tunguska", "create_veh.sqf","2S6M_Tunguska"]; _action2_ID = player addAction ["Create T72", "create_veh.sqf","T72"]; create_veh.sqf:- _typofvehicle = _this select 3; _objects = []; _objects = getMarkerPos "MARKcar" nearObjects 5; if (count _objects >0) then { hintSilent "Can't spawn vehicle,\nsomething is blocking it's spawn!"; } else { _veh = [url="http://community.bistudio.com/wiki/createVehicle_array"]createVehicle[/url] [_typofvehicle, getMarkerPos "MARKcar", [], 0, "NONE"]; };
  3. Hi... use count as _area1 will be a list of objects. Here I changed _area1 to _objects; _objects = []; _objects = getMarkerPos "MARKcar" nearObjects 5; if (count _objects >0) then { hintSilent "Can't spawn vehicle,\nsomething is blocking it's spawn!"}; } else { createVehicle ["VWGolf", getMarkerPos "MARKcar", [], 0, "can_collide"]; }; EDIT: You might be better of with something like this statement which will find only objects of class "LandVehicle". Object Classes can be found here. _objects = (getMarkerPos "MARKcar") nearObjects ["LandVehicle",5];
  4. Another way... using alive (!alive (nearestObject [player, "2S6M_Tunguska"]));
  5. This is a cool thing. Thanks a lot.
  6. Not tested but should work whether the unit is spawned or not. newgroup = createGroup EAST; [rifle1] joinSilent grpNull; [rifle1] joinSilent newgroup; rifle dotarget rifle1; EDIT1: Variables were local. Made the variables global.... so it should work in a trigger. EDIT2: Make sure you have an OPFOR on the map... or add this to the init.sqf.... or it won't work. EastHQ = createcenter EAST;
  7. Don't know too much about the HC module but try adding this to your init.sqf... only the server must run this. if (isServer) then { EastHQ = createCenter east; WestHQ = createCenter west; EAST setFriend [WEST, 0]; WEST setFriend [EAST, 0]; }; Hope it helps.
  8. Hi mate... Hope you don't mind but I shortened it a bit for you. You don't need that outer loop because of the bold stuff below. Also check out how things are added to the arrays _found and _mnarray. This is more efficient. _ref = _this select 0; _models = _this select 1; _radius = _this select 2; _found = []; _select = 0; _search = nearestobjects [_ref, [], _radius]; { _object = _x; _str = str (_object); _hits = []; _array = toArray _str; _num = (_array find 58)+2; _mnarray = []; _add = 0; while {_add < ((count _array) - _num)} do { _mnarray set [count _mnarray, _array select (_num + _add)]; _add = _add + 1; }; if ([b](toString _mnarray) in _models[/b]) then { _found set [count _found,_object]; }; } foreach _search; _found Only looked at the function for multiple objects... because you really only need one function. You just call it with one item in the array if you only have one item. EDIT: Should have added that you handled the strings well. That can be a brain teaser.
  9. Hope I don't steer you wrong... there might be more to it than just this but try making mine_box_moved equal to something in the OnAct. It doesn't matter if it's true or a number like 0 or 1. Trigger: onAct: mine_box_moved = true; publicvariable "mine_box_moved";
  10. Hi mate... I got a "cannot play this mission blah blah blah...." Seems I need something called "babe_inf" in order for the mission to run. You might want to remove that so people without it can try this out.
  11. Try the createUnit line like this... using createUnit array. machinegunner = _grpAlpha createUnit [_unit2spawn, getMarkerPos "Spawn", [], 0, "FORM"];
  12. Is the stuff in red right? ... somehow that doesn't seem to make much sense... but it might! if ((getPos ExecDealer) distance posExecDealer > 1) then { ExecDealer setpos posExecDealer; }; if ((getPos UsedDealer) distance posUsedDealer > 1) then { [color="#FF0000"]ExecDealer setpos posExecDealer;[/color] }; Shouldn't it be:- if ((getPos UsedDealer) distance posUsedDealer > 1) then { [b]UsedDealer[/b] setpos [b]posUsedDealer[/b]; };
  13. Same here... ready to jump out the window on this one! LOL!
  14. Try spawning everything at [0,0,0] and then moving it under the helo with:- _boat setpos [(getpos _helo) select 0,(getpos _helo) select 1,0]; You might have to pass the helo to the script (boats.sqf) as well.
  15. Hi... while hvt in ex2 may work.... ranger1 in ex2 won't! Looking at the Script Commands it seems that you can only use an object here.... ranger1 is a group of objects/units. Always look up your commands and don't just assume stuff will work. Concerning the "always running" thing.... I've never seen that happen. ---------- Post added at 12:57 PM ---------- Previous post was at 12:55 PM ---------- After reading that again... I'm not sure if ranger1 is a group or not. My apologies if I read it wrong.
  16. If it's showing errors then I'm afraid it is broken.
  17. Looks like you've been messing with the mission.sqm file. There's very few occasions where you will ever need to open that file. Certainly not to edit triggers etc. Edit everything like that from the editor. The mission.sqm is not meant to be edited directly.... it is not a script. Maybe Squint can sort it out for you.... I'm not sure because I don't use it. ---------- Post added at 02:15 AM ---------- Previous post was at 02:08 AM ---------- Anyway... just looking at what's there... you can't use local variables in a trigger.... that might be one of your problems.
  18. A couple ideas... I believe getplayerUID only works in Multiplayer so you must test in a MP environment or replace getplayerUID player with an actual string to test in SP. Also...what's the colon there for? [color="#FF0000"]:[/color] private ["_Clan213"]; _Clan213 = [abc, bca, cba]; if (getplayerUID player in _Clan213) then { hint "Welcome to the clan area"; } else { hint "You're trepassing!"; }; EDIT: ninja'd
  19. Where do you want the markers?
  20. No worries man! It can be overwhelming at times. I was actually working on a simple detection script for you using knowsabout.... monitor.sqf:- _blufor_grps = _this select 0; _opfor_grps = _this select 1; _alarm_raised = false; while {not(_alarm_raised)} do { for "_i" from 0 to (count _opfor_grps)-1 do { _opfor_grp = _opfor_grps select _i; for "_j" from 0 to (count _blufor_grps)-1 do { _blufor_grp = _blufor_grps select _j; for "_k" from 0 to (count (units _blufor_grp))-1 do { _blufor_unit = (units _blufor_grp) select _k; if ((leader _opfor_grp knowsabout _blufor_unit) > 1.4) then { //**************** //raise alarm here //**************** _alarm_raised = true; }; }; }; }; sleep 1; }; You would call it with groups like this.... nul = [[west_group1],[east_group1,east_group2]] execVM "monitor.sqf"; Posted it anyway and not tested but should work. Might have silly errors.
  21. I'm not sure I understand because you can set the trigger to fire when "BLUFOR is detected by OPFOR" in the mission editor.
  22. To simulate an EMP pull the plug on the computer! :)
  23. If you use this he won't try to get back in. unassignVehicle or you can try... leaveVehicle
  24. As far as I know .wav's do work... just less efficient. In Kylania's example ... if you do use a .wav files... make sure the file extensions are .wav and not .ogg!
×