Jump to content

jazzraill

Member
  • Content Count

    24
  • Joined

  • Last visited

  • Medals

Everything posted by jazzraill

  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. 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}; }; }; };
  9. 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)
  10. try this maybe? https://community.bistudio.com/wiki/BIS_fnc_stalk (not tested)
  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. greetings. im working on a script which has to terminate when unit fires a weapon.. looking everywhere for hours, can't use fired eh because this line is in an eh already.. _EHkilledIdx = _this addEventHandler ["killed", { if (((_this select 0)==(_this select 1)) || (_this select 1) == player) exitwith {}; systemChat format ["%1 was killed by %2 from %3m with %4",(name (_this select 0)),(name (_this select 1)),((_this select 0)distance (_this select 1)),(parseText (getText (configFile >> "CfgWeapons" >> (currentWeapon (_this select 1)) >> "displayname")))]; _nearestEnemy = (_this select 1) findNearestEnemy (_this select 1); _isSafe = (((_this select 1) distance _nearestEnemy) > 35); waitUntil {sleep 10;_isSafe}; (_this select 1) doMove (getPos (_this select 0)); >> what im trying to do here:: if ((_this select 1) fires a weapon) exitwith {}; so that below waitUntil doesnt last forever waitUntil {sleep 3;(((_this select 0) distance (_this select 1))< 5) };
  16. 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
  17. hi fellow modders i'm working on a script that spawns units when player is near some kind of building, de-spawns when player is far and spawns again if player is near same kind of building again. here is my code : _groups_nato = []; x = true; fn_find_base = { _list = nearestObjects [player, _bases, 1000]; _base = _list call bis_fnc_selectrandom; _return = getpos _base; _return }; fn_spawn_nato = { if (count _groups_nato < 5) then { _pos = [] call fn_find_base; _grp = creategroup west; for "_i" from 1 to 3 do {"B_Soldier_F" createUnit [_pos, _grp];}; nul = [_grp, _pos] call BIS_fnc_taskdefend; _return = _grp; _return }; }; while {x} do { _grp = [] call fn_spawn_nato; _groups_nato = _groups_nato + [_grp]; _ldr = leader _grp; if ((_ldr) distance player > 1000) then { {deletevehicle _x} foreach units _grp; _groups_nato = _groups_nato - [_grp]; }; hint str _groups_nato; }; the spawning and de-spawning part of the script works, but it fails to spawn again when player is near same kind of buildings. any help will be appreciated.
  18. Hello everyone. I am trying to spawn units and some objects with trigger, then delete them when player leaves the trigger area (eg. 200x200) and re-spawn when entering again. what i am trying to do is to create a military bases around the map with camps/ tents and units patrolling but it costs a lot of fps. i would like to place units and objects in editor but they should spawn when player is in their activation trigger. then they should despawn if player leaves the area. sorry for bad english
  19. in chernarus sky and lighting is bugged for me and i get error "D3d device removed" after playing some time and ctd.
  20. jazzraill

    Heros Survive

    need help ! when i start the mission i get error "missing addons a3_soft_f_quadbike_01". anyone fix ?
  21. jazzraill

    Ravage

    im modding arma till it breaks thanks to this community
  22. jazzraill

    Ravage

    hello and thanks haleks and community for this awesome mod . i have but one question. i dont want bandits to hang around with fancy looking guns and i want to override theirs with lees and mp40s. its explained how to add more but not how to change. i tried this code but didnt worked : waitUntil {!isNil "rvg_gearlist"}; { 0 = rvg_mainWeapons set _x; } forEach ["CUP_srifle_LeeEnfield", "arifle_mas_mp40_o"]; any help will be appreciated
  23. jazzraill

    Ravage

    i still have radiation doesnt go away problem even with update. did i miss something ?
  24. jazzraill

    Ravage

    hey haleks its great work you do i want reduce amount of zeds what should i do please tell cheers
×