Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Posts posted by JohnKalo

  1. Just searched in the forums a little more and it said BI has set the speed limit when sling-loading to about 100 kph. You can just tell the AI to sling-load something and you shall see the speed. 200 as reported above is possible but is by no means realistic. It should be an advanced flight model glitch.

  2. Well if you are working with modules you should have a create task module and a set task state module. For two possible endings for a task you can sync two set task state modules to the create task one. The set task state module should be then synced with a trigger. The one for mission complete should be with the !alive nameofconvoyvehicle and the other one should be with a trigger which will be synced with the vehicle of the convoy. Set an area for that trigger and if the vehicle gets in the trigger area it will activate the other set task state module which will fail the task.


    If you are working with a script you can use the distance command:


    nameofconvoyvehicle distance markerwheretheconvoyshouldgo <50;

    In general I have been using modules but scripts are indeed a better way. They have their cons but they remain better. That is why I am remaking my campaign missions. One of the major changes is module tasks turned to script ones.


    Oh and there are many tutorials out there, so you might be able to find your answers on you-tube for this or for any other troubling of yours. If there is nothing there then ... forums!

    • Like 3

  3. I cannot remember the speed limit for choppers when sling-loading but even 80-90 kph seems much for heavy cargo situations. 


    That is because of increased momentum which is mass x velocity. Increasing speed increases momentum and due to that whatever movement you make can be dangerous. Like it happens with ships. In order for a tanker to stop it takes a lot of time even if it travels at low speeds. That is because of its huge mass. In that case even if you want to turn or go backwards because of an iceberg or anything alike you are anyways doomed. 


    It is hard to explain because of translations :thumbsup:

  4. Ehm I took the solution as granted and so I moved on to create the media needed. (Not such a good idea :scratchchin:) 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? 

  5. 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.

  6. @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!!!

  7. 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
    Place unit close to a house and put this in the init field:  
    guard = [this] execVM "HousePatrol.sqf"
    guard = [this, MODE, STAND TIME, EXCLUDED POS, STARTING POS, DEBUG] execVM "HousePatrol.sqf"
    * BEHAVIOUR - set unit behaviour.
        guard = [this,"COMBAT"] execVM "HousePatrol.sqf"
        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;
        _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;
        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 ^^^

    • Like 1

  8. @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.

  9. All AI dead condition can be tricky because if one AI runs away or gets stuck in a rock or in the ground then         :smash:




    So, maybe you can try this one:


    east countSide thislist <= 5


    set in the condition of a trigger. If 5 or lesser east units remain in the trigger area then you can have "whatever" activation you want.

    • Like 2

  10. @Grumpy Old Man Just to post the results:


    I used the mission of yours and a few wiki Arma pages and I managed to make all tasks via a script called through the initPlayerLocal.sqf. The results were that tasks' lag still existed. Before it was about a minute. Now it is 1-2 seconds!!! The tasks location does not lag at all. Only the screen showing task assigned or task succeeded and such lags. On my end and I am on a laptop so it might not lag at all when on a computer. Now if it is MP compatible? Well where it said player I used west as stated in the wiki so it should be.


    As for the text, using the bis text functions meant no lag!!! And here is the weird thing. The bis function showing the letters to appear one by one lags like it does in the script while the other text functions do not lag. Whatevs. Issue overridden :thumbsup: 

    • Like 1

  11. Please note along with the mission Debatable Bravery this mission is also for now unplayable. That is because of the Hellenic Navy Addon having being updated. Once I am able to update this mission it will again be playable. I am slowly starting to work on the WIP Campaign so the update might not take place till Christmas.

    • Like 1

  12.  @Grumpy Old Man

    • I use 3 triggers instead of one only in one incident. It is the trigger which places all units in a plane at the start of the mission. For some reason if there are not 2 or 3 triggers some units stay out of the plane and the whole mission ends before it starts.
    • Nope, no other similar practices. 
    • Yep, that can be done. For the next mission :) Cannot build this one again since I will anyways build more missions. Although in general the more I advance the mission the more the modules lag. Triggers do not lag at all. And it is not just the task modules. A module unlocking a simple door lags too  :scratchchin:


    Maybe I should try using script generated tasks and not modules to see if those lag. Hard since the mission is all set but it would be nice to see if the script tasks lag. And most online tutorials are for using modules. I found an example but the thread is all in german. I do not know so many german so can you please send me an MP example in scripting tasks?



  13. As lexx mentioned people tend not to read short briefings, let alone extended ones. I will not stick there however.


    You have many hours in the eden editor but you use Zeus. It is relatively easy to use Zeus so as to tell the AI what to do. Not using Zeus but way-points and scripts in an MP environment is a masochistic process. Many things can go wrong although they should not. A mission working on your end might not work on another person's PC. There are loads of things to consider. You do indeed need to start small and then go big. Understand how many glitches and bugs await to be dealt with if they can be dealt with and then go big.


    And in general thinking about an epic milsim mission is easy. Putting it together however is maybe too hard.

  14. By placing it all in a trigger it indeed worked. The lag however although slightly less was there . It still lagged when the bis_fnc_infoText function does not for some reason.


    About the mission tasks lagging it is indeed true that that mission has a few more scripts than the others but they are only called at certain times and for a certain and limited amount of time. It is scripts which give effects like explosions and such. The number of AI units is the same or even lesser than the other missions. So although most AI units follow scripts so as to patrol even when they are stationed in houses, there should not be an issue. Maybe because the units are in one BIG town and not in different villages. Even then the tasks lagging cannot be fixed.