Jump to content

LoonyWarrior

Member
  • Content Count

    110
  • Joined

  • Last visited

  • Medals

Everything posted by LoonyWarrior

  1. Thank you for your comment... I should probably explain this... its made for DM and TDM multiplayer missions not for coop or so... and i simply felt that its needed... :) u already have missios with borders made like this... and its always like... one trigger 'show message' second trigger 'kill' but nobody cares if player stays in that first trigger.. the message can dissapear.. and simply nothing forces player to move out of the borders.. and thats why BorderGuard came on the scene :)
  2. why u insist on marker ? u can create waypoint and then setCurrentWaypoint https://community.bistudio.com/wiki/setCurrentWaypoint
  3. hi Properly defined private variable: private "_myPrivateVariableName"; _myPrivateVariableName = something; Properly defined global variable: TAG_myPrivateVariableName = something; Diference: script1.sqf private "_myPrivateVariableName"; _myPrivateVariableName = something; TAG_myGlobalVariableName = something; execVM "script2.sqf"; script2.sqf private "_anotherPrivateVariableName"; [color="#FF0000"]_anotherPrivateVariableName = _myPrivateVariableName;[/color] // error, _myPrivateVariableName was private variable of script1 [color="#008000"]_anotherPrivateVariableName = TAG_myGlobalVariableName;[/color] // works, because TAG_myGlobalVariableName is global variable [color="#FF0000"]TAG_anotherGlobalVariableName = _myPrivateVariableName;[/color] // error, _myPrivateVariableName was private variable of script1 [color="#008000"]TAG_anotherGlobalVariableName = TAG_myGlobalVariableName;[/color] // works, because TAG_myGlobalVariableName is global variable add 1 variable = variable + 1; string + string string = "something"; add = " something else"; string = string + add; string + number string = "something"; string2 = string + str 1; if without additional brackets if (myVar1 > 0 && myVar2 >2) then myVar3 = true; if myVar3 then
  4. hi how can i place marker X meters away from player in direction of another marker? player is 500m from marker A and i want to create new marker B 50m away from player in direction of marker A
  5. LoonyWarrior

    set direction.. down?

    oki i found the solution... befor i started this thread i tryed setVectorDir and setVectorUp ...and it didnt work but later i tryed setVectorDirAndUp and it does the magic.. so if u want hit player with 'grenade' spawned in the air...... _position = getPos player; _vectorDir = vectorDir player; _vectorDirX = (_vectorDir select 0) / 100; _vectorDirZ = (_vectorDir select 1) / 100; _vehicle = "M_Mo_120mm_AT_LG" createVehicle [_position select 0, _position select 1, 100]; _vehicle setVectorDirAndUp [[_vectorDirX, _vectorDirZ, -1], vectorUp player]; ---------- Post added at 21:10 ---------- Previous post was at 20:20 ---------- :( oki this works too, i made some mistake befor.. just for sure... its [0, 1, 0.001]
  6. hi how can i set direction "down"? when i create shell 50m above the ground.. _vehicle = "M_Mo_120mm_AT_LG" createVehicle [(_position select 0), (_position select 1), 50]; how to instruct it to go down ?
  7. LoonyWarrior

    Task Completion Animations

    hi... i didnt study all the post but it looks like nobody mentioned it befor... ...to the original question... this is done by BIS_fnc_taskSetState and the task have to be created by BIS_fnc_taskCreate _null = [player, "TaskName", ["Task description", "Task title", "Waypoint title"], "MarkerNameRepresentingWaypoint", true] call BIS_fnc_taskCreate; last boolean is 'set as current!.... true... false.... if true message will be 'Task Assigned' and task will be set as current if false message will be 'Task Created' and current task stays as it is huge drawback is that task created this way is valid only per live... so if player dies and respawns with task still assigned u cant use BIS_fnc_taskSetState to change the task states... at least i didnt found anyway how to do that.. :(
  8. LoonyWarrior

    Best use of trigger?

    it depends on what that "things" re.. and if the trigger can be activated multiple times.. anyway... basically u should create your own function... the native way to do so... 1. create .sqf file with your method and place it somewhere is your mission folder.. ( missionFolder\scripts\banky\BN_fnc_functionName.sqf ) 2. on mission initialization (init.sqf) compile the function BN_fnc_functionName = compileFinal preprocessFileLineNumbers "scripts\banky\BN_fnc_functionName.sqf"; 3. call or spawn your function with trigger http://community.bistudio.com/wiki/Code_Optimisation
  9. LoonyWarrior

    ForEach units group _unit?

    your for loop is commented out
  10. hi is there a method for selecting max value from the array?
  11. LoonyWarrior

    loop performance

    and when u wish to limit score and time for pvp mission.. and user can decide.. limit only score limit only time limit both of them when user decide to limit both of them.... no super.. to napomenuti mi smazalo rozepsanou zpravu... takze to zkratim... debata byla o necem jinem... takze z me strany jedine: muzes prosim potvrdit ze je rychlejsi IFu posilat primo boolean misto matematicke podminky ?
  12. hi whats better ? method 1: while { true } { if (myVariable > 0) then { do something.... }; sleep 1; }; method 2: processMyVar = false; if (myVariable > 0) then { processMyVar = true; }; while { true } { if (processMyVar ) then { do something.... }; sleep 1; }; sure.. method 2 creates more variables (so using more memory) but my question is... will it save processor time ?
  13. LoonyWarrior

    loop performance

    = "you shouldnt defend yourself" why ? almost all insults from my side was copy pasted his own insults... im not the bad person in this case... i thought that this was constructive comment... if u feel that i tryed to insult YOU in any way, im sorry for that... that wasnt my intention.. whole "fight" is very very simple... i made my code: limitScore = false; limitTime = false; if (scoreLimit > 0) then { limitScore = true; }; if (timeLimit > 0) then { limitTime = true; }; while { true } { if (limitScore) then { if (scoreLimit..........) then { do something.... }; }; if (limitTime) then { if (timeLimit ..........) then { do something.... }; }; sleep 1; }; but he contends that this is better: limitScore = false; limitTime = true; if (limitScore) then { while { true } { if (timeLimit <= timeLeft) then { do something.... }; }; }; if (limitTime) then { while { true } { if (timeLimit <= timeLeft) then { do something.... }; }; }; and when i ask why ? and im getting no response why am i bad person ?
  14. LoonyWarrior

    loop performance

    LOL LOL LOL so... i asked how should i do that and your answer is that i cant speak english ? ...thats soooo cheap its not about my english... its about your code reading... and SQF syntax is same for all languages... pls answer my question... look at the code... and giv me yours better variant... right now u re just runing away from the answer.... (perhaps u already know that u re wrong all the time ?) ---------- Post added at 11:37 ---------- Previous post was at 11:29 ---------- i have this specific code... limitScore = false; limitTime = true; while { true } { if (limitScore) then { if (scoreLimit <= scoreSide...) then { do something.... }; }; if (limitTime) then { if (timeLimit <= timeLeft) then { do something.... }; }; }; and u say... hey thats bullshit since u know that limitScore will never change in the loop ok so i will end up with limitScore = false; limitTime = true; if (limitTime) then { while { true } { if (timeLimit <= timeLeft) then { do something.... }; }; }; how i will monitor the score now u idi*t ? ...with another loop ? so again.... why two loops ? YOUR SOLUTION limitScore = false; limitTime = true; if (limitScore) then { while { true } { if (timeLimit <= timeLeft) then { do something.... }; }; }; if (limitTime) then { while { true } { if (timeLimit <= timeLeft) then { do something.... }; }; }; ...why why why...... why two loops ? why its better ? ---------- Post added at 12:02 ---------- Previous post was at 11:37 ---------- dont bite me... :) but should compare 0 > 0 and false not true.. ...another "clue" is that boolean can be used without brackets
  15. LoonyWarrior

    loop performance

    :cool: hmm 5 years php 2 years c# and u re telling me that it do what its supposed to do ? ...wow ....thank you when user decide to limit both score and time.... what u will do ? ....if u will stick with that u will end up with another loop... and prove me that not... so... why two loops ? u re simply ignoring what the code says.. its hard then......
  16. LoonyWarrior

    loop performance

    theoretical because there is sleep command which slows that down.................. in fact... im afraid that you re missing the point.... there wasnt problem at all.. i had question about performance of IF statement in loop question was... is faster if ( false ) or if ( 0 > 0 ) i wasnt sure if engine will take true as true or it will try to figure out if true is true.. and what u re talking about ? personally... i have no idea... ...because while u was talking about apples we actually discovered that its faster to use boolean by itself.. ...case solved... (actually on previous page) and when u wish to limit score and time for pvp mission.. and user can decide.. limit only score limit only time limit both of them when user decide to limit both of them.... u say make two loops... and i ask.... why ? u look at that only from one side... but it has two sides.... There is no need to put an if statement in a loop unless you need to check the statement each iteration = make two loops
  17. LoonyWarrior

    loop performance

    = when user decide to limit score and time ...make two loops........ why two loops ?
  18. LoonyWarrior

    loop performance

    hups ? :j: ...im sorry but u know what.. ..we know what we re talking about.. do u ?
  19. LoonyWarrior

    loop performance

    lol and i was just thinking why u said that ....when i posted the reseults already.. ;)
  20. LoonyWarrior

    loop performance

    :) myVariable1 = 0; myVariable2 = time; while { myVariable1 < 10000 } do { if ( [b]STATEMENT[/b] ) then { titleText ["experiment", "PLAIN"]; }; myVariable1 = myVariable1 + 1; }; myVariable3 = time; if ( false ) 0.306 0.304 0.301 0.303 if ( 0 > 0 ) 0.308 0.311 0.309 0.308
×