![](https://forums.bohemia.net/uploads/set_resources_8/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
![](https://secure.gravatar.com/avatar/ed5f2874dda59e717d9bb1f8cdc21d3e?d=https://forums.bohemia.net/uploads/set_resources_8/84c1e40ea0e759e3f1505eb1788ddf3c_default_photo.png)
jazzraill
Member-
Content Count
24 -
Joined
-
Last visited
-
Medals
Community Reputation
3 NeutralAbout jazzraill
-
Rank
Private First Class
Recent Profile Visitors
-
How to apply mud/scratch texture to vehicle using .smdi?
jazzraill posted a topic in ARMA 3 - MODELLING - (O2)
title is self-explanatory. I'm looking for ways to apply mud/scratch textures into texture by using smdi -
Modify Hunt_players_fnc
jazzraill replied to Soapbox0331's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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) }; }; -
How to apply this with a sleep and loop?
jazzraill replied to redarmy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
try [] spawn { //your code here }; in init.sqf -
AI animation : lean left right like player's QE animation
jazzraill replied to PaladinMAX's topic in ARMA 3 - MISSION EDITING & SCRIPTING
try this https://community.bistudio.com/wiki/switchMove -
a2ata3 ArmA 2 Animations To ArmA 3 - A2ATA3
jazzraill replied to maximilionus's topic in ARMA 3 - ADDONS & MODS: COMPLETE
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 :) -
"IF" command with several results
jazzraill replied to Dj Rolnik's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'd suggest using switch..do structure.. switch (_input) do { case 361 : {_hint = "good"}; default {_hint = "bad"}; }; if (_input isEqualTo "") exitWith {}; -
"IF" command with several results
jazzraill replied to Dj Rolnik's topic in ARMA 3 - MISSION EDITING & SCRIPTING
i don't think "if" structure will work insine "waituntil". Try using if () then {}else{}; maybe? What is the expected outcome ? -
Less Code & More Variables VS More Code & Less Variables
jazzraill replied to jazzraill's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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) -
Dynamic Waypoint and Dogfighter
jazzraill replied to sguedes's topic in ARMA 3 - MISSION EDITING & SCRIPTING
try this maybe? https://community.bistudio.com/wiki/BIS_fnc_stalk (not tested) -
jazzraill started following Less Code & More Variables VS More Code & Less Variables
-
Less Code & More Variables VS More Code & Less Variables
jazzraill posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
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}; }; }; }; -
jazzraill started following ARMA 3 - MISSION EDITING & SCRIPTING
-
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!
-
multiple commands in createUnit init field
jazzraill replied to feldmaus's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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- 11 replies
-
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; };
-
if (unit fires a weapon) exitwith {}
jazzraill replied to jazzraill's topic in ARMA 3 - MISSION EDITING & SCRIPTING
wow.. never thought of that. thanks man -
if (unit fires a weapon) exitwith {}
jazzraill replied to jazzraill's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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