Jump to content

Grumpy Old Man

Member
  • Content Count

    4333
  • Joined

  • Last visited

  • Medals

Everything posted by Grumpy Old Man

  1. Grumpy Old Man

    Create marker on random map loc

    For an absolutely random position as stated in the first post one could use something like this: _rndMapPos = [(worldSize / 2),(worldSize / 2),0] getPos [random (worldSize / 2) * 1.4142,random 360]; //simple test for "_i" from 1 to 100 do { _rndMapPos = [(worldSize / 2),(worldSize / 2),0] getPos [random ((worldSize / 2) * 1.4142),random 360]; _markerstr = createMarker [str _rndMapPos, _rndMapPos]; _markerstr setMarkerShape "ICON"; _markerstr setMarkerType "mil_dot" ; }; Again, this will return a position that can be anywhere on the map, can be on water, far away from any landmass etc. Cheers
  2. Most likely the best way to go about it, try out and look at a commands wiki entry, alternate syntax and most importantly the comments below can be easily missed, usually provides all the clarification that's needed, otherwise just ask, that's what the forum is there for. Cheers
  3. It's not advisable to use removeAllActions unless you're debugging or trying out stuff in the editor, this script command has no place in a mission, unless you want to risk breaking other mods/addons/scripts that use addAction. If it absolutely has to be on a player simply track those addAction IDs (that's what return values are there for, and handle the removal in a dedicated function. You can also streamline the addActions into a single line, use forEach and the arguments parameter. Also don't write the code you want to happen upon activation inside the addAction, but put it into a function for easier editing and overview, like this: TAG_fnc_spectatorTeleport = { params ["_object","_caller","_ID","_teleportDestination"]; _caller setPosASL (getPosASL _teleportDestination); _caller call TAG_fnc_removeTeleportActions; true }; TAG_fnc_removeTeleportActions = { params ["_caller"]; _actions = _caller getVariable ["TAG_fnc_teleportActionIDs",[]]; { _caller removeAction _x; } forEach _actions; true }; _actionIDs = []; _teleports = [["Kontrollraum",tele_porter_Hauptquartier],["Turm 1",telPort_Parkour_tower1],["Turm 2",telPort_Parkour_tower2],["Turm 3",telPort_Parkour_tower3],["Turm 4",telPort_Parkour_tower4],["Turm 5",telPort_Parkour_tower5],["Turm 6",telPort_Parkour_tower6],["Turm 7",telPort_Parkour_tower7]]; { _actionIDs pushBack (_caller addAction [_x#0, {_this call TAG_fnc_spectatorTeleport},_x#1]); } forEach _teleports; //now _actionIDs holds all actions for further control by the "remove" function above _caller setVariable ["TAG_fnc_teleportActionIDs",_actionIDs]; Not tested but I don't see how this wouldn't work, if your goal is to remove all actions when any of them is being activated, judging from your post. Cheers
  4. Grumpy Old Man

    Making time pass mid mission

    Entering "Arma 3" followed by your thread title into google is usually a good idea and will yield plenty of results. Usually skipTime will do the job here, as long as you execute it on the server. If you're using a trigger for your event simply use it as server only and put skipTime in its onAct field. Cheers
  5. Grumpy Old Man

    Looking for Arma 3 Scripter

    I'm sure the response after such an eloquent, detailed and well thought out post will be plentiful. Cheers
  6. Grumpy Old Man

    [Release] GOM - Vehicle Tuning V1.01

    All right, looks familiar, seems like exile is also using default GUI class defines, which causes the conflict. Will have a look at it over the weekend and upload a fix after some testing. Cheers
  7. It's a simple side switch from what I can tell, no in game variable, command or anything else happening. So yes, a simple side check will do. A bit disappointing that it's nothing more than a simple action activation and animation. At least some "hacking in the 90s" action would be neat. To give a unit hacking ability use setUnitTrait. Changelog where the functionality has been added: Cheers
  8. Grumpy Old Man

    [Release] GOM - Vehicle Tuning V1.01

    And I'm using GOM_defines.hpp. Don't see how this is an issue, heh. Cheers
  9. Grumpy Old Man

    [Release] GOM - Vehicle Tuning V1.01

    Don't see any reason of having this as a mod, but I'm sure willing to be enlightened of the benefits. Cheers
  10. Grumpy Old Man

    navigating config files

    You could merge all unit arrays from CfgGroup for every side and check against that, story and odd units usually aren't used in group templates. But in the end only a single blacklist will be 100% reliable. Cheers
  11. Grumpy Old Man

    Spawn AI

    Could be something like this: //init.sqf TAG_fnc_respawnAIEnabled = true;//set this to false any time mid mission and the respawn will be stopped TAG_fnc_respawnAI = { params ["_unit"]; _unit addEventHandler ["Killed",{ params ["_unit"]; if (!TAG_fnc_respawnAIEnabled) exitWith {false}; _newUnit = (creategroup side group _unit) createUnit [typeof _unit, (_unit getPos [15 + random 35,random 360]), [], 0, "NONE"]; _respawn = [_newUnit] call TAG_fnc_respawnAI; true }]; }; //add to multiple units or only one, as needed { _respawn = [_x] call TAG_fnc_respawnAI } forEach [YourAI1,YourAI2,YourAI3]; Will respawn the unit within at least 15m and most 50 in a random direction from the killed unit. Cheers
  12. Grumpy Old Man

    Simple script shows error

    That's because my snippet doesn't handle respawn, which can be done in many ways, depending if you use a vanilla module, third party script, other custom solution. Hence the example for the vanilla respawn modules expression field. Cheers
  13. Grumpy Old Man

    Simple script shows error

    Weird, my snippet only has 35 lines and doesn't handle respawn at all, as stated earlier, with the one liner example for the respawn module, if that's what you're using. Cheers
  14. createSimpleObject might be a way. Cheers
  15. Grumpy Old Man

    Simple script shows error

    Depends on how you do the respawn you could use something like this: //initPlayerLocal.sqf or wherever you seem fit //function to register vehicles for marker drawing TAG_vehMarkers = []; TAG_fnc_vehMarkerHandling = { params ["_veh","_textType"]; _veh setVariable ["TAG_fnc_vehMarkerRespawnParams",_this]; _mrk = createMarker [str _veh, getPosVisual _veh]; _mrk setMarkerType "hd_dot"; _mrk setMarkerColor "ColorBlue"; _this append [_mrk]; TAG_vehMarkers pushBack _this; _mrk }; //use this to remove the vehicle from marker handling TAG_fnc_vehMarkerRemove = { params ["_veh"]; _index = TAG_vehMarkers findIf {_x#0 isEqualTo _veh}; _removed = TAG_vehMarkers deleteAt _index; deleteMarker (_removed#2); systemChat format ["Removed %1 from marker handling",_removed]; true }; //handle marker drawing and text selection addMissionEventHandler ["EachFrame",{ _truckTexts = [["Repair truck","Repair truck is destroyed"],["Fuel truck","Fuel truck is destroyed"],["Ammo truck","Ammo truck is destroyed"]]; { _x#2 setMarkerPos getPosVisual (_x#0); _x#2 setMarkerText (_truckTexts#(_x#1) select (!alive (_x#0))); } forEach TAG_vehMarkers; }]; //to add vehicles to marker handling use this inside a trigger/script/whatever _handleMarker = [ammotruck,2] call TAG_fnc_vehMarkerHandling;//0 for repair, 1 for fuel, 2 for ammo etc. You can simply register vehicles and wanted text types with a single line, should be self explanatory, if not, ask. Also added a function so you can cleanly remove a vehicle from being handled by the EachFrame Eventhandler and also deletes the vehicle related marker. Will work from vehicle respawn module like this: _handleMarker = [_this#1,2] call TAG_fnc_vehMarkerHandling;//adjust number to text you want to put out obviously Setting marker positions on each frame costs negligible CPU cycles (0.0013ms on my rig), a frame lasts 16.67ms at 60fps, so 0.0013ms is 0.002167% of a frame at 60fps. Can squeeze a few of those into a single frames runtime, heh. Cheers
  16. Grumpy Old Man

    Magazine with 12 rounds

    You have an error in the magazine class name: //wrong 5000rnd_762x51_Belt //correct 5000Rnd_762x51_Belt Upper R instead of lower case, also another error only visible when copy pasting your string, you got a zero width no break space (U+FEFF) between the 5 and 1, and two at the end, or it's the forum software acting up, not sure. An error source I'd sure as hell would eliminate if I were you. To properly add a mag with 12 rounds of any chosen type use this: //init.sqf or wherever you seem fit TAG_fnc_addAmmoCount = { params ["_veh","_rounds","_turretPath","_mag"]; _veh setVehicleAmmoDef 0;//clear all ammo on vehicle _veh addMagazineTurret [_mag,_turretPath,_rounds]; reload _veh;//needed }; //every time you need to add a custom amount of ammo _magType = "5000Rnd_762x51_Belt"; _rounds = 12; _veh = YourVehicle; _turretPath = [1];//pilot side gunner on the RHS UH-60M, other door gunner would be [2] _addAmmo = [_veh,_rounds,_turretPath,_magType] call TAG_fnc_addAmmoCount Cheers
  17. Allright, could be as simple as this: //initPlayerLocal.sqf YourFlagpole addAction ["Enroll in the ITC program",{[_this#1] joinSilent createGroup west},[],6,true,true,"","_this isEqualTo vehicle _this and side _this isEqualTo civilian",5] Won't show for anyone but civilians, so once they join an individual blufor group they will no longer see this action. Cheers
  18. Yep, usually topping out at 55-60fps in my own SP "adventures" with what seems to be a similar unit and object count, scratching around between 25-30fps in the first mission so far with the same settings (all on ultra) but view and object distance to 1000m. Basically same experience as @darkChozo here. Regarding the sound there have been quite a few DC offset clicks that I noticed, maybe worth a look, seems to be coming from one of the samples used by the Cheers
  19. Should everyone be in a single group or individual groups for every player? As already stated, be as precise as possible, doesn't really help when everyone starts posting suggestions when further detail only comes to light when those suggestions don't do what you initially had in mind. A quick bullet list of all wanted functionality goes a long way. Cheers
  20. Grumpy Old Man

    Group multiple groups in batallion

    Feel free to post if you get stuck or can't figure something out after consulting the wiki. Cheers
  21. Grumpy Old Man

    Group multiple groups in batallion

    Something to get you started: //initPlayerLocal.sqf //can populate the array with custom groups TAG_battalion = allGroups select {side _x isEqualTo side player AND {isPlayer _x} count units _x isEqualTo 0}; //make controlled groups and movements visible on map findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", " _display = _this#0; { { _icon = getText (configfile >> 'CfgVehicles' >> typeof _x >> 'icon'); _display drawIcon [_icon,[0,0,1,1],getPosVisual _x,24,24,getDirVisual _x,name _x,1,0.03,'TahomaB','right']; _display drawLine [getPosVisual _x,getPosVisual leader _x,[0,0,1,1]]; } forEach units _x; } forEach TAG_battalion; { _offSet = [15,15,0]; _iconPos = getPosVisual leader _x vectorAdd _offSet; _icon = getText (configfile >> 'cfgGroupIcons' >> _x getVariable ['GOM_fnc_groupIcon','b_inf'] >> 'icon'); _grpInfoText = _x getVariable ['GOM_fnc_groupInfoText',groupID _x]; _display drawIcon [_icon,[1,1,1,1],_iconPos,24,24,0,_grpInfoText,1,0.03,'TahomaB','left']; _display drawLine [_iconPos,getPosVisual leader _x,[0,0,1,1]]; _dest = (expectedDestination leader _x)#0; _dest set [2,0]; if (!(vectorMagnitude _dest isEqualTo 0) AND (_dest distance2d getPos leader _x) > 20) then { _display drawLine [getPosVisual leader _x,_dest,[0,0,1,1]]; _icon = getText (configfile >> 'CfgVehicles' >> typeof leader _x >> 'icon'); _display drawIcon [_icon,[0,0,1,0.5],_dest,24,24,0,'',1,0.03,'TahomaB','right']; } } forEach TAG_battalion; "]; TAG_fnc_moveMultiGroup = { params ["_groups","_spacing","_movePos","_watchDir"]; {_x move (_movePos getPos [(_spacing * _forEachIndex) - (_spacing * count _groups / 2),formationDirection (leader (_groups#0))])} forEach _groups; }; addMissionEventHandler ["MapSingleClick", { params ["_units", "_pos", "_alt", "_shift"]; _groups = TAG_battalion select {{alive _x} count units _x > 0}; [_groups,35,_pos] call TAG_fnc_moveMultiGroup; }]; Obviously needs some more tweaking, like handling the direction of the battalion etc. Could also add custom formations for all group, so groups on the edge will assume left/right echelon, center takes wedge and anything in between as line etc. Then you could make all groups assume a half circle around the target position, plenty of possibilities, heh. Edit: Here's the post containing the group icons on map snippet. Cheers
  22. Most likely the best solution to this. If you add "true" to be returned by the EH then the on screen tooltip for time acceleration change won't be displayed, according to the wiki. Cheers
  23. At least we got shotguns and tinfoil hats now. Nothing bad will come from this. Cheers
  24. Grumpy Old Man

    Help! Spawning helicopter on land

    BIS_fnc_spawnGroup returns a group. You can't use setPos on a variable holding a group, since it's a different data type. Also @beno_83au BIS_fnc_spawnGroup uses BIS_fnc_spawnVehicle to spawn vehicles, which also spawns vehicles according to their simulation type, in this case aircraft will be spawned using createVehicle with "FLY" parameter. Only solution would be to write a custom group spawner or force the vehicle on ground using setPosATL and turn engine off or similar. Cheers
  25. Grumpy Old Man

    selectDiarySubject Help

    Can't seem to get any of them to work. Cheers
×