-
Content Count
3059 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by jshock
-
[SOLVED] Predict Target Position - Need some help with code optimization
jshock replied to sarogahtyp's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
[SOLVED] Predict Target Position - Need some help with code optimization
jshock replied to sarogahtyp's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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) -
[SOLVED] Best method for detecting destroyed vehicle?
jshock replied to revv's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
[SOLVED] Best method for detecting destroyed vehicle?
jshock replied to revv's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
[SOLVED] Giving name to object
jshock replied to revv's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Edit the thread title yourself and put: "[RESOLVED] Thread Title" You have to be in the "full editor", edit the OP. -
[SOLVED] Making task spawn object
jshock replied to revv's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Mission task: place and detonate explosives
jshock replied to Taxen0's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
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.
-
It's technically more efficient: https://community.bistudio.com/wiki/Code_Optimisation#forEach_vs_count
-
How to get unlimited rockets for launchers and unlimited satchel charges
jshock replied to Randodom's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Shoulda posted it here: https://forums.bistudio.com/forum/200-arma-3-find-or-offer-editing/
-
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.
-
How to get unlimited rockets for launchers and unlimited satchel charges
jshock replied to Randodom's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Trigger Supply Drop with a Smoke Grenade
jshock replied to SeeRocky's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Typo on the "allowDamage true" line Revo: _crate not _create :p EDIT: He fixed it :)- 5 replies
-
- 3
-
- Smoke Grenade
- Supply Drop
-
(and 1 more)
Tagged with:
-
Activate trigger with demo charge or satchel charge
jshock replied to Wiki's topic in ARMA 3 - MISSION EDITING & SCRIPTING
[thisTrigger,_x] call BIS_fnc_inTriggerReplace in KK's at: _x inArea thisTrigger -
Activate trigger with demo charge or satchel charge
jshock replied to Wiki's topic in ARMA 3 - MISSION EDITING & SCRIPTING
KK covered the reason why it won't work: -
Activate trigger with demo charge or satchel charge
jshock replied to Wiki's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's a bit more optimized and doesn't rely on the list of the trigger. -
Activate trigger with demo charge or satchel charge
jshock replied to Wiki's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's thisList, no "_" -
How to split a group with new waypoints?
jshock replied to Wiki's topic in ARMA 3 - MISSION EDITING & SCRIPTING
https://community.bistudio.com/wiki/Category:Command_Group:_Waypoints -
How to split a group with new waypoints?
jshock replied to Wiki's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm confused as to why you need a 0% probability unit? Just make a new group on the fly in a script?? -
How to split a group with new waypoints?
jshock replied to Wiki's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Adding new objects to zeus?
jshock replied to solviper's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
In the config: scopeCurator = 2; -
exec or execVM? Call or Spawn?
jshock replied to the1krisrob's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Help needed: Defend Mission
jshock replied to FriskeyDingo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Help needed: Defend Mission
jshock replied to FriskeyDingo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
An event handler exists with that nomenclature: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#CuratorObjectRegistered