Jump to content

Larrow

Member
  • Content Count

    3586
  • Joined

  • Last visited

  • Medals

Everything posted by Larrow

  1. They are only arrays and are stored on the player in the variable BIS_fnc_addCommMenuItem_menu. You can update these arrays and call refresh on the commenu to update it. Maybe this thread helps?
  2. Could always use the locality EH, give each vehicle in your system some variable to flag whether they are currently protected, something like... //server THY_fnc_handleProtection = { params[ "_veh", "_isProtected" ]; _veh setVariable[ "THY_isProtected", _isProtected, true ]; //Flag protected state to all machines //add protection base on current locality if ( local _veh ) then { _veh allowDamage !_isProtected; }else{ [ _veh, !_isProtected ] remoteExec[ "allowDamage", owner _veh ]; }; //Only has to be added once for the life of the vehicle if ( _veh getVariable[ "THY_hasLocalityProtection", false ] ) then { _veh setVariable[ "THY_hasLocalityProtection", true ]; //add EH to all machines for when the vehicle changes locality [ _veh, [ "local", { params[ "_vehicle", "_isLocal" ]; //Is the vehicle still flagged as protected && is local if ( _isLocal && { _vehicle getVariable[ "THY_isProtected", false ] } ) then { _vehicle allowDamage false; }; }] ] remoteExec[ "addEventHandler", 0, _veh ]; //and JIP whilst _veh still exists }; }; Then your check loop... while { alive _obj } do { { // forEach _zonesBySide: // Internal Declarations: _rng = _x # 1; _zonePos = _x # 2; // if inside the protection range: if ( _obj distance _zonePos <= _rng ) then { // Makes _obj unbreakable: [ _obj, true ] call THY_fnc_handleProtection; waitUntil { // Looping breather: sleep 3; // If obj's dead: !alive _obj || // If obj's not in zone: _obj distance _zonePos > _rng }; // Not inside the zone: if ( alive _obj && _obj distance _zonePos > _rng ) then { // Restores the _obj original fragility: [ _obj, false ] call THY_fnc_handleProtection; }; }; // Breather: sleep 3; } forEach _zonesBySide; }; // While-loop ends. Will need to reset THY_hasLocalityProtection to false / nil on all respawned vehicles as the module copies all object variables across to the new one. Think that works out correctly as long as addEventhandler and allowDamage are remote executable.
  3. Try these from the debug console... private _rpos = [] call BIS_fnc_randomPos; _rpos; //[ #, #, # ] private _rpos = [] call BIS_fnc_randomPos; _rpos resize 1; _rpos; // [ # ] private _rpos = [] call BIS_fnc_randomPos; _rpos = _rpos resize 1; isNil "_rpos"; // true
  4. Correct, thats why i wrote [ #, #, # ] position 3D, but you then resize the array to one indice so it would now be just [ # ], but you also overwrite _rpos with the return from resize but resize does not return anything so _rpos is nil.
  5. This... ...is just... GLOBAL_moduleList = entities "ModuleRespawnVehicle_F"; systemchat str GLOBAL_moduleList; ...entities already does the filter by type, no need to do it manually.
  6. This again I would guess at being a discrepancy between reference and varName. The initial [ car1, car2 ] would relate to the vehicles varName, where as car1 in would rely on the reference being set up correctly.
  7. The vehicle once respawned is never resynched with the module, it works via recursion of the function handled by the events placed on the vehicle. This should tell you whether a vehicle is set to respawn or not... if ( //By recursion from events ( !( _veh getVariable[ "BIS_fnc_moduleRespawnVehicle_first", false ] ) && { !isNil{ _veh getVariable "BIS_fnc_moduleRespawnVehicle_mpKilled" } } ) || //By initial sync { _veh in synchronizedObjects MyModuleDroppedOnEden } ) then { true }else{ false }; Could likely just check whether BIS_fnc_moduleRespawn_mpKilled is not nil, just being verbose to allude to what is happening.
  8. No need to do this, the respawn module handles this for you already (both giving the vehicle a varName at mission start AND renaming the newly spawned vehicle to the old name). Your problem comes from you renaming the vehicle and not wanting to set a default name using the editor. Not sure what script scope has to do with this. Either name the vehicle in the editor. OR modify the way you are changing its name... private [..., ..., ...]; _counter = 0; { //Only if it doesnt already have a varName if ( vehicleVarName _x == "" ) then { _counter = _counter + 1; _var = "veh" + (str _counter); _x setVehicleVarName _var; _x call BIS_fnc_objectVar; }; _allVehicles pushBack _x; } forEach (nearestObjects [_zonePos, ["Car", "Tank"], _zoneRange]); This will leave vehicles synced to the respawn module named as per the editor(which you say you are not doing) or by the default varName given to them by the respawn module. If they have neither then they will be named "veh#" where # is your counter. If you must rename all the vehicles then instead... private [..., ..., ...]; _counter = 0; { //Only if it doesnt already have a varName starting with "veh" if ( vehicleVarName _x select[ 0, 3 ] != "veh" ) then { _counter = _counter + 1; _var = "veh" + (str _counter); _x setVariable[ "#var", nil ]; //Remove BIS_fnc_objectVar reference to name set by respawn module _x setVehicleVarName _var; _x call BIS_fnc_objectVar; }; _allVehicles pushBack _x; } forEach (nearestObjects [_zonePos, ["Car", "Tank"], _zoneRange]); As the vehicles are not named in the editor, any that start synced to the respawn module will be automatically named at the mission start by the module. The module uses BIS_fnc_objectVar to name them, when named by BIS_fnc_objectVar a variable or "#var" is placed on the vehicle of its given name. Any changes to its varName and using BIS_fnc_objectVar (of which the module uses both on mission start and when repsawning and transferring the name) to update its reference will... If it has no varName Has it been set before (has "#var" variable) then use contents of #var to rename it and set reference Give it a name based off of BI's internal counter "bis_o#" where # is the counter value and set its reference if it has a varName Has it been set before (has "#var" variable) then use contents of #var to set reference Give it reference based off of its current varName
  9. Yes you set a variable in the namespace but it was not exported to the file (profile). Game loads Profile vars loaded from file into namespace Vars updated in namespace var setVariable File updated by either... Closing game correctly By saveProfileNamespace
  10. Larrow

    Issues with setVehicleVarName

    setVehicleVarName does NOT create a global variable, or allow you to reference said unit by the given name. You also have to setup said global variable. _civUnit = _grp createUnit [_classname, _pos, [], 0, "NONE"]; _civUnit setVehicleVarName _identifier; missionNamespace setVariable[ _identifier, _civUnit, true ]; //OR _civUnit = _grp createUnit [_classname, _pos, [], 0, "NONE"]; _civUnit setVehicleVarName _identifier; [ _civUnit ] call BIS_fnc_objectVar;
  11. They are not functions. They are variables associated with the function that lets you see the current values stored by the module/system. Type them into the watch lines of the debug console in a running mission to see what they currently hold and may give you a lead on what is happening.
  12. Here are some missionNamespace variables you can check to see what is happening. bis_fnc_moduleSpawnAISectorTactic_sectors A list of sectors the Tatic module is currently monitoring bis_fnc_moduleSpawnAISectorTactic_areas A list of sector areas the Tactic module holds for all sectors bis_fnc_moduleSpawnAISectorTactic_sectorsWest bis_fnc_moduleSpawnAISectorTactic_sectorsEast bis_fnc_moduleSpawnAISectorTactic_sectorsGuer A list of sectors the Tactic module currently considers captured by side bis_fnc_moduleSpawnAISectorTactic_sectorsNonWest bis_fnc_moduleSpawnAISectorTactic_sectorsNonEast bis_fnc_moduleSpawnAISectorTactic_sectorsNonGuer bis_fnc_moduleSpawnAISectorTactic_sectorsUnknown _group setVariable ["bis_objective",_objective,true] Each group has a variable set on them of their current sector they are to attack.
  13. The SpawnAI Module has an expression field that can be used to place code. This expression field receives parameters that include the group it spawned, so you can use this with addCuratorEditableObjects to assign them editable by Zeus.
  14. Larrow

    Spawn only modded units

    You could accomplish this with CfgGroups as well. Then use BIS_fnc_spawnGroup or the spawnAI module to spawn said groups. If the provided mod/dlc does not provide custom CfgGroups for their assets I made a post here about how to setup your own.
  15. What type of respawn are you using? Could be as simple as an option in the description.ext
  16. Adding an item does NOT create an object. There is no physical presence, just data that the backpack contains an item called "Laptop_Closed". An object is not created until the item is dropped in the world. You would need to keep track of whos carrying the item and monitor events like put/take to see if it ever gets dropped/looted.
  17. You can also do this without using the Condition. Right-click the group you want and under Connect choose set trigger owner, then choose the trigger. Open the trigger settings and you will see that there are now new options under Activation one being Whole Group.
  18. To be honest if your gonna swap to pixelGrid system I would redefine your grid size from scratch based on grids, rather than arbitrary screen percentages. Maybe these previous discussions help? Dialog Math, Safezone Values and PixelGrid
  19. Yes, but it is slow and looks like crap and would have to be done every time the ui is shown. Could possibly do it with macros so its updated as the game loads the config. Would still mean you have to go through and update all x,y,w,h definitions though.
  20. x = 0.00492199 * safezoneW; Well, this is basically saying start at .4% of the screen's width. ( from 0 x which is not the left side of the screen ) x = "safezoneX + (5 * pixelGridNoUIScale * pixelW)"; this is saying start at the left edge of the screen( safeZoneX ) plus 5 grids converted to pixel widths. Where a pixel width is in screen space dimensions( width of screen ). So... //Divide value by width of a pixel, rounded to the nearest pixel. _numPixels = round( 0.00492199 / pixelW ); //num pixels divide by number of pixels in a pixel grid _numGrids = _numPixels / pixelGridNoUIScale; This will give you how many pixels grids your original value was. Rounded so your position is pixel-perfect. Which you can then plug into your UI. So... x = _numGrids * ( pixelW * pixelGridNoUIScale ); Replace _numGrids with the answer from the previous calculation. This, Arma 3: Pixel Grid System ,maybe helpful.
  21. [ unit, requester, provider ] call BIS_fnc_addSupportLink Sync your requester and provider module together in the editor, then in the trigger statement use the above to link them to the player you want to give access.
  22. Use params on the data instead of select, so you can give it some defaults if the data doesn't exist. Then you won't get any indexing errors. getUnitLoadout _classname params[ [ "_primaryDetails", [] ], [ "_secondaryDetails", [] ], [ "_handGunDetails", [] ] ]; _primaryDetails params[ [ "_primaryWeapon", "" ] ]; _secondaryDetails params[ [ "_secondaryWeapon", "" ] ]; _handGunDetails params[ [ "_handGun", "" ] ]; if ( _primaryWeapon == "" && _secondaryWeapon == "" && _handGun == "" ) exitWith { false };
  23. Goto your dropbox files, right click the image file and copy link (just like you would when putting something up for download), in your post click the 'insert other media' button (bottom right) choose "insert image from URL", paste the link but change dl=0 to raw=1. Job done. For instance a picture on my dropbox, change... ...to... Gives you this...
×