Jump to content

jshock

Member
  • Content Count

    3059
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by jshock

  1. Sorry, computer science coursework coming out, O(n) basically is a nomenclature to specify how "fast" (efficient) a piece of code or functions runs based on all it's parts loops, calculations, etc. The 'n' in this case is the number of variable "steps" it takes to get from _lastTime < _distance to _lastTime > _distance, so O(n) means that this function will run at a linear pace, dependent on 'n', the number of steps it takes to clear the while loop. As far as on each frame, you'll honestly just have to see if it causes a heavy hit or not, it probably will.
  2. Well, IMHO, you should use params for the variables that are parameters and private for those that you just want private, from what I understand with params (could be wrong), is it paramtizes variables coming in AND then also privatizes them at the same time. It's safer for the details you already stated about possibly more input from the user. But overall I'm not seeing anything too outstandish when in comes to non-optimal, if I'm making the correct assumption about config file references, most of this script is running in constant time (all the calculations), with some linear time (forEach loop and config file). Making this script at worst O(n), which isn't too bad considering what your're trying to accomplish, unless I'm missed something (3am and I did read quickly :p), so hopefully someone with some sleep and keen eyes, and maybe a bit further understanding of the backend of some of these functions can provide a more detailed answer. EDIT: Yup, completely looked past the while loop, which atm, my brain cannot analyze the time complexity of that, especially via my phone...so...yea :). (I think it's still O(n) based on the condition...but idk anymore)
  3. Try: https://community.bistudio.com/wiki/BIS_fnc_setTask To do all the necessary creation and assignment of the task, use the return in taskSetState as you have it above. It may be boiling down to a locality issue here. Also, typo on my part (not sure if it matters), but go ahead and add a ';' after sleep 0.5 in the waitUntil block.
  4. Since your're keen on your trigger: _trg setTriggerStatements [ "!alive ammocrate1",//condition "task_1 setTaskState 'SUCCEEDED'; player setCurrentTask task_2; task_1 = true; publicVariable 'task_1'; hint 'Operation Success!';",//on activation ""//on deactivation ]; You got your stuff mixed up as to where it belongs: https://community.bistudio.com/wiki/setTriggerStatements And you still had some double quotes where there should be single quotes. All this would be caught by the -showScriptErrors startup parameter, recommend you turn that on: https://community.bistudio.com/wiki/ArmA:_Startup_Parameters My waitUntil expression in the other thread should work, not too sure why it didn't, unless just the task wasn't marked as completed, therefore something is wrong with your task system, which is another issue entirely.
  5. Edit the thread title yourself and put: "[RESOLVED] Thread Title" You have to be in the "full editor", edit the OP.
  6. Spayd is correct. But you could easily do this without a trigger: // Create weapon cache at random marker ammocrate1 = createVehicle ["B_supplyCrate_F",getMarkerPos "cache_1",["cache_2","cache_3"], 5, "NONE"]; _handle = [] spawn { waitUntil {!alive ammocrate1; sleep 0.5}; task_1 setTaskState "SUCCEEDED"; player setCurrentTask task_2; task_1 = true; publicVariable "task_1"; hint "Operation Success!"; }; You were missing ']' at the end of your createVehicle line, that's probably why it didn't work, fixed in my example above.
  7. Could use an Entity Killed EH to check for an explosion I believe, (_this select 0) being the explosive, you'll just need to check the typeOf (_this select 0) in the EH before executing any task related code.
  8. jshock

    Arrays

    Yea, I wasn't saying that your're not right, just the reason why some people use count over forEach, and in this instance, the return from count isn't necessary and _forEachIndex is also not necessary so truly it doesn't matter either way, and yea the data sample is small enough to not exactly matter.
  9. jshock

    Arrays

    It's technically more efficient: https://community.bistudio.com/wiki/Code_Optimisation#forEach_vs_count
  10. Just follow the structure given (copy/paste and change the classnames), it may be better if you end up using a lot of different launchers/other stuff, to put this all in a switch statement.
  11. jshock

    Arma 3 ACE Life RP

    Shoulda posted it here: https://forums.bistudio.com/forum/200-arma-3-find-or-offer-editing/
  12. jshock

    Not synced scripts

    Textures are almost always finicky, a lot of the time each person just needs to get close enough to the object to see the texture (or have them render in), but try setObjectTextureGlobal if you haven't done so yet to see if that makes any difference.
  13. You may still need a large backpack (so you will have the space to auto add them to your inventory), you'll need to fill in the class of the rocket magazine: this addEventHandler [ "Fired", { if ((_this select 5) == /*classname of rocket*/) then { player addMagazine /*classname of rocket*/; }; if ((_this select 5) == "SatchelCharge_Remote_Mag") then { player addMagazine "SatchelCharge_Remote_Mag"; }; } ]; If the satchels don't work with the fired EH, you can try them in a put EH.
  14. Typo on the "allowDamage true" line Revo: _crate not _create :p EDIT: He fixed it :)
  15. [thisTrigger,_x] call BIS_fnc_inTriggerReplace in KK's at: _x inArea thisTrigger
  16. It's a bit more optimized and doesn't rely on the list of the trigger.
  17. https://community.bistudio.com/wiki/Category:Command_Group:_Waypoints
  18. I'm confused as to why you need a 0% probability unit? Just make a new group on the fly in a script??
  19. Can't you create a new group, then assign waypoints to that group, then assign the two players to that group? They shouldn't see the first groups waypoints, since they are no longer apart of it.
  20. In the config: scopeCurator = 2;
  21. KK, answers this in the last note of the command's wiki page: https://community.bistudio.com/wiki/playSound3D Where the sound is first emitted, it stays, so unless you get creative with the sound and a looping script that keeps up with the central position, then spawns in a new sound at whatever interval over 360 degrees, it won't be as simple as moving the original sound spawned around in a circle around the central position.
  22. jshock

    Help needed: Defend Mission

    I wasn't directing that at your comment, mearly stating a matter of fact, so that he may know to try implementation of the EH over the non-existent function.
  23. jshock

    Help needed: Defend Mission

    An event handler exists with that nomenclature: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#CuratorObjectRegistered
×