Jump to content

JohnKalo

Member
  • Content Count

    918
  • Joined

  • Last visited

  • Medals

Everything posted by JohnKalo

  1. A few months ago we started creating a campaign. And all is good. All apart from this one thing. The modules creating tasks take aboout 0,5 to 1 minute to be completed. Actually even a module unlocking a door took 0,5 to 1 minute to be activated. In short here is the description of the situation: 1.] We are talking about high end PCs. 2.] The mission does not lag. 3.] Triggers do not lag. 4.] Task modules lag up to a minute. The task completed panel appears 0,5 to 1 minute after completion to both the host and the clients. 5.] To the host even when the task appears to be completed, the tab showing "Task Completed" also lags. The clients have no such lag. 6.] Even modules unlocking a door lags up to a minute. 7.] A script showing text at the start of the mission lags only on the host. It is a script running through the initPlayerLocal.sqf so why? 8.] Testing modules while the map is empty has no lag. The lag takes place once the mission is in its final satges of development. 9.] We are talking about missions with intros, outros and much more. 10.] Sometimes I use safety triggers because the mission refuses to place playable units in vehicles. I just place the same trigger 2 or 3 times and all good... So up to episode 04 there was not an issue. The tasks did lag but cleverly I hidded that lag. In episode 04 however I cannot hide it. So for episode 04 and the next WHAT IS GOING ON??? Addons used: CBA, ASR AI3, Hellenic Armed Forces mod, Lythium Map, Vanilla DLCs
  2. @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!!!
  3. 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.
  4. 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 ^^^
  5. JohnKalo

    AI driving wrong with Jet

    You can then try this: https://community.bistudio.com/wiki/addWaypoint but that will lessen chances to 10% :)
  6. JohnKalo

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

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

    AI death win

    All AI dead condition can be tricky because if one AI runs away or gets stuck in a rock or in the ground then 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.
  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
  11. JohnKalo

    [SP/COOP-(1-8)] Miraculous Delivery

    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.
  12. @Grumpy Old Man Ok thanks! Just one question for now. Since it is an MP mission, I will place the code in the init.sqf and call it via a trigger (_runTasks = [] spawn GOM_fnc_linearTasks;) but what will I type in this param: _taskOwner = player; like blue0, blue1, blue2; or [blue0, blue1, blue2]; or something like players;?
  13. @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 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?
  14. JohnKalo

    A large scale milsim scenario

    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.
  15. 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.
  16. So after some events I have decided to enhance the intros in our MP WIP campaign. Due to that I need to play a video at the start of the mission. Trying this one did nothing: ["NameOfVideo.ogv", [10, 10]] remoteExec ["BIS_fnc_playVideo", [0,-2] select isDedicated, false]; trying the later showed the video nicely but not in fullscreen mode: ["NameOfVideo.ogv", [10, 10]] remoteExec ["BIS_fnc_titlecard", [0,-2] select isDedicated, false]; I tried changing the 640x560 resolution of the video and nothing changed. I came to the point where I changed whatever number I could find but still no full-screen. So is it possible to have the video in full-screen somehow? In the showcase there are missions showing images in full-screen so there should be something for the videos too. Plus with the BIS_fnc_titlecard function I would like to have a black screen after the video ends and not the first person view of the player. I tried the titleCut BLACK effect but nope, did not work. Is that possible too?
  17. JohnKalo

    Video Media Troubles

    @XianGrim Thanks! A clever idea indeed. Although I will have to make sure the video is shown to the players. I mean if you do not get close to a screen sometimes the images do not show so the videos should be about the same. I had found that thread but when I fill my screen with the video, in another screen with another resolution, will it there also be full-screen?
  18. You did not tell me to place it in a trigger. I replaced the code in the script with yours and I called it via a trigger. That did not work. So I will try to copy paste the whole thing in a trigger. By the way, I had decided to use the bis_fnc_infoText functions. But I said hey this guy spend time writing a script so I should try his too. Not moral to ditch a script you asked for just because you found another solution. So no I do not need a video.
  19. @pierremgi Ehmmmmm, it did not work. It said fn_infotext could not be found for some reason. I copy pasted from your post so I did not change anything. Oh, I discovered more bis_fnc_infoText functions that do not lag so I will use them. I will have to change the missions' intros logic but that is a motivation to enhance intros as a whole so .... why not?
  20. Thanks all for the help on the script! As it seems I will have to modernize the script if I am to have a fully workable and lag free solution. The other suggestions are also nice and I will also use them. I have some media to create and then I shall try them. @Dedmen Yep I know that other scripts do not lag because they play videos or bring effects in play. And it is also why it is a mystery that the task modules lag when triggers and scripts do not.
  21. In the thread you are talking about it is stated that you cannot make a single vehicle autonomous. The only thing possible is to use a a convoy with AI drivers present and such. So there is not something you cannot do. It is just stated that you can simply not do it. In the thread you posted at least
  22. So while I am recharging my Arma 3 editing batteries, the text script that lags only on the host is called via the initPlayerLocal.sqf like this: null = [["Defying the Odds","By GreekEditor","Day 4 - 7/22/2020"], 0.1, 10] execVM "infoText.sqf"; and it is this one: /*Install info: - place this .sqf file into your mission folder - see examples below for script calling syntax*/ /* File: infoText.sqf Author: Karel Moricky edited ver. by Feuerex (extended customization) Description: Info with some effect. Parameter(s): _this select 0: array of strings containing text. _this select 1: rate at which individual letters appear (0-99) _this select 2: pause after constructing the text until deconstructing it (0-99) _this select 3: X coordinates (0-1)*, optional _this select 4: Y coordinates (0-1)*, optional * values may differ for different screen resolutions. I recommend using SafeZone. Handle = [["Text", "Text(optional)", "Text(optional)"], individual letters rate, overall pause, X, Y] execVM "infoText.sqf"; examples: null = [["First line","Second line","Third line"], 0.01, 6] execVM "infoText.sqf"; text appears on it's default position (arguments for X, Y aren't used), stays for 6 seconds. null = [["First line","Second line","Third line"], 0.01, 5, 0.5,0.8] execVM "infoText.sqf"; text appears very quickly and then hangs for 5 seconds before it starts to disappear. null = [["Mission name","By: Author name","Date"], 0.03, 4, SafeZoneX, SafeZoneY/1.5] execVM "infoText.sqf"; text is appearing a bit more slowly and hangs for 4 seconds before disappearing. */ (["BIS_fnc_infoText"] call bis_fnc_rscLayer) cutRsc ["rscInfoText","plain"]; //---Parameters _text = _this select 0; _rate = _this select 1; _pause = _this select 2; //---Time related restrictions _minTime = 0; _maxTime = 99; if (_rate < _minTime || _rate > _maxTime) exitWith { ["InfoText - Time value out of range", _rate] call BIS_fnc_errorMsg}; //--- Separate lines _textArrayUnicode = []; {_textArrayUnicode = _textArrayUnicode + [toarray _x]} foreach _text; //--- Separate letters _textArrayLines = []; for "_i" from 0 to (count _textArrayUnicode - 1) do { _line = _textArrayUnicode select _i; _textArrayTemp = []; {_textArrayTemp = _textArrayTemp + [tostring [_x]]} foreach _line; _textArrayLines set [_i,_textArrayTemp]; }; //--- Merge arrays _textArray = []; _emptyArray = []; _nArrayTemp = []; _n = 0; { _line = _x; _textArray = _textArray + _line + ["\n"]; { //_emptyArray = _emptyArray + [_line call bis_fnc_selectrandom]; //--- Shuffled text //_emptyArray = _emptyArray + [str floor random 2]; //--- Binary Solo //_emptyArray = _emptyArray + [""]; //--- Rolling text _emptyArray = _emptyArray + [" "]; //--- Space _nArrayTemp = _nArrayTemp + [_n]; _n = _n + 1; } foreach _x; _n = _n + 1; _emptyArray = _emptyArray + ["\n"]; } foreach _textArrayLines; _finalArray = _emptyArray; _text = composetext _finalArray; //--- Random order _nArray = []; while {count _nArrayTemp > 0} do { _element = _nArrayTemp select (floor random (count _nArrayTemp)); _nArray = _nArray + [_element]; _nArrayTemp = _nArrayTemp - [_element]; }; //--- Visualization disableserialization; _display = uinamespace getvariable "BIS_InfoText"; _textControl = _display displayctrl 3101; _text = composetext _finalArray; _textControl ctrlsettext str _text; if (count _this > 4) then { _textControl ctrlsetPosition [_this select 3,_this select 4];}; _textControl ctrlcommit 0.01; sleep 1; { _finalArray set [_x,_textArray select _x]; _text = composetext _finalArray; _textControl ctrlsettext str _text; _textControl ctrlcommit 0.01; playsound "ReadoutClick"; //hintsilent str _text; if (random 1 > 0.9) then {sleep 0.1}; sleep _rate; } foreach _nArray; sleep _pause; //--- Fade away { _finalArray set [_x," "]; _text = composetext _finalArray; _textControl ctrlsettext str _text; _textControl ctrlcommit 0.01; //playsound "ReadoutClick"; //hintsilent str _text; //if (random 1 > 0.9) then {sleep 0.2}; sleep _rate; } foreach _nArray; ([] call bis_fnc_rscLayer) cuttext ["","plain"]; So far nobody could explain why the modules lag but maybe someone can explain why the above script lags on the host. Tested on two different host computers. Clients never lagged.
  23. JohnKalo

    [SP/COOP-(1-16)] Debatable Bravery

    Please note, this mission is no longer playable! That is due to the Greek Navy add-on been updated. All download links but the armaholic ones have been removed. The mission will be playable again once it is updated. Sadly however the version v2 of the Greek Navy add-on seems to have a variety of bugs especially in an MP environment. So until the add-on creators manage to solve those bugs there will be no update. Thanks for your understanding.
  24. JohnKalo

    GF Police and Siren Script

    Yep that's true. Have already got plans on how to use this script! In the long run however. I will still be on my essential Arma 3 editing break for a hopefully short while. In any case, you have just given the game what is was lacking for years. Add-on dependency free police units!
  25. JohnKalo

    GF Police and Siren Script

    Really nice work dude! Maybe you can place some lights on the front and back of the vehicles too. Like on their pumpers and such.
×