Jump to content

jazzraill

Member
  • Content Count

    24
  • Joined

  • Last visited

  • Medals

Community Reputation

3 Neutral

About jazzraill

  • Rank
    Private First Class

Recent Profile Visitors

867 profile views
  1. title is self-explanatory. I'm looking for ways to apply mud/scratch textures into texture by using smdi
  2. jazzraill

    Modify Hunt_players_fnc

    try this _grp spawn { private _grp = _this; waitUntil { sleep 3; private _nearestPlayer = player; //Get nearest player here. if (((leader _grp) distance _nearestPlayer) < 200) then { _posPlayer = getPos player; _posLeader = getPos (leader _grp); _posPlayer set [2,1.75]; _posLeader set [2,1.75]; if !(((terrainIntersect [_posPlayer,_posLeader]) or (lineIntersects [(ATLToASL _posPlayer),(ATLToASL _posLeader),(leader _grp),_nearestPlayer]))) then { {doStop _x; _x commandTarget _nearestPlayer;} foreach (units _grp); }else{ for '_i' from ((count waypoints _grp) - 1) to 0 step -1 do { deleteWaypoint [_grp, _i]; }; _wp = _grp addWaypoint [getPos _nearestPlayer,0]; _wp setWaypointType 'MOVE'; }; }; (({alive _x} count (units _grp)) == 0) }; };
  3. try [] spawn { //your code here }; in init.sqf
  4. try this https://community.bistudio.com/wiki/switchMove
  5. hey maxi.. just logged in to say thanks. this was actually an idea i was thinking for a long time. it's nice to see someone else thought like me and made it happen :)
  6. I'd suggest using switch..do structure.. switch (_input) do { case 361 : {_hint = "good"}; default {_hint = "bad"}; }; if (_input isEqualTo "") exitWith {};
  7. i don't think "if" structure will work insine "waituntil". Try using if () then {}else{}; maybe? What is the expected outcome ?
  8. thanks for the reply! for anyone else wondering, the second code was almos 1.5 times faster .. (I'm also coding this on a core 2 duo so results may differ)
  9. try this maybe? https://community.bistudio.com/wiki/BIS_fnc_stalk (not tested)
  10. Greetings, I'm currently working on a code that runs for each spawned entity on the map so it should be the quickest. However I'm stuck between two desicions: First one uses less lines of code, but more private variables : switch _cond1 do { case 1: { _y = 1;_z = 3; }; case 2: { _y = 2;_z = 4; }; }; switch _cond2 do { case 1: { _c = 1; }; case 2: { _c = 3; }; }; _n = (_y*_z)+_c; The second one uses more lines of code, but no variables at all: _cond1,_cond2 call { if (_cond1 isEqualTo 1) exitWith { _cond2 call { if (_cond2 isEqualTo 1) exitWith {4}; }; _cond2) call { if (_cond2 isEqualTo 2) exitWith {6}; }; }; }; _cond1,_cond2 call { if (_cond1 isEqualTo 2) exitWith { _cond2 call { if (_cond2 isEqualTo 1) exitWith {7}; }; _cond2 call { if (_cond2 isEqualTo 2) exitWith {9}; }; }; };
  11. jazzraill

    AI Unit Side

    not sure if east units in west groups will be completely bug free though. instead you can spawn one dummy east unit, transform items of him to unit in west group, and have east looking west guy!
  12. from what i understand it's the same unit respawning in same position so, use the same variables again maybe.. ? (performance wise) also create a function like , fnc_unitSpawn = { sleep ((_this select 1)*4); if (!alive (_this select 0)) then { //deleteVehicle (_this select 0); sleep (_this select 1); _unit = (group (_this select 0)) createUnit [(typeOf (_this select 0)), ((getPos)_this select 0), [], (_this select 1), "FORM"]; _unit addEventHandler ["killed", {0 = [(_this select 0),5,"blackfish_1","Driver",helipad_2,15] call fnc_unitSpawn}]; _unit setSkill (skill(_this select 0)); _unit setRank (rank(_this select 0));//not sure this or above code will work _unit setPosATL ((getPos)_this select 0); _unit setVehicleVarName (vehicleVarName (_this select 0)); _unit setDir (getDir (_this select 0)); deleteVehicle (_this select 0); 0 = [_unit,(_this select 1),blackfish_1,Driver,helipad_2,15] execVM unit_getin.sqf; 0 = [_unit,(_this select 1),blackfish_1,Driver,helipad_2,(_this select 5)] execVM "unit_getin.sqf"; }; }; not tested btw
  13. jazzraill

    Init Line question..

    do you need to immobilize that unit again? if not, in init field _this spawn { _this enableSimulation false; waitUntil {sleep 0.2; /*your condition here*/}; _this enableSimulation true; };
  14. wow.. never thought of that. thanks man
  15. what im trying to do is : unit kills another unit -- eh fires unit moves victims position, --problems occur here grabs his gun, moves on after waitUntil {sleep 3;(((_this select 0) distance (_this select 1))< 5) }; it goes on like this; {(_this select 1) disableAI _x} forEach ["TARGET","MOVE","FSM"]; (_this select 1) playActionNow "Medic"; //Sleep 0.2; if (((currentWeapon (_this select 0))) in Lvl2Weapons ) then { (_this select 1) removeWeapon (primaryWeapon(_this select 1)); //remove magazine here (_this select 1) addWeapon (primaryWeapon (_this select 0)); (_this select 1) addmagazine (getArray(configFile >> "CfgWeapons" >> (primaryWeapon (_this select 1)) >> "magazines") select 0); }; {(_this select 1) enableAI _x} forEach ["TARGET","MOVE","FSM"]; (_this select 1) domove waypointPosition [group (_this select 1),1]; (_this select 0) removeAllEventHandlers "killed"; }]; the problem is if unit gets distracted when moving victims position, and goes somewhere else instead, waitUntil {sleep 3;(((_this select 0) distance (_this select 1))< 5) }; takes forever and script doesnt terminate
×