Jump to content

Search the Community

Showing results for tags 'waituntil'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • BOHEMIA INTERACTIVE
    • BOHEMIA INTERACTIVE - NEWS
    • BOHEMIA INTERACTIVE - JOBS
    • BOHEMIA INTERACTIVE - GENERAL
  • FEATURED GAMES
    • Vigor
    • DAYZ
    • ARMA 3
    • ARMA 2
    • YLANDS
  • MOBILE GAMES
    • ARMA MOBILE OPS
    • MINIDAYZ
    • ARMA TACTICS
    • ARMA 2 FIRING RANGE
  • BI MILITARY GAMES FORUMS
  • BOHEMIA INCUBATOR
    • PROJECT LUCIE
  • OTHER BOHEMIA GAMES
    • ARGO
    • TAKE ON MARS
    • TAKE ON HELICOPTERS
    • CARRIER COMMAND: GAEA MISSION
    • ARMA: ARMED ASSAULT / COMBAT OPERATIONS
    • ARMA: COLD WAR ASSAULT / OPERATION FLASHPOINT
    • IRON FRONT: LIBERATION 1944
    • BACK CATALOGUE
  • OFFTOPIC
    • OFFTOPIC
  • Die Hard OFP Lovers' Club's Topics
  • ArmA Toolmakers's Releases
  • ArmA Toolmakers's General
  • Japan in Arma's Topics
  • Arma 3 Photography Club's Discussions
  • The Order Of the Wolfs- Unit's Topics
  • 4th Infantry Brigade's Recruitment
  • 11th Marine Expeditionary Unit OFFICIAL | 11th MEU(SOC)'s 11th MEU(SOC) Recruitment Status - OPEN
  • Legion latina semper fi's New Server Legion latina next wick
  • Legion latina semper fi's https://www.facebook.com/groups/legionlatinasemperfidelis/
  • Legion latina semper fi's Server VPN LEGION LATINA SEMPER FI
  • Team Nederland's Welkom bij ons club
  • Team Nederland's Facebook
  • [H.S.O.] Hellenic Special Operations's Infos
  • BI Forum Ravage Club's Forum Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber (xmpp)


Skype


Biography


Twitter


Google+


Youtube


Vimeo


Xfire


Steam url id


Raptr


MySpace


Linkedin


Tumblr


Flickr


XBOX Live


PlayStation PSN


Origin


PlayFire


SoundCloud


Pinterest


Reddit


Twitch.Tv


Ustream.Tv


Duxter


Instagram


Location


Interests


Interests


Occupation

Found 11 results

  1. Hiho Gentlemen, for the past weeks I have been looking into improving the FPS impact my Vandeanson's Apocalypse mod has on missions. What does the mod do? (all the below happens server side only, fyi) 1. []spawn "Position finder function": find well suiting locations to spawn sites of interest (small sized composition of structures, things and AI, e.g. a banditcamp) based on a random players location 2. []spawn "Site spawner function":mark that location (as set in #1.) and starts "waituntil {code to check for condition}" with condition that ANY player gets close to the site 3. create the site, enable dynamic simulation, start despawn timer 4.a [] "spawn hideobjectglobal function" that will hide the objects of a site once no player is near that site, but the despawn timer (item. 5 below) has not run out yet 4.b [] "spawn un-hideobjectglobal function" that will UNhide the objects of a site if a player is near again 5. wait for despawn timer to run out (minimum up-time of a site) 6. start "waituntil {code to check for condition}" with condition that no player is near the site 7. delete the site/AI 8. start at #1. I hope its somehow recognizable, that this should allow for a dynamic environement, with least possible performance impact due to the "waituntil" gating. Sites are only up if really needed e.g. a player is nearby to actually see the site. If the sites and AI are spawned, dynamic simulation is enabled. The performance gains compared to previous versions (where assets where spawned in and FPS was only saved by dyn. simulation) are already quite considerable. The performance saving actions happen through distance checks, waituntil, dynamic simulation, hideobjectglobal and despawn of sites that are no longer needed (e.g. noone within 4k meters proxy) However, the question that is bugging me currently is about the performance impact of having multiple (possibly 100+) waituntil and spawn threads up sametime. waituntil: the mod spawns about 10 type of sites, each sites may be spawned up to 10 times. Each creates an own "waituntil" thread. I seem to understand that these waituntils are continuisly eating up performance until the "condition" is met. Until then, the condition is checked every frame. In my case, these are way to many "check" iterations than needed. A check every 5 seconds is fine as well. Hence I changed the waituntil to waituntil {sleep 5; ...code..}; Question: am I correct that this shold have a "considerable" positive impact on performance of waituntil usage? I got this from forum posts so it should atleast have some hand and feets. [] spawns: most functions need to be spawned in a separate thread, I can not use "call" as the calling script can not be halted until the function returns true and since suspension (waituntil) is not allowed for called functions. Where i can use "call", i do that. Hence, in additiona to a lot of waituntils, I also have multiple spawn threads run more or less complex code sametime. I believe that if i put in sleep timers between each bulk of complex code that should help with performance (e.g. first all bandit camps are spawned, then the next site may start to spawn in). Question: this, if the sleep timers are set right, should put additional ease on cpu. Correct? Also, if I place small sleep timers throughtout spawned code, I should ease possible stutters/lags when spawning stuff. I could also add condition checks (uff, more waituntils) between major functions spawns, that only return true once the previous site/code bulk is done. I hope it is somehow understandable what I am trying to do and what the challenges are that I am worried about. A playable test version of the mod can be found here FYI: (it does not include ALL of the performance saving actions yet, but it should give you a fair picture). Why this post? I would like to understand if: - my thought process is correct - if the issues I am looking into are actual issues worth looking into - if more experienced people would take a similar approach or if I am missing knowledge and the issue could be taken on in better ways. The changes I made already show positive results, but I am sure that there are things that I dont know yet. The above conclusions are based on the last 2 years of coding various projects and reading up various topics online (KK's blog, forum posts, code optimisation guides...) I have no professional coding background, hence I might lack basic knowledge. End of wall of text. I appreciate any feedback, input, source of information and so on that I can get;) Thanks! Cheers VD
  2. Hello everyone. I have a script that I need to run on each frame. The problem is, it can get too heavy sometimes (it runs some code for each element of an array, and if the array gets too big, the code gets slow), enough to reach 1 ms or longer execution time in code performance. I think I read somewhere that codes that run in scheduled environment (such as those called by waitUntil) have a time limit of 3 ms before being stopped by the engine. What is the best way of balancing performance and making sure the code is executed correctly? 1. Using onEachFrame stacked EH 2. Using Draw3d mission EH 3. Using waitUntil (without sleep) I think the first two methods won't get interrupted if the execution time exceeds 3 ms. But it might also mean that the code will slow down the mission even more. I have tested all three methods but they all appear more or less the same. I'd appreciate any help with this.
  3. Hello, I wonder if is there a way of getting out of a waitUntil loop in the case when a script is remoteExec on the server in the init.sqf with player passed as argument and when the player disconnect from the server? I see on my linux server'screen when i disconnect from the server the error " Client: Remote object 4:0 not found " and the diag_log message continuing emmiting each second so the script never end. //init.sqf if (hasInterface) then { waitUntil {!isNull player}; [[player], "test.sqf"] remoteExec ["execVM", 2]; }; // test.sqf params ["_player"]; while {!isNull _player} do { waitUntil { diag_log "!!!!In waitUntil loop!!!!"; sleep 1; /*(condition code)*/ or isNull _player }; if (isNull _player) exitWith {}; //code... // // };
  4. So my script starts like this: _Join_East = creategroup EAST; call { _changing = allUnits select {(side _x isEqualTo civilian) && (!isPlayer _x) && (_x distance player < 100)}; _changing apply { units _x joinSilent _Join_East; [_Join_East, _Pos_1] call BIS_fnc_taskAttack; // Now all nearby Ai civilians turn hostile to the player! And that works like a charm! What I need is to put this two waitUntil conditions into a single waitUntil with an OR. waitUntil {sleep 1; ({alive _x} count units _Join_East) < 3;}; waitUntil {sleep 1; player distance units _Join_East > 500}; I can't seem to get both to work in an OR format. The final result should be: waitUntil { (The _Join_East group has less than 3 units) OR (The player got 500 meters away from the units in the _Join_East group). Thanks in advanced!
  5. Hi. I was wondering which one of these two commands has a bigger effect on performance: waitUntil { !cond }; or while {cond} do { sleep 0.5; }; Also, does the amount of sleep time matter? What about the condition? For example, if we have to check a series of conditions (e.g {alive _x} foreach Allunits) which one is better?
  6. Hello c",) first of love this forum, it has really helped me a lot ! . . . well over to my first post in here. Or this is more of a question; how do i get a chopper to wait untill it has been fully loaded before take off?.. "i meen not like if player is in, or if a spesific group is in. I only want a line to make the chopper wait untill every seat is full, or no more space in cargo." Maybe somthing like: waitUntil {heli is full} AND {!isNull player}; or waitUntil {heli fullcargo} AND {!isNull player}; Please help me you see i have made a mission where you must contact, rescue and finally load rescued civilian units on to a waiting chopper. "i started with a dream to count the rescued units onboard the heli, and then give score fore each. But seeing as this was a bit over my skill level i choose to have it only take of when fully loaded and the give a static score. I am using simple shop by HoverGuy i was hoping to give money for each rescued civilian loaded." Hope you are the right person to help me, i have really searched everywhere . . . Best regards RotaMafia.
  7. hello! i got a huge doubt about waituntil and sleep...here is an example (while (true) its not relevant, i just put it to better give the idea of a looping code): while {true} do { waitUntil {sleep 600;{alive _x} count allPlayers isEqualTo 0}; }; this looping code will wait 600 seconds for 1 single time and then check in loop every 0.5 seconds the "alive players" condition? OR the looping code will wait 600 seconds, check the "alive players" condition, then wait 600 seconds, then check "alive players" condition and so on ? if my ultimate goal is to check a condition every 600 seconds, what i should do ? thanks guys!
  8. I am executing this code in a .sqf using execVM via a trigger, but waitUntil isn't working. That is, after _cnt == 0 (after I kill all the units in the _ambushers group), the script does not continue. However, if after killing _ambushers, if I reexecute the script via the debug console in-game, then it seems to work just fine - it skips the first titleText and goes right into the code below waitUntil {_cnt == 0}. But the whole point of waitUntil is to NOT have to reexecute anything. What gives? Is it a waitUntil issue, or a count issue? What am I doing wrong? _ambushers = group ambusher; _cnt = count units _ambushers; if (_cnt > 0) then { titleText ["CREWMAN: TOOK YOU LONG ENOUGH! SHOOT THEM!", "PLAIN DOWN", 4]; titleFadeOut 1; }; waitUntil {_cnt == 0}; sleep 2; if (alive crewman) then { toolkitbox addItemCargo ["Toolkit",1]; titleText ["CREWMAN: Whew! Thanks for your help, guys.", "PLAIN DOWN", 4]; titleFadeOut 1; sleep 6; titleText ["CREWMAN: There is a repair kit in my equipment box. Take it for your truck. Just in case.", "PLAIN DOWN", 4]; titleFadeOut 1; sleep 6; ["tsk03","SUCCEEDED"] call BIS_fnc_taskSetState; sleep 3; ["tsk02b","ASSIGNED"] call BIS_fnc_taskSetState; } else { titleText ["PLAYER: He's dead. Looks like we failed.", "PLAIN DOWN", 4]; titleFadeOut 1; sleep 6; ["tsk03","FAILED"] call BIS_fnc_taskSetState; sleep 3; ["tsk02b","ASSIGNED"] call BIS_fnc_taskSetState; };
  9. I want to make a trigger which execVM an sqf file and wait until it finishes. But every time it gives me an error or it doesn't wait at all. I tried: myhandle = [] execVM "test.sqf"; waitUntil { scriptDone myhandle }; and it gave me this: waitUntil { |#|scriptDone my.. Generic error in expression also tried: myhandle = [] execVM "test.sqf"; null = [] spawn { waitUntil { scriptDone myhandle }}; then it does not wait at all. The trigger activates before the sqf finish. Inside the sqf, there is a variable at the end: test_sqf_running = nil I also tried: [] execVM "test.sqf"; waitUntil { sleep 1; isNil "test_sqf_running" }; and this happened: waitUntil { |#|sleep 1; is... Generic error in expression. also tried with spawn and it activates before the sql finish. Where is it wrong?
  10. Okey, i dont know if this has been up before, i couldnt find anything. iam trying to check if a marker has changed color.. it is for using EOS with tasks. MapClickEOS_Patrol = { // Create EOS Zone _Size = _this select 0; _groups = _this select 1; _grpSize = _this select 2; _Pos = _this select 3; // Create Marker Zone _m = createMarker [format ["Patrol%1", Random 1000],_pos]; _m setMarkerShape "ELLIPSE"; _m setMarkerSize [_size,_size]; _m setMarkerBrush "Solid"; _m setMarkerColor "ColorRed"; // Close map titletext ["Zone Created",""]; // Create EOS Zone null = [[_m],[0,0],[_groups,_grpSize,100],[0,0],[0],[0],[0,0],[5,0,300,EAST,TRUE]] call EOS_Spawn; sleep 5; waitUntil {sleep 5; getMarkerColor _m == "ColorGreen"}; hint "Area CLEAR"; }; i get expression error no matter what i do :( i know its probably something small but i cant figure it out, everything works as it should except the waituntil....
  11. Hi folks I've got an issue with trying to write a script that lets me keep doing an action until the point where I don't want to do the action any longer. A player has a camera in their gear. When they want to take a photo, the script fires up. The script makes them put away their current weapon, and an image of the back of a camera pops up on their screen. picture sharing Now the bit that has me stumped. I want to be able to have the player take as many photos as they want before putting the camera away. The script snippet I have for 'clicking' the camera is this: (The inputAction "Fire" is done by the player holding Left-Ctrl + Left mouse click). This works a treat in my script, but sadly can only be done once at the moment due to my lack of scripting know-how. I then have another script snippet which lets the rest of the script continue, thus closing the camera and letting the player get his weapon out again: (The inputAction "toggleRaiseWeapon" by default is a double tap of the Left-Ctrl key). The other problem here is that the player has to take a photo before the script continues on to the part where the player can put the camera away. What if the player opens the camera, but then decides to put it away without taking any shots. He/she can't in the script's current state. Here's the whole script currently: So in summery, I want the player to be able to point and 'click' the camera as many times and at as many objects as they want, then when they're ready, put the camera away. I hope that all makes sense. Any help with this is appreciated. Thanks heaps. Vapour
×