-
Content Count
4333 -
Joined
-
Last visited
-
Medals
Everything posted by Grumpy Old Man
-
Because you're setting the camera position every 0.5 seconds, of course it's not gonna look good. Try using an eachFrame eventhandler to set the camera position. Cheers
-
[SOLVED] inAreaArray error
Grumpy Old Man replied to HazJ's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Alternative syntaxes can catch one off guard, didn't know that the command "units" accepts objects as well until recently... Cheers -
What he said, if data is needed and it'll remain static (vehicle sizes don't change spontaneously) just use a function to go through all vehicles once and store those sizes in an array. Might work just fine doing this once upon mission start in preInit or postInit. On a sidenote, neither boundingBox nor boundingBoxReal are useful for exact measurements, depending on object they can be pretty generous: The inner cube is boundingBoxReal, outter cube is boundingBox... Depending on how precise you need the size to be you'd be better off making a scanner function using lineIntersects or something... Cheers
-
Not sure what you'd expect? Maybe your concept of a mobile gun platform is skewed, they're simply not designed to take on tanks in a direct engagement. The list of things that can survive a 1:1 with a MBT is pretty thin, even MBT vs MBT is usually decided by who gets the first hit. The tank busting comes from firing terrain following, laser guided missiles with UAV or Laser designator support from beyond visual range. Cheers
-
return object's init
Grumpy Old Man replied to Mr H.'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Don't see why this wouldn't work. You set a variable in the objects init field, just modify the grabber function to also read the variable and store it in the array generated by the grabber, then use it when spawning the composition. Cheers -
Try doing anything with a MBT on Tanoa. Cheers
-
make object appear on thermal vission
Grumpy Old Man replied to M1ke_SK's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well there is setVehicleTIPars. Cheers -
addaction and passing on custom arguments
Grumpy Old Man replied to Vandeanson's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Remove the quotation marks. Cheers -
Aircraft shot down by Flak with Fire
Grumpy Old Man replied to LEXA_vole's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Check this out: Cheers -
Make AI pick up Backpack from ground
Grumpy Old Man posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey folks, ran into another issue for the script I'm working on. (Which will of course be shared when it's finished, sometime before Christmas) At first glance I thought there would be a way to access the squad commands through script commands, but there seems to be no way to do so. Is it currently even possible to make AI units (not in players group) pick up a backpack via script commands? Had some attempts from which only the following code snippet seems to execute, The named units (without backpacks) are performing the action without getting any backpacks and the backpacks on the ground stay on the ground. Variables are global because I'm trying it within the editors debug console. gunner1BP = nearestObject [gunner1,"B_HuntingBackpack"]; gunner2BP = nearestObject [gunner2,"B_FieldPack_oli"]; gunner1 action ["takeBag",gunner1BP]; gunner2 action ["takeBag",gunner2BP]; Or should I simply delete the backpack objects and use the addbackpack command? Would feel a bit hacky and won't fit the rest of the script since I try to keep it as authentic as possible. Cheers -
[Release] GOM - Aircraft Loadout V1.35
Grumpy Old Man replied to Grumpy Old Man's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Couldn't really look into this yet, might find some time this weekend. There's no playMusic command in any of the files related to the loadout scripts. The only sounds being played are interaction sounds when using the menu buttons and installing stuff on pylons. You might have copied the objects from the demo mission in your own mission, one of those uses ambient music, take a look at the object init fields. Cheers -
Tigger give Group member init
Grumpy Old Man replied to Weapon-Fetish's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Replace this line: _toHandle = units player select {!(_x getVariable ["TAG_fnc_isAutoMedic",false])}; with this: _toHandle = units player select {!(_x getVariable ["TAG_fnc_isAutoMedic",false]) AND !isPlayer _x}; Cheers -
Tigger give Group member init
Grumpy Old Man replied to Weapon-Fetish's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can run a small loop to check for new members and run the automedic script on them once, like this: //initPlayerLocal.sqf _automedic = [] spawn { TAG_fnc_addAutoMedic = true; while {TAG_fnc_addAutoMedic} do { _toHandle = units player select {!(_x getVariable ["TAG_fnc_isAutoMedic",false])};//will select units that are not already automedics { [_x, units player] execVM "automedic.sqf";//turn unit into autoMedic _x setVariable ["TAG_fnc_isAutoMedic",true];//set a flag to mark the unit as autoMedic so it will only be added once } forEach _toHandle; sleep 5; }; }; This will add the automedic to all units that aren't already designated automedics, every 5 seconds. If you want to stop the loop from adding automedic functionality simply set TAG_fnc_addAutoMedic to false. Cheers -
[Solved] Way to make a helicopter take off after certain units have exited?
Grumpy Old Man replied to Comrade Cheeki Breeki's topic in ARMA 3 - MISSION EDITING & SCRIPTING
As @beno_83au stated, the exclamation mark is in the wrong spot. To check if a group is inside/outside a vehicle: crew _chopper arrayIntersect units _infGroup isEqualTo [];//returns true if all units of the group are outside the chopper count (units _infGroup select {_x in crew _chopper}) isEqualTo count units _infGroup;//returns true if all units of the group are inside Cheers -
Force helicopter to stay on land while loading troops
Grumpy Old Man replied to alpha993's topic in ARMA 3 - MISSION EDITING & SCRIPTING
As far as I recall this behavior broke some time ago, this snippet usually worked fine, this is now no longer the case: _test = [] spawn { _chopper = chopper; _infGroup = group player; doStop _chopper; _chopper land "Get In"; waitUntil {crew _chopper arrayIntersect units _infGroup isEqualTo []};//players group left the chopper driver _chopper sideChat "Group left, ready to board"; waitUntil {count (units _infGroup select {_x in crew _chopper}) isEqualTo count units _infGroup};//players group boarded the chopper driver _chopper sideChat "Group boarded, RTB"; _chopper land "NONE"; _chopper move [0,0,0]; }; Choppers usually take off after some units leave/board at random, never figured out what's needed to override this behavior, life's too short for trying to fix AI, heh. Cheers- 8 replies
-
- scripting
- helicopter
- (and 7 more)
-
civillian See if any Civillian is killed
Grumpy Old Man replied to Play3r's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sure is, just change the isKindOf check to the classname you want. Other than that you can use setVariable to set a flag on an object, and use getVariable inside the EntityKilled EH to check if a killed unit was flagged and act accordingly: //object init field this setVariable ["TAG_fnc_HVT",true]; //initServer.sqf addMissionEventHandler ["EntityKilled",{ params ["_killed", "_killer", "_instigator"]; if (_killed getVariable ["TAG_fnc_HVT",false]) exitWith {"EveryoneLost" call BIS_fnc_endMissionServer}; }]; Depending on how you plan to implement it it's probably better to add individual EHs for checking certain objects only: //HVT object init field this addEventhandler ["Killed",{"EveryoneLost" call BIS_fnc_endMissionServer}]; Cheers -
civillian See if any Civillian is killed
Grumpy Old Man replied to Play3r's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Something like this: //initServer.sqf in mission root addMissionEventHandler ["EntityKilled",{ params ["_killed", "_killer", "_instigator"]; if (typeOf _killed isKindOf "CAManBase" AND side group _killed isequalTo civilian) exitWith {"EveryoneLost" call BIS_fnc_endMissionServer}; }]; BIS_fnc_endMissionServer addMissionEventHandler#EntityKilled You need to check for side group, since killed units are automatically side civilian, yet still remain in their group for a short time. Cheers -
AI driving wrong with Jet
Grumpy Old Man replied to Keon Disaster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
All AI can do when inside a plane on the ground is follow the taxi waypoints as defined in the map config (and even that's at least a 50% chance for disaster). Cheers -
addaction Player Addaction if handgun on inventory? [Solved]
Grumpy Old Man replied to TCGM's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Spatsiba forgot the quotation marks. This should do the trick: //only show if current weapon is the handgun //downside: will also show if no weapon equipped and no weapon in handgun slot and also if player is inside a vehicle player addAction ["<t color='#FF0000'>Shoot as Rich Texan</t>", "AirShoot.sqf", nil, 1.5, true, true, "", "currentWeapon _target isEqualTo handgunWeapon _target"]; //only show if on foot and the current weapon is handgun and the player isn't unarmed player addAction ["<t color='#FF0000'>Shoot as Rich Texan</t>", "AirShoot.sqf", nil, 1.5, true, true, "", "objectParent _target isEqualTo objNull AND currentWeapon _target isEqualTo handgunWeapon _target AND handgunWeapon _target !=''"]; Might want to use the second example if you want to play an animation (just guessing), so players won't be able to play animations inside vehicles (FFV slots). Cheers -
Detect any task complete by side
Grumpy Old Man replied to zigzagtshirt's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The function runs where you call it. Since the init.sqf runs at mission start in SP and on every connecting player in MP you might want to run the check in the last line some place else. Cheers -
Automatic Spawning Mortor team that fires?
Grumpy Old Man replied to Grim5667's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You can add knowsAbout to the _nearby selection, as posted earlier in this thread. Cheers -
solved Script to make helmet/hat fly off when shot in head?
Grumpy Old Man replied to johnnyboy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ah, I remember that one: Cheers -
[Code Performance] Adding Hold Actions to individual units vs adding one to player
Grumpy Old Man replied to Leopard20's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Unless you're running into performance issues and removing your scripts solves those issues, I wouldn't worry about it. Usually having one check for the player unit is preferable vs. adding actions to all units. alive _target && _target distance _this < 5 && getDammage _target > 0;//0.0022ms when returning false _target = test; _return = false; _units = allUnits select {alive _x && _x distance _target < 5 && ([visiblePosition _target, getDir _target, 60, visiblePosition _x] call BIS_fnc_inAngleSector) && (getDammage _x > 0)}; if (count _units > 0) then {_unit = _units select 0; _target setVariable ['target', _unit]; _return = true } else { _return =false }; _return //0.002ms when returning false Cheers -
customRadio: sometimes squelch, sometimes no squelch
Grumpy Old Man replied to johnnyboy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Could be related to distance, if within audible range you'd hear the unit itself speaking, if further away he's using the squelching radio. There was also a bug (maybe still is) that you'll hear direct audio and radio at the same time... Cheers -
scripts Kill Diferent Side
Grumpy Old Man replied to redburn's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Do you know what publicVariable does? Doesn't seem like it, or rather you seem confused about its usage (in this case). Does every client need to have access to all those variables? The more you cut down on network traffic, the better. If you simply want to handle civilian/friendly kills for every side you can do it exclusively on the server, no need to broadcast any variable at all. Cheers