mosesuk
Member-
Content Count
4 -
Joined
-
Last visited
-
Medals
Everything posted by mosesuk
-
Show objects for selected units only?
mosesuk posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I've been having trouble getting my script to function in the desired manner, and after much trial, and mostly error or improper functionality, I've driven myself mad. I want to create a 'trail' behind all non-dog units, the dog's should also be the only unit that can actually see these trails. The idea is to allow Dog's to effectively 'track' players, the script will be used in multiplayer. I can't seem to get things straight in my head anymore, so if anyone could help me get this working properly, it would be GREATLY appreciated. ---------- Post added at 23:32 ---------- Previous post was at 23:31 ---------- The script so far can be found on GitHub here. -
Show objects for selected units only?
mosesuk replied to mosesuk's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Anyone got a solution for me? I've thinned out the code a little, to make it a little more readable. trail_interval = 2; while {TRUE} do { if (isNil "trail_points") then {trail_points=[];}; if (isNil "trail_maxPoints") then {trail_maxPoints = 200;}; _player = (vehicle player); _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; _inWater = ((surfaceIsWater (position player)) || (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "swimming")) == 1); _isMoving = (speed _player > 0.1 || speed _player < -4); _inVehicle = (_player != player); _isDog = (_player isKindOf "Pastor" || _player isKindOf "Fin"); _trailPoint = objNull; if(_isMoving && !_inWater && !_onLadder && !_inVehicle) then { trail_zAxis = ((getPosATL _player) select 2); if (trail_zAxis < 0) then {trail_zAxis = 0;}; trail_object = "Sign_sphere10cm_EP1"; { _xDog = (_x isKindOf "Pastor" || _x isKindOf "Fin"); if (_xDog) then { _pos = (position _player); _trailPoint = trail_object createVehicleLocal [(_pos select 0), (_pos select 1), -2]; _trailPoint setPos [(_pos select 0), (_pos select 1), trail_zAxis]; }; } forEach (playableUnits); _trailPoint hideObject true; trail_points = (trail_points + [_trailPoint]) - [objNull]; if (count trail_points > trail_maxPoints) then { deleteVehicle (trail_points select 0); trail_points = trail_points - [(trail_points select 0)]; }; }; sleep trail_interval; }; -
Show objects for selected units only?
mosesuk replied to mosesuk's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Any undefined variables are defined in the config.sqf which can be found on github. The script produces no script errors. -
Show objects for selected units only?
mosesuk replied to mosesuk's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Really? On which line did you spot an issue? I didn't think I had any sintax issues.