-
Content Count
4313 -
Joined
-
Last visited
-
Medals
Everything posted by Grumpy Old Man
-
HELICOPTER EXFILTRATION - HOW DOES THIS WORK?
Grumpy Old Man replied to black_hawk_mw2_87's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Allright, gonna send you a quick demo mission, heh. Cheers- 20 replies
-
- helicoppter
- exfiltration
-
(and 1 more)
Tagged with:
-
HELICOPTER EXFILTRATION - HOW DOES THIS WORK?
Grumpy Old Man replied to black_hawk_mw2_87's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ouch, a few things: init.sqf is automatically run by the game upon mission start, no need to run it again. In the triggers onAct field simply put: [SomeSoldier,EvacChopper] spawn GOM_fnc_chopperPickup; I recommend to further look into some scripting guides to make things more clear: Mr Murray for Arma, worth its weight in gold and still valid. Kylanias page with loads of examples and KKs glorious page for more advanced users. Cheers- 20 replies
-
- helicoppter
- exfiltration
-
(and 1 more)
Tagged with:
-
HELICOPTER EXFILTRATION - HOW DOES THIS WORK?
Grumpy Old Man replied to black_hawk_mw2_87's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Getting this as well, for some reason the editor automatically converts every called function and adds a call on its own. As to your example, so you have the function inside init.sqf? Then there should be no local variable in global space error from the trigger. Not really sure from your description. Cheers- 20 replies
-
- helicoppter
- exfiltration
-
(and 1 more)
Tagged with:
-
HELICOPTER EXFILTRATION - HOW DOES THIS WORK?
Grumpy Old Man replied to black_hawk_mw2_87's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Make sure the marker names are identical both on the marker itself and in the script. Since in your post you wrote MyMarker01 and MyMarker1 and be aware that strings (stuff between quotation marks) is case sensitive. Also you don't need to change _unit and no need to change the function at all, since it's just a variable holding the object passed into the function. Change the objects you pass into the function: //player unit named SomeSoldier //chopper named EvacChopper [SomeSoldier,EvacChopper] spawn GOM_fnc_chopperPickup; That's all there is to it. Posting a screenshot can be as simple as: Hit print screen go to imgur.com click on new post ctrl+v paste the image link to the forum Cheers- 20 replies
-
- helicoppter
- exfiltration
-
(and 1 more)
Tagged with:
-
Music and sounds from DLC - are available only to DLC owners or to all?
Grumpy Old Man replied to Rydygier's topic in ARMA 3 - MISSION EDITING & SCRIPTING
As far as I know the files are installed on every client, no matter if you own the DLC or not. Imagine the headaches this would cause, heh. Cheers -
HELICOPTER EXFILTRATION - HOW DOES THIS WORK?
Grumpy Old Man replied to black_hawk_mw2_87's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can put the first part, which defines the function into init.sqf or wherever you seem fit. Then you can call it anytime in game from a trigger, another script, or debug console like this: [player,chopper] spawn GOM_fnc_chopperPickup; Then the function will wait for the condition to happen, the first waitUntil line, if you don't need this and want the chopper to immediately head towards the player simply delete this line: waitUntil {time > 1};//put your condition in here to make the chopper move towards the player No need to delete comments, since they're ignored by the engine. For a position you can place a marker, name it and use getMarkerPos, or place an object, name it and use getPos: _chopper move getMarkerPos "MyMarker01"; //or _chopper move getPos flagFOB01; Cheers- 20 replies
-
- helicoppter
- exfiltration
-
(and 1 more)
Tagged with:
-
Anti-Air Vehicle Ranges and Effectiveness
Grumpy Old Man replied to HigherDimension's topic in ARMA 3 - DEVELOPMENT BRANCH
Titan AA from Cheetah? Sure they can. Left mouse button. Cheers -
bi mystery Modules Lag when Mission does not
Grumpy Old Man replied to JohnKalo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This. Points 2-10 are only speculation without seeing scripts and/or mission. Point 1 is irrelevant if there's funky stuff running in a while true loop without sleep (or similar). "Lagging" tasks and units not being placed inside vehicles sounds like there's something off. Try it without mods and see if the issue persists. Cheers -
make an array with all buildings
Grumpy Old Man replied to dlegion's topic in ARMA 3 - MISSION EDITING & SCRIPTING
No way to grab this from the config, as far as I know. Try this: GOM_fnc_buildingsWithPositions = []; GOM_fnc_grabAllBuildingPositions = { _initTime = diag_tickTime; _allHouses = "configName _x isKindOf 'HouseBase'" configClasses (configFile >> "CfgVehicles") apply {configName _x}; _allHouses resize 50;//just for testing, delete this line if you want to check all houses systemChat str count _allHouses; _allHouses apply { _house = _x createVehicle [0,0,0]; _positions = _house buildingPos -1; if (count _positions >= 4) then {GOM_fnc_buildingsWithPositions pushBack _house}; deleteVehicle _house; }; copyToClipboard str GOM_fnc_buildingsWithPositions; systemchat format ["Data evaluated in %1s.",diag_tickTime - _initTime]; }; [] call GOM_fnc_grabAllBuildingPositions; Be aware this will take forever for around 900 vanilla buildings. If anyone else knows a way to grab building positions from config would be great to know... Edit: Run this once to get all valid buildings that have more than 3 positions, the array of building classnames will be stored in the clipboard, simply paste it to a file and define it as an array for later in game use. Cheers -
make an array with all buildings
Grumpy Old Man replied to dlegion's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well all houses/buildings are vehicles, so you need to filter CfgVehicles accordingly: _allHouses = "configName _x isKindOf 'House'" configClasses (configFile >> "CfgVehicles"); You need to filter for either "House" or "Building", since one of them has positions, the other has not. You can also filter current objects on the map, in case you run with mods and don't want to spawn a mosque in Chernarus. Cheers -
make an array with all buildings
Grumpy Old Man replied to dlegion's topic in ARMA 3 - MISSION EDITING & SCRIPTING
What are you trying to do? If you want to access building positions just use the buildingPos command, way faster than storing all buildings and positions in an array, if that's what you want to do. Cheers -
HELICOPTER EXFILTRATION - HOW DOES THIS WORK?
Grumpy Old Man replied to black_hawk_mw2_87's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Solution without triggers: GOM_fnc_chopperPickup = { params ["_unit","_chopper"]; _unit setVariable ["GOM_fnc_pickUpChopper",_chopper]; waitUntil {time > 1};//put your condition in here to make the chopper move towards the player _chopper move (_unit getPos [50 + random 50,random 360]);//this will move the chopper near the player within 50-100m waitUntil {_chopper distance2d _unit < 300}; //now the player can throw a smoke to mark the landing area hintC "Throw smoke to mark landing area!"; _unit addEventHandler ["Fired",{ params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; if (toUpper _ammo find "SMOKE" >= 0) then { _unit removeEventHandler ["Fired",_thisEventhandler]; hint "Smoke out!"; _chopper = _unit getVariable ["GOM_fnc_pickUpChopper",objNull]; _wait = [_chopper,_projectile] spawn { params ["_chopper","_projectile"]; waitUntil {vectorMagnitude velocityModelSpace _projectile < 0.01}; hintC "The Chopper will land now!"; //spawn landing pad at smoke position and make chopper land _pad = "Land_HelipadEmpty_F" createVehicle getPosATL _projectile; _pad setPosATL getPosATL _projectile;//just in case... doStop _chopper; _chopper land "GET IN"; waitUntil {_unit in crew _chopper}; //cancel the landing _chopper land "NONE"; _chopper move getPosATL _chopper; sleep 5; _chopper move [0,0,0];//position where the chopper should move to } } }] }; //to run the function: [player,chopper] spawn GOM_fnc_chopperPickup; Using waypoints can be funky sometimes, doing this with a simple script snippet is a bit more convenient. This will allow the player to mark the landingzone of the chopper by throwing a smoke grenade, chopper will land and wait for the player to board it with engines on, then will move to [0,0,0] once the player is in it, you can add your own position or whatever. Cheers- 20 replies
-
- 7
-
-
-
- helicoppter
- exfiltration
-
(and 1 more)
Tagged with:
-
Earplugs in multiplayer
Grumpy Old Man replied to Stormmy1950's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can also put this into one addAction: GOM_earplugID = player addAction ["Earplugs Off",{ _plugState = missionNamespace getVariable ["GOM_fnc_plugState",false]; 1 fadeSound ([1,0.15] select _plugState); player setUserActionText [GOM_earplugID, ["Earplugs On","Earplugs Off"] select _plugState]; missionNamespace setVariable ["GOM_fnc_plugState",!_plugState]; },0,1,false,false,"","_target isEqualTo _this"]; Also I wouldn't use soundVolume for checks, since the returned value will not gradually change over time, it will immediately take the value set by fadeSound, no matter the time parameter. Cheers -
How do you plan your scripts/systems?
Grumpy Old Man replied to Harzach's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Another thing to add to the systemchats all over the place mentioned by @TeTeT, I usually put in a function that's used to hand out debug info to either hint, systemchat and/or .rpt. Can be called from any function since it's initialized via preInit and has useful parameters: GOM_fnc_debugging = true; GOM_fnc_Debug = { params["_override","_output","_message"]; if (GOM_fnc_debugging OR _override) then { if (1 in _output) then {systemchat _message}; if (2 in _output) then {hintSilent _message}; if (3 in _output) then {diag_log _message}; }; }; //this way you can enable debug messages like this: _localDebugging = true; [_localDebugging,[1,3],format ["Error in %1",_fileName]] call GOM_fnc_Debug; //will print the error in filename message in systemchat and .rpt log if GOM_fnc_debugging is set to true GOM_fnc_debugging = false; [_localDebugging,[1,3],format ["Error in %1",_fileName]] call GOM_fnc_Debug; //will print the error in filename message in systemchat and .rpt log only if the local debugging flag is set to true Just made this out of memory, the real function is a bit too intertwined with other stuff from my library but should give anyone a better idea on useful debugging stuff. Pretty much the backbone and mandatory for medium+ sized projects. Cheers -
the "addactions" do not stack
Grumpy Old Man replied to Hiddens's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Forum can be funky sometimes, especially when multitabbing and writing in various tabs at once (and even 2+ browser instances). Had posts end up in other threads at least 2 times. Cheers -
How do you plan your scripts/systems?
Grumpy Old Man replied to Harzach's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Been there, on my own stuff. Involved various functions spread all over the place. Wasn't much of a problem when working on it, coming back to this mess after a 6 month break on the other hand made me just start from scratch again, heh. Cheers -
How do you plan your scripts/systems?
Grumpy Old Man replied to Harzach's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I usually keep stuff split by functionality/content as much as possible. Stuff that should be tweaked goes to a separate file into mission root for ease of access, like multipliers for enemy units, customizable parameters etc. data related stuff also goes to a separate file inside /script/GOM/something, like unit loadouts, arrays of positions etc. Then I put everything that's CPU intensive into pre/postInit calls where possible. Helps keeping things in order, especially when you reach a total of 150+ .sqf files, heh. That's about it. Cheers -
Need Help To Prevent Spamming Moves
Grumpy Old Man replied to froggyluv's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here's how you can do a simple time based lockout: test addEventHandler ["Firednear", {[_this select 0] call Frog_Roll}]; Frog_Roll = { params ["_target","_shooter"]; _lockoutTime = 5; _lastLockout = _target getVariable ["GOM_fnc_lockout",-_lockoutTime];//so it returns -5 as default, initially enabling the roll if (time < _lastLockout + _lockoutTime) exitWith {false}; //at this point the last lockout was more than 5 seconds ago, so we save the current lockout time on the unit, then roll _target setVariable ["GOM_fnc_lockout",time,true]; _rolls = selectRandom ["amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr","amovppnemstpsraswrfldnon_amovppnemevaslowwrfldl"]; _target switchmove "amovppnemstpsraswrfldnon_amovppnemevaslowwrfldr"; }; Pretty straightforward, heh. Cheers -
Variable Names for Units Spawned From Array
Grumpy Old Man replied to Lineman's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@HazJ how are you running the setVariable one for 0.0007ms? Do I really need to upgrade my CPU already? Heh... Cheers -
Variable Names for Units Spawned From Array
Grumpy Old Man replied to Lineman's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Just for the curious: missionNamespace setVariable ["abc", 123];//0.001ms call compile format ["%1 = %2", "abc", 123];//0.0025ms Performance loss is kinda given. Some other reason for not using call compile format, in terms of sending code via network, though a bit unrelated to this topic. Cheers -
Detect server shutdown
Grumpy Old Man replied to 7erra's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Like @pierremgi stated, waiting for an escape keydown event might be the most fitting solution. Alternatively you could make it so players can only save gear at specific locations/objects, though that might not be suited depending on mission type. Cheers -
Detect server shutdown
Grumpy Old Man replied to 7erra's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try getClientState, works on dedicated as well. Cheers -
What's wrong with Triggers
Grumpy Old Man replied to FoxtrotF's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's not, the in command doesn't care about upper/lower case, case sensitivity is only needed for comparing strings: "test" in ["Test","TEST"];//false "Test" in ["Test","TEST"];//true In the example made by the thread author there's no case sensitivity involved: (player in thisList) || (heli_1 in thisList) || (heli_4 in thisList) //same as (pLaYeR in thisList) || (hElI_1 in thisList) || (HeLi_4 in thisList) Cheers -
How to use setVehicleVarName?
Grumpy Old Man replied to zagor64bz's topic in ARMA 3 - MISSION EDITING & SCRIPTING
No need for remoteExec addAction in SP, should be fine. Cheers -
How to use setVehicleVarName?
Grumpy Old Man replied to zagor64bz's topic in ARMA 3 - MISSION EDITING & SCRIPTING
That's handled inside the executed code by addAction, which receives parameters on its own: GOM_fnc_respawnBoat = { params ["_oldBoat","_respawnedBoat"];//these parameters are passed by the respawn module _respawnedBoat addAction ["All into the boat",{ params ["_target", "_caller", "_actionId", "_arguments"];//these parameters are passed by the addAction /* _target will be the boat object, _caller the player who activated the action */ }]; }; Something like this. You'd probably need to remoteExec the addAction so that every player can see the action in MP. Cheers