Jump to content

Grumpy Old Man

Member
  • Content Count

    4333
  • Joined

  • Last visited

  • Medals

Everything posted by Grumpy Old Man

  1. Grumpy Old Man

    Smooth camera

    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
  2. Grumpy Old Man

    [SOLVED] inAreaArray error

    Alternative syntaxes can catch one off guard, didn't know that the command "units" accepts objects as well until recently... Cheers
  3. Grumpy Old Man

    Get vehicle size

    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
  4. Grumpy Old Man

    [Poll] Is the Rhino MSG really useful?

    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
  5. Grumpy Old Man

    return object's init

    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
  6. Grumpy Old Man

    [Poll] Is the Rhino MSG really useful?

    Try doing anything with a MBT on Tanoa. Cheers
  7. Well there is setVehicleTIPars. Cheers
  8. Remove the quotation marks. Cheers
  9. 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
  10. Grumpy Old Man

    [Release] GOM - Aircraft Loadout V1.35

    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
  11. Grumpy Old Man

    Tigger give Group member init

    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
  12. Grumpy Old Man

    Tigger give Group member init

    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
  13. 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
  14. 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
  15. 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
  16. 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
  17. Grumpy Old Man

    AI driving wrong with Jet

    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
  18. @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
  19. Grumpy Old Man

    Detect any task complete by side

    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
  20. You can add knowsAbout to the _nearby selection, as posted earlier in this thread. Cheers
  21. Ah, I remember that one: Cheers
  22. 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
  23. 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
  24. Grumpy Old Man

    Kill Diferent Side

    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
×