Jump to content

dragonsyr

Member
  • Content Count

    768
  • Joined

  • Last visited

  • Medals

Everything posted by dragonsyr

  1. dragonsyr

    spawn unit in a building

    omg!!! you right about this... i try with this and the units spawn without errors but not in the place... .... ok i will try now with that you send.... ---------- Post added at 17:16 ---------- Previous post was at 17:11 ---------- what does the can_collide command??? ---------- Post added at 17:25 ---------- Previous post was at 17:16 ---------- i test this again and the unit spawn in the place i want (ground test) not in building.... now the next test.......---------- Post added at 17:37 ---------- Previous post was at 17:25 ---------- with this i get error undefined variable in expression grp , when i run from a script. if i run this command from debug console , no errors but nothing spawned
  2. working as i need... thank you sir!
  3. thank you very much Larrow... i will try this asap......thank all of you for the time who spend for my demands :-)))
  4. ---------- Post added at 20:25 ---------- Previous post was at 20:23 ---------- i want to make it more clear to you, because my english is bad.... im the player , you are the object and you facing west. i want ,when i m to your relative direction from 45 to 125 , then i get {hint"you r right of the object";}; 126 to 235 then {hint"you r behind of the object";}; etc... i dont know how can tell you other way sorry for that
  5. if i use this _target = relpos; //name of object _targetdir = getdir _target; // return direction of the object ???? or this _targetdir = direction _target _playerPos = [_targetdir, player] call BIS_fnc_relativeDirTo; if (_playerPos > 0 && _playerPos < 180 ) then {hint "you are right of the object";}; if (_playerPos >181 && _playerPos < 360 ) then {hint "you are left of the object";}; i get
  6. first of all , the code that i post is not working . its a code from my head. i need if the player is 0-180 from the object direction ,then something if 180-359 from object direction then something else i prefer command between 2 specific numbers and not <180 (0-60 or 70-90 0-179 etc......... for future use with other things also) thnks for the reply ---------- Post added at 18:35 ---------- Previous post was at 18:25 ---------- _targetdir = getdir _target; // return direction of the object ???? or this _targetdir = direction _target _playerPos = [_targetdir, player] call BIS_fnc_relativeDirTo; // Check the direction of the player relative to the _target direction??? if (_playerPos = 0 to 90 from _targetdir) then {hint "you are right front of the object";}; //??? if (_playerPos = 90 to 180 from _targetdir) then {hint "you are right and behind of the object";}; //??? if (_playerPos =180 to 360 from _targetdir) then {hint "you are left of the object";}; //??? to see the diference between 2 numbers
  7. dragonsyr

    Custom sound, superb, repeat?

    place a trigger in your map and name it example_trigger . on activation put this _s=[]execvm"yourmissionsubfolder\soundexample.sqf"; place an object where you want the sound comes and name it . then copy this code and paste it in a file and name it soundexample.sqf in your mission folder _sound = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; _play = _sound + "sounds\yoursoundname.ogg";// your sound path goes here _source = nameofyoursourceobject; // here put the name of source object while {true} do { if ({isPlayer _x} count list example_trigger >0) then { playSound3D [_play, _sound, true, getPos _source, 10, 1, 20]; }; //10 is the db of you sound , 1 i dont know :-)) 20 is the distance in meters for sound fade hint"radio on";//some hint if you like sleep 179;// total time of your sound >>important<< }; you must change lines , 2,3 and 11 for your sound setup. this is tested and works fine for that you want to do. thats Mattar say in post above , but the playsound3d is not working like that ---------- Post added at 20:32 ---------- Previous post was at 20:30 ---------- for single player is ok... for multi i think it need more commands because this way, all players can call the same sound same time and the playsound3d is not local sound call... Edit: if you put the sqf file in the root of your mission folder , then in your trigger put only the sqf filename like this _s=[]execvm"soundexample.sqf";
  8. how to prevent this??? (for dedicated server mission) i have a script that the player can call . The script give waypoints to some preplaced units from editor. What can i use for return the units in initial position if the player disconnected from server??? i think that i want a server side script that monitor somehow the units and if the units is not controled by players , then units back to the place. i need that also for some global variables (if is nil and the player who make those variables nil (from script) , is not exist then those variables !isnil.) i hope that you understand what i mean..... thanks ---------- Post added at 18:37 ---------- Previous post was at 18:28 ---------- when the player is dead the script that use continues , or is like disconnection????? ---------- Post added at 18:49 ---------- Previous post was at 18:37 ---------- with other words.... i m pilot and i call the script that lock a helipad (prevent of use the same helipad other player same time ) and some units move in some waypoints. so far so good.... if i disconnect from server then the units stays in last position , and the helipad is locked forever. this is the problem i have
  9. @ zigomarvin ok. i tried all this but nothing happend. no distance for aim and no distance for object... ---------- Post added at 16:28 ---------- Previous post was at 16:20 ---------- @whiztler this working fine !!
  10. how can i add a distance from target indicator in player screen? (like the speed/alt indicator or as a hint )
  11. i think this is that i want, but i need player distance from specific object and not what aim the player (if i undertand right what this does) while {alive player} do { hintSilent format ["Distance: %1", player distance _myobject ([b]screenToWorld [0.5,0.5][/b])]; sleep 0.5; } can i use it like this? ---------- Post added at 14:02 ---------- Previous post was at 13:56 ---------- i m not in front of my computer right now....... in a few hours can make tests......
  12. dragonsyr

    setDir not working?

    try disableAI "ANIM" after the setdir command this command solve many anim/move issues , dont forget to enable back with enableAI
  13. i ll try that thanks... ---------- Post added at 21:23 ---------- Previous post was at 21:22 ---------- but i think that this gives me only visual help and not the meters inc/dec from target
  14. dragonsyr

    addwaypoint position

    fm is the groupname of the unit ( i thought that the waypoint need only goupnames for working)and for the coordinates i have there , i get from the mission sqm as i say..... ok then, i ll try all that you gave me ... ---------- Post added at 19:26 ---------- Previous post was at 19:20 ---------- ok i must figure out how can i do that... is a good help for find out the positions that i want to set... ---------- Post added at 19:36 ---------- Previous post was at 19:26 ---------- my total script is this and is a test for follow me car in airport (i hope ) _cf = "FlagChecked_F" createVehicle [0,0,0]; _chem = "Chemlight_yellow" createVehicle [0,0,0]; //playSound3D [_sdplay5, speakerfm, true, getPos speakerfm, 10, 1, 150];//speakerfm say3D "alarmfm"; fmdriver assignAsDriver followme; [fmdriver] orderGetIn true; _wpfollow = fm addWaypoint [position pad, 0]; if (isNil {missionNamespace getVariable "f_light"}) then { follow_m_array = []; // Define once if ((count follow_m_array) == 0) then { _cf attachTo [followme,[ 0,-3,0.5]]; _chem attachTo [followme,[ 0,-3,0.7]]; follow_m_array set [(count follow_m_array), _cf]; follow_m_array set [(count follow_m_array), _chem]; getPos player;copytoclipboard str getpos obj; }; missionNamespace setVariable ["f_light", follow_m_array]; }; fmdriver assignAsDriver car1; [fmdriver] orderGetIn true; _wpfollow = (group fmdriver) addWaypoint [[1802.43,5795.26,0.00143862], 0]; _wpfollow setWaypointBehaviour "CARELESS"; _wpfollow setWaypointCombatMode "BLUE"; _wpfollow setWaypointSpeed "FULL"; waitUntil { (currentWaypoint (_wpfollow select 0)) > (_wpfollow select 1) }; hint"Follow me waiting.....";sleep 2; _wpfollow = (group fmdriver) addWaypoint [[1889.53,5716.83,0.00143147], 0]; _wpfollow setWaypointBehaviour "CARELESS"; _wpfollow setWaypointCombatMode "BLUE"; _wpfollow setWaypointSpeed "FULL"; waitUntil { (currentWaypoint (_wpfollow select 0)) > (_wpfollow select 1) }; hint"Follow me back in place.....";sleep 2; [fmdriver] orderGetIn false; //[]execvm"atc\followme.sqf"; if (!isNil {missionNamespace getVariable "f_light"}) then {{ follow_m_array = follow_m_array - [_x]; deleteVehicle _x;} forEach follow_m_array; f_light = nil;}; this is it, i post it for you to know excactly what im trying to do.. the car is vehicle="B_MRAP_01_F"; working perfect
  15. i want to add a waypoint in a place without the use of another object ex _wpfollow = fm addWaypoint [position _helipad, 0]; but something like this _wpfollow = fm addWaypoint [position {1797.8877,5.5,5777.0903}, 0]; is this possible?
  16. dragonsyr

    Attach objects to unit

    working perfect.... thanks a lot
  17. Is it possible to attach chemlights i a unit hands ??(both hands and not in fist but opposite side)
  18. dragonsyr

    Attach objects to unit

    and how about attachto objects? i try that _cr = "FlagChecked_F" createVehicle [0,0,0]; _cr attachTo [followme, -0.05,-0.01,0.03]; //followme is a vehicle="B_MRAP_01_gmg_F"; i get no errors ,but nothing spawned on vehicle i tried many combination of number [] {} etc
  19. dragonsyr

    addwaypoint position

    i have this fmdriver assignAsDriver followme; [fmdriver] orderGetIn true; _wpfollow = fm addWaypoint [[1797.8877,5.5,5777.0903], 0];//this is the position of _helipad as i get it from the mission.sqm (position[]={1797.8877,5.5,5777.0903};) //_wpfollow = fm addWaypoint [position _helipad, 0]; [fm, 2] setWaypointBehaviour "CARELESS"; [fm, 2] setWaypointCombatMode "BLUE"; [fm, 2] setWaypointSpeed "FULL"; waitUntil { (currentWaypoint (_wpfollow select 0)) > (_wpfollow select 1) }; _wpfollow1 = fm addWaypoint [position speakerfm, 0]; [fm, 2] setWaypointBehaviour "CARELESS"; [fm, 2] setWaypointCombatMode "BLUE"; [fm, 2] setWaypointSpeed "FULL"; //[fm, 2] setWaypointType "GETIN NEAREST"; waitUntil { (currentWaypoint (_wpfollow1 select 0)) > (_wpfollow1 select 1) }; [fmdriver] orderGetIn false; the commented line is the place i want the unit go. with this is working. but as it is , the unit get in the car, waiting for 4-5secs and get out again....
  20. i have this code and works for spawn the object on an object radial ,but i cant delete it light script if (isNil {missionNamespace getVariable "hlight"}) then { _ang = 0; _rad = 6.5; //radius _bcount = 6; //number of lights _inc = 360/_bcount; for "_i" from 0 to _bcount do { _a = (_target_pos select 0)+(sin(_ang)*_rad); _b = (_target_pos select 1)+(cos(_ang)*_rad); _pos = [_a,_b,_target_pos select 2]; _ang = _ang + _inc; _light = "Land_runway_edgelight" createVehicle _pos; _light setPos _pos; // lights set[_i, _light]; //only commented works for spawning missionNamespace setVariable ["hlight", _light]; };}; the lights spawned and is in place i want. i try to delete with this command if (!isNil {missionNamespace getVariable "hlight"}) then {for "_i" from 0 to count(lights) - 1 do{ deleteVehicle (lights select _i); // i try also _light , hlight, no luck }; hlight = nil;}; but nothing happened...... if uncomment the line "lights set" in my light.sqf i get this error how can i define the spawn of my light as one "word" ,so after i can deleted from another script?
  21. you r right.... working without the commented line... thank you sir ! ---------- Post added at 13:24 ---------- Previous post was at 13:20 ---------- but how can i delete this? with this command i cant
  22. dragonsyr

    Attach objects to unit

    thank you, working !
  23. thank you Iceman , you r very helpful
  24. thank you Larrow !! :-) edit: i try that _helitarget = pad; _target_pos = getPos (_helitarget); _lightType = "Chemlight_green"; if (isNil "hlight") then { hlight = []; //[rad, bcount, lightClass] _circles = [ [6.5, 9, "Land_runway_edgelight"], [15, 9, "Land_runway_edgelight"] ]; { _rad = _x select 0; _bcount = _x select 1; _lightClass = _x select 2; _inc = 360/_bcount; for "_ang" from 1 to 360 step _inc do { _a = (_target_pos select 0)+(sin(_ang)*_rad); _b = (_target_pos select 1)+(cos(_ang)*_rad); _pos = [_a,_b,_target_pos select 2]; _light = _lightClass createVehicle _pos; _light setPos _pos; hlight set [(count hlight), _light]; }; }forEach _circles; _centerLight = _lightType createVehicle [getPos _helitarget select 0, getPos _helitarget select 1,1]; hlight set [(count hlight), _centerLight]; }; and i get
  25. is it possible this? variables.sqf _var1= blah blah; _var2=blah blah; if (_var1) then {execvm "script.sqf";}; .......... can i use those variables from another script ? ex: script.sqf _var3 = true; if (_var 1 == something) then {blah blah} else {}; (above example have a call on script.sqf . maybe the private command do the job???) also this ? the diference here is that the two scripts is n t connected somehow variables.sqf _var1= blah blah; _var2=blah blah; _var3 = blah blah can i use those variables from a script ? ex: script.sqf if (_var 1 == something) then {blah blah} else {};
×