Jump to content


  • Content count

  • Joined

  • Last visited

  • Medals

Community Reputation

176 Excellent


About JohnKalo

  • Rank
    Master Sergeant

Profile Information

  1. Players Ready Condition

    I shall use this which I tested and worked: waitUntil {count allPlayers == count playableUnits + count switchableUnits};
  2. Players Ready Condition

    Ehm I took the solution as granted and so I moved on to create the media needed. (Not such a good idea ) Due to that, now that some of the media are ready to be implemented, the condition seems not to work. I tested it by placing it in the initPlayerLocal.sqf of a mission and it reported an expression error. Using this seemed to fix it: waitUntil {count allPlayers == count playableUnits + count switchableUnits}; but does it do the same thing?
  3. Destroying a Vehicle Part

    It is run via a trigger sometime in-game. As far as I am aware, triggers are applied to the host and to the clients so do I need the remoteExec? If yes I will use it. Thanks.
  4. Video From TV/Laptop/Screen

  5. Destroying a Vehicle Part

    Thanks! The above will do the trick. Just checked FurYouS thread out. Seems like a cool mission. Can't test it since I do not use CUP.
  6. Main & Secondary Tasks

    Here you go:
  7. So what I need is to destroy the engine of a vehicle so as to make it unable to move. This must be kinda simple but hard to find. So I did my research and found the: vehicle player setHit ["motor", 1]; which did not work because of the name of the part that needed to be destroyed. Trying to find how to figure the name of a vehicle's part was to no avail. So I then searched some more and found this: myTank setHit [getText (configfile >> "CfgVehicles" >> typeOf myTank >> "HitPoints" >> "HitRTrack" >> "name"), 1]; which was not for the engine but turning it into this: myTank setHit [getText (configfile >> "CfgVehicles" >> typeOf myTank >> "HitPoints" >> "HitEngine" >> "name"), 1]; made it work. However does the above work in an MP environment or just in the editor? Because in a server I do not know what goes on with config files and such. Trying to figure the name of the part like this did not work: hint "getText (configfile >> "CfgVehicles" >> typeOf myTank >> "HitPoints" >> "HitRTrack" >> "name")"; trying to follow the above path was impossible since in the config file there was no HitPoints tab. Guessing the vehicle's part name with "motor", "engine", "machine" and "damnyou" did not work either. So how can you find a vehicle's part name in general? I suppose other people are looking for that answer as well.
  8. @Dedmen So I placed everything you posted in the script and some errors were encountered. However since I new what part of the script causes lag I now had a way to fight! So I started erasing everything that seemed excessive. It did not work at first because some lines were needed although they seemed fine to remove. After a few more sophisticated attempts however I managed to erase whatever parameter I could and success! Everything worked well and most importantly the task lag was gone!!!!! There even was an increase in the fps entirely. Thought I had changed the mouse's sensitivity but nope ... it was an fps increase! Thanks!!!
  9. Thanks, I will try everything you posted! The script when run causes the modules to lag. As you said, maybe the no sleep script is then one causing the issue.
  10. So I followed the thread's advise and I found the culprit! In the new mission I am making I firstly entered the tasks and then I tried placing everything else. Once I placed this one script the tasks started to lag. It is a script I activate via eaches unit init line like this: guard = [this] execVM "HousePatrol.sqf" and the script which is not mine is this one: /*=========================================================================================== Random House Patrol Script v2.2 for Arma 3 by Tophe of Östgöta Ops [OOPS] Contact & bugreport: BIS forums ============================================================================================= HOW TO USE: Place unit close to a house and put this in the init field: guard = [this] execVM "HousePatrol.sqf" OPTIONAL SETTINGS: guard = [this, MODE, STAND TIME, EXCLUDED POS, STARTING POS, DEBUG] execVM "HousePatrol.sqf" * BEHAVIOUR - set unit behaviour. guard = [this,"COMBAT"] execVM "HousePatrol.sqf" Options: CARELESS, SAFE, AWARE, COMBAT, STEALTH Default: SAFE * STAND TIME - Set maximum amount of seconds the unit will wait before moving to next waypoint. guard = [this,"SAFE",50] execVM "HousePatrol.sqf" Options: Any value in seconds. 0 = continuous patrol. Default: 30 * EXCLUDED POSITIONS - exclude certain building positions from patrol route. guard = [this,"SAFE",30, [5,4]] execVM "HousePatrol.sqf" Options: Array of building positions Default: [] (no excluded positions) * STARTING POS - Some building positions doesn't work well will the setPos command. Here you may add a custom starting pos. Negative number means starting pos will be randomized. guard = [this,"SAFE",30, [5,4], 2] execVM "HousePatrol.sqf" Options: Any available building position Default: -1 (random) * STANCE - Tell the unit what stance to use. To keep the unit from going prone you can set this to MIDDLE or UP. AUTO will be the standard behaviour and unit will crawl around in combat mode. HIGH is the default mode. This is like AUTO but prone position is excluded. Options: UP, DOWN, MIDDLE, AUTO, HIGH Default: HIGH * DEBUG - Use markers and chatlog for mission design debugging. guard = [this,"SAFE",30, [], -1, true] execVM "HousePatrol.sqf" Options: true/false Default: false ===========================================================================================*/ if (!isServer) exitWith {}; sleep random 1; // Set variables _unit = _this select 0; _behaviour = if (count _this > 1) then {toUpper(_this select 1)} else {"SAFE"}; _maxWaitTime = if (count _this > 2) then {_this select 2} else {30}; _excludedPositions = if (count _this > 3) then {_this select 3} else {[]}; _startingPos = if (count _this > 4) then {_this select 4} else {-1}; _stance = if (count _this > 5) then {toUpper(_this select 5)} else {"HIGH"}; _debug = if (count _this > 6) then {_this select 6} else {false}; _position = getPos _unit; _house = nearestBuilding _unit; _numOfBuildingPos = 0; _currentBuildingPos = 0; _lastBuildingPos = 0; _waitTime = 0; _timeout = 0; _behaviours = ["CARELESS", "SAFE", "AWARE", "COMBAT", "STEALTH"]; _stances = ["UP", "DOWN", "MIDDLE", "AUTO", "HIGH"]; _name = vehicleVarName _unit; if (isNil _name) then { _name = format["Guard x%1y%2", floor (_position select 0), floor (_position select 1)] }; // Set behaviour of unit if (_behaviour in _behaviours) then { _unit setBehaviour _behaviour; } else { _unit setBehaviour "SAFE"; }; // Set unit stance if (_stance == "HIGH") then { _stanceCheck = { _unit = _this select 0; while {alive _unit} do { if (unitPos _unit == "DOWN") then { if (random 1 < 0.5) then {_unit setUnitPos "MIDDLE"} else {_unit setUnitPos "UP"}; sleep random 5; _unit setUnitPos "AUTO"; }; }; }; [_unit] spawn _stanceCheck; } else { if (_stance in _stances) then { _unit setUnitPos _stance; } else { _unit setBehaviour "UP"; }; }; // Find number of positions in building while {format ["%1", _house buildingPos _numOfBuildingPos] != "[0,0,0]"} do { _numOfBuildingPos = _numOfBuildingPos + 1; }; // DEBUGGING - Mark house on map, mark building positions ingame, broadcast information if (_debug) then { for [{_i = 0}, {_i <= _numOfBuildingPos}, {_i = _i + 1}] do { if (!(_i in _excludedPositions)) then { _arrow = "Sign_Arrow_F" createVehicle (_house buildingPos _i); _arrow setPos (_house buildingpos _i); }; }; player globalChat format["%1 - Number of available positions: %2", _name, _numOfBuildingPos]; if (count _excludedPositions > 0) then { player globalChat format["%1 - Excluded positions: %2", _name, _excludedPositions]; }; _marker = createMarker [_name, position _unit]; _marker setMarkerType "mil_dot"; _marker setMarkerText _name; _marker setMarkerColor "ColorGreen"; }; // Put unit at random starting pos. while {_startingPos in _excludedPositions || _startingPos < 0} do { _startingPos = floor(random _numOfBuildingPos); }; if (_startingPos > _numOfBuildingPos - 1) then { _startingPos = _numOfBuildingPos - 1 }; if (_numOfBuildingPos > 0) then { _unit setPos (_house buildingPos _startingPos); _unit setPos (getPos _unit); }; // DEBUGGING - broadcast starting position if (_debug) then { player globalChat format["%1 - starting at building pos %2", _name, _startingPos] }; // Have unit patrol inside house while {alive _unit && (_numOfBuildingPos - count _excludedPositions) > 0} do { if (_numOfBuildingPos < 2) exitWith {}; while {_lastBuildingPos == _currentBuildingPos || _currentBuildingPos in _excludedPositions} do { _currentBuildingPos = floor(random _numOfBuildingPos); }; _waitTime = floor(random _maxWaitTime); _unit doMove (_house buildingPos _currentBuildingPos); _unit moveTo (_house buildingPos _currentBuildingPos); sleep 0.5; _timeout = time + 50; waitUntil {moveToCompleted _unit || moveToFailed _unit || !alive _unit || _timeout < time}; if (_timeout < time) then {_unit setPos (_house buildingPos _currentBuildingPos)}; // DEBUGGING - move marker to new position if (_debug) then { _name setMarkerPos position _unit; _text = format["%1: moving to pos %2", _name, _currentBuildingPos]; _name setMarkerText _text; }; sleep _waitTime; _lastBuildingPos = _currentBuildingPos; }; // DEBUGGING - Change marker color if script ends if (_debug) then { player globalChat format["%1 - ended house patrol loop", _name]; _name setMarkerColor "ColorRed"; }; Sadly the person who created the script has months to log in to the forums so I cannot ask him directly. So is there something I can do about this? In the script's thread nobody said anything about lag. Tried placing the script into a spoilers tab but it erased the whole thing. So I just added it like ^^^
  11. AI driving wrong with Jet

    You can then try this: https://community.bistudio.com/wiki/addWaypoint but that will lessen chances to 10% :)
  12. Players Ready Condition

    Thanks, @davidoss Seems like a nice solution but the other one seems simpler @pierremgi The AI units are not disabled so I will use this: waitUntil {count allPlayers == count playableUnits + switchableUnits}; I suppose it works even if all playable slots are used by players. I will place the above in the initPlayerLocal.sqf and afterwards the intro commands will follow.
  13. I have a mission intro set but since it is an SP/MP mission there is a problem. I would like the intro video to start playing once all players are ready and have started the mission. In other words, all players to start seeing the video at the same time. So is there some condition I can use? SP and MP compatible.
  14. GF Police and Siren Script

    Yep, it looks really nice! Although I have not seen any such police car around. Maybe they have them stored in a garage because spare parts are expensive. Lol Not that you can often see police cars in general. They kinda only come to protect politicians. Like a PMC...
  15. @Grumpy Old Man Yep, that animation is the one lagging. I also use sleep 5 normally but in this case it does not delay anything. It shows task completed and then task assigned almost immediately. Without waiting for the first animation to be over. It did that one with the modules too. Maybe it is because the animation showing task completed lags while the animation showing new task assigned does not as much. Not making much sense since the animation lag is not 5 seconds! And I should point out that the task animation lagging only happened on the host and not on the clients. What is that scheduler thing? Plus only one text function lags. The others do not and so I use them. And in general, after replacing all the triggers and modules and syncing with the script generated task, the mission seems to be optimized too. It goes even smoother. I might even replace all campaign missions task modules with the script ones. Will take time but I believe it is worth the while.