Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Larrow

Member
  • Content Count

    3612
  • Joined

  • Last visited

  • Medals

Everything posted by Larrow

  1. Eden Composition Spawning Been working my way through this problem every time i have 5 mins between other stuff. Looking for testers willing to test out compositions. I have put it through some simple testing and the test mission comes with some examples as player actions. DOWNLOAD Save a composition in Eden and then in your profiles folder (usually MyDocuments\Arma 3\) in the compositions folder find its composition.sqe. Copy its .sqe and place it in your mission folder in a folder called Compositions and rename it to something remember-able. Copy the LARs folder to your mission. Add to your description.ext.. class CfgFunctions { #include "LARs\spawnComp\functions\functions.cpp" }; #include "compositions\compositions.cfg" Create a file called compositions.cfg in your missions composition folder that you created above and add a class for your composition. e.g //LARs_spawnComp_debug = 1; //1 = RPT output, 2 = RPT output and ingame visual positioning info class CfgCompositions { class Walk { //Name that the composition is spawned by #include "walk.sqe" //Renamed composition.sqe }; }; Then when you want to spawn a composition.. _compReference = [ COMP_NAME, POS_ATL, OFFSET, DIR, ALIGN_TERRAIN, ALIGN_WATER, IGNORE_ATLOFFSET ] call LARs_fnc_spawnComp; Where.. COMP_NAME - Classname given to composition in CfgCompositions POS_ATL( optional, default compositions saved position ) - Position to spawn composition If not given or empty array passed then original saved composition position is used Also accepts OBJECT, MARKER, LOCATION OFFSET( optional, default none ) - ARRAY [ x, y, z ] ammount to offset composition, as a compositions base pos can vary from what you want when its saved DIR( optional, deafault 0 ) - Direction to face composition in, If POS_ATL is of type OBJECT, MARKER, LOCATION passing TRUE for direction will use objects direction ALIGN_TERRAIN( optional, default True ) - BOOL, Whether composition objects should align themselves to their positions surface normal ALIGN_WATER( optional, default True ) - BOOL, If a composition objects position is over water should they align themselves to sea level IGNORE_ATLOFFSET( optional, default False ) - BOOL, If True each item in the composition will ignore its ATLOffset that usually gets added to its Z(height) !FUCNTIONALITY CHANGED! The function call will also return a reference string for the composition. Which can be used with some of the provided utility functions. [ _compReference ] call LARs_fnc_deleteComp; Will delete the composition. [ _compReference ] call LARs_fnc_getCompObjects Will return an array of all the compositions items. [ _compReference, _item ] call Lars_fnc_getCompItem Passing an Object will return its composition ID or -1 if not found. Passing an ID will return the object or objNull if not found. [ _item ] call LARs_fnc_getItemComp Will return a the reference to the composition the item belongs to or "". Checking the RPT with LARs_spawnComp_debug = 1 set in the composition.cfg when spawning a composition will display info on the objects spawned. e.g 12:29:04 "spawning - Object B_Soldier_A_F - ID: 51, VarName target1" Where it displays.. Type being Group, Object, Trigger, Logic, Marker or Waypoint Classname of object ie B_Soldier_A_F Composition ID 51 For Object, Trigger, Logic it will show its VehcileVarName if it was spawned with one. For Group it will display the groupID For Marker its given name and Waypoints their waypointName ('identified' option in Eden) Priority order of which composition items are spawned in. You may need to get funky with object names, especially markers as they cannot exist twice and things like task names in modules. Although you can use the utility functions to get a reference to objects and link out side resources yourself as another possible solution. Again has been put through very limited testing. As you can see by the examples I have a... Camp Ant spawning with added foot patrol and a vehicle that executes a waypoint synced to one of the patrols waypoints. A man that will cycle his route. A working sector. A simple task using modules. A simple mission using modules, a random vehicle spawning at grouped markers with a unit init to moveIn and blowing it up via a trigger when it reaches a waypoint to complete task. Set up Roadblock, if near a road will spawn a checkpoint aligned with the roads direction. There are several others that i have written short description for in the CfgCompositions. Most likely missed loads of stuff 😕 and I know I have not test trigger and waypoint effects. So if you feel like testing it out and supplying feedback of what is/isnt working(a small example .sqe would be handy for tracking problems down) ... DOWNLOAD as I just do not have the time to test every conceivable permutation myself. Updates:
  2. Description.ext is missionConfigFile instead.
  3. Added some comments, untested, not sure if it will fix your particular problem.
  4. Short answer... _actionCode = { params [ "_target", "_caller", "_id", "_args" ]; // _args will be [_baseEntry1] as passed _args params[ "_to" ]; // _to will be _baseEntry1 Long answer, maybe an easier way to make the connections (this is presuming all exit/entries of the same number are tied to each other entry_1 goes to exit_1 and visa versa)...
  5. Why init.sqf ? So this is happening everywhere! Should just be initServer.sqf and then remoteExec the loadout script to where the unit is local, due to some of the commands being LA. //initServer.sqf // detect and change all editor placed units { [_x] call CB_fnc_factionConfig; } forEach ( allUnits select { _x isKindOf "CAManBase" && { !isPlayer _x }} ); // add MEH to catch anything spawned CB_MEH_factions = addMissionEventHandler ["EntityCreated", { params ["_entity"]; if ( _entity isKindOf 'CAManBase' && { !isPlayer _entity }) then {[_entity] call CB_fnc_factionConfig}; }]; //CB_fnc_factionConfig // handles params[ "_unit" ]; //Everything here will already be CAManBase and !player //ignore special units with this variable // factions to re-paint private _scriptName = switch ( faction _unit ) do { case ( "BLU_F" ) : { "BLUFORnato" }; case ( "BLU_CTRG_F" ) : { "BLUFORspecops" }; case ( "BLU_G_F" ) : { "BLUFORion" }; case ( "OPF_F" ) : { "OPFORcsat" }; case ( "OPF_R_F" ) : { "OPFORspecops" }; case ( "IND_G_F" ) : { "INDFORfia" }; case ( "IND_C_F" ) : { "INDFORspecops" }; case ( "CIV_F" ) : { "CIV" }; }; [ _unit ] remoteExec[ format[ "CB_fnc_loadout_%1", _scriptName ], _unit ];
  6. Strange, I have just tested it on my dedicated with no issues. Are you seeing any errors in the server or clients RPT? Is it maybe a copy and paste issue from the forum inserting hidden characters?
  7. Lazy evaluation, part in curly braces is only done if the previous statement is true/satisfies the overall statement. Yes, if _shooter isNil then isNull _shooter makes no sense. If isNull _shooter is in braces then isNil returns true which satisfies the OR statement so isNull will never be evaluated.
  8. I have changed the saved data from the server's profileNamespace to missionProfileNamespace instead. Just a better idea all around... you can use this system on multiple missions without it interfering with each other, or even share if needed you can use allVariables command on it to collect all data for deletion. I have changed the data from a single var for each piece of information ( e.g KIB_#_Pos, KIB_#_Rating ) to KIB_playerData_# ( where # is the reference to the player, as per previous either varName or uid ) which is an array holding ALL the data for that player. Makes it easier to find/delete without having to poll multiple vars. I have made an action menu for the logged in admin so they can manage the data... "Show Admin Menu" - Will display the options below "Delete Players Position" - Will delete the position data for the current player you are looking at "Delete Players Rating" - Will delete the rating data for the current player you are looking at "Delete Players Data" - Will delete all data for the current player you are looking at "Delete All Players Positions" - Will delete position data for all currently connected players "Delete All Players Ratings" - Will delete rating data for all currently connected players "Delete All Players Data" - Will delete all data for all currently connected players "Delete ALL Data" - Will delete all data EVERYTHING that has ever been saved "Close Admin Menu" - Will remove the options above other than Show Menu just so you can clear the clutter from your action menu Again totally untested, let me know if there are any problems. Update: New version that saves players starting position, added options to admin menu to reset position/rating. TEST MISSION
  9. //initServer.sqf KIB_fnc_getPlayerData = { params[ "_player" ]; if ( vehicleVarName _player == "" ) then { _player setVehicleVarName format[ "Player_%1", getPlayerUID _player ]; _player call BIS_fnc_objectVar; }; [ profileNamespace getVariable[ format[ "KIB_%1Pos", vehicleVarName _player ], getPosATL _player ], profileNamespace getVariable[ format[ "KIB_%1Rating", vehicleVarName _player ], 0 ] ] remoteExec[ "KIB_fnc_setPlayerData", remoteExecutedOwner ]; }; KIB_fnc_savePlayerData = { params[ "_player" ]; profileNamespace setVariable[ format[ "KIB_%1Pos", vehicleVarName _player ], getPosATL _player ]; profileNamespace setVariable[ format[ "KIB_%1Rating", vehicleVarName _player ], rating _player ]; }; KIB_fnc_updatePlayerData = { params[ "_player" ]; while { true } do { [ _player ] call KIB_fnc_savePlayerData; sleep 300; }; }; //initPlayerLocal.sqf KIB_fnc_setPlayerData = { params[ "_position", "_rating" ]; //Only allow execution from the server if ( isMultiplayer && { !isRemoteExecuted || { remoteExecutedOwner isNotEqualTo 2 }} ) exitWith {}; //Set rating, not add to what they already have player addRating ( _rating - rating player ); player setPosATL _position; //Only once saved/defaults have been applied start saving data [ player ] remoteExec[ "KIB_fnc_updatePlayerData", 2 ]; }; params[ "_player" ]; [ _player ] remoteExec[ "KIB_fnc_getPlayerData", 2 ];
  10. this and { player in triggerAttachedVehicle thisTrigger } Not that it makes any difference but if you are attaching a vehicle as an owner there is a command to retrieve the said vehicle.
  11. Is just... private _selectedMission = _availableMissions deleteAt floor( random count _availableMissions );
  12. When dealing with this you can use the side of the group of the unit. _realSide = side group _deadUnit; Does this exist? This variable will be Nil until the display is being shown and its onLoad has happened. This... ... can be replaced with just... _color = side group _oldUnit call BIS_fnc_sideColor; Surely when the mission starts this is just the side/group of the player. Not quite sure what you mean by team. Could this not be done with createMarker of type ICON, then the information would be available to all maps rather than handling them individually by placing drawIcon's on them all/
  13. Well the MOVE command from the same menu ( when you add a waypoint ) has a similar function call... //--- Add waypoint _codeWP = _logic getvariable 'GUI_WP_MOVE'; _script = [_is3D,_pos,_shift,_ctrl,false,_selected] spawn _codeWP; However, I would not change this directly as I believe it is already set by the HC system... However, you will notice this code also has a call to a function stored on the HC logic. //--- Move handler _handler = _logic getvariable "onGroupMove"; if (!isnil "_handler") then {[_group,_wp,grpnull] spawn _handler}; This _handler is run both when adding a new waypoint(MOVE) or issuing an WP ATTACK. Although I am not sure if this is already in use by the system ( did a quick grep and could not see it set anywhere ). So you could use this to cancel the doStop by issuing a doFollow as suggested on the wiki doStop page. BIS_HC_1 setVariable ["onGroupMove", { params[ "_group", "_wp" ]; units _group doFollow leader _group; }, true]; Or there is always the missionEventhandlers for onGroupClicked, or it may even be possible to inject your own command into a subMenu of RscHCGroupRootMenu see how #USER:HCWPWaitRadio etc are manipulated in hc_gui.sqf . Having a good read through the hc files in \a3\modules_f\hc\data\scripts would be a good idea and may lead you to some ideas.
  14. Are you sure the onTaskCreated code is passed anything at all in _this? Try testing what is being passed... BIS_HC_1 setVariable ["onTaskCreated", {hint format["_this is %1", [str _this,"nil"] select (isnil "_this")]}, true]; EDIT: According to hc_gui_menu.sqf it is passed the current waypoint the user is hovering over on the hc map. So your then saying... [GROUP, INDEX] call CBA_fnc_taskDefend ...Which is not what CBA_fnc_taskDefend expects Are you sure your error is not coming from CBA function? If you just want the defaults from taskDefend by just passing the group... BIS_HC_1 setVariable ["onTaskCreated", {_this #0 call CBA_fnc_taskDefend}, true];
  15. //Random composition// _random_comp = selectRandom [ "Fire_Area", "Fire_Area_Big"]; //Spawn composition// random_fire_reference = [_random_comp, location1] call LARs_fnc_spawnComp; //***other code***// //Delete composition// random_fire_reference call LARs_fnc_deleteComp; hint format ["Composition cancelled %1", random_fire_reference];
  16. _compReference call LARs_fnc_deleteComp; _compReference holds the returned STRING. However, you need to make sure _compReference is still valid, not nil, not gone out of scope. Maybe store it somewhere with setVariable or make it a global variable if it's the only comp you're dealing with.
  17. Store the handle on the trigger using setVariable. _handle = ppEffectCreate ["FilmGrain", 2000]; _handle ppEffectEnable true; _handle ppEffectAdjust [0.3, 0.15, 1, 0.2, 0.5, 0]; _handle ppEffectCommit 3; thisTrigger setVariable[ "ppEffect", _handle ]; //terminate with ppEffectDestroy ( thisTrigger getVariable "ppEffect" );
  18. No, just easier to read, if you need to change anything it only has to be done in one place rather than multiple times in a large amount of code. So maybe yes, for your fingers and eyes 😄
  19. As all groups are handled the same you could just do something like...
  20. You are adding to the wrong idc. This comes from the lbSetData, data can only be STRING you're trying to add an OBJECT _x. Give the player a varName and use that instead. lbSetData [11500, _forEachIndex, _x call BIS_fnc_objectVar]; To tele to them... _player = lbData[ 11500, _index ]; player setPosATL getPosATL ( missionNamespace getVariable _player );
  21. /* Prevents dedicated server running script */ if (isDedicated) exitWith {}; //Never going to be dedicated if calling from an action /* Private variables */ private ["_cqcLiveTargets","_cqcSpawns","_azimuth"]; /* createGroup [side, deleteWhenEmpty] needed for createUnit function later */ private _cqcLiveTargets = createGroup east; /* Define spawn locations using variable names of leaflets as markers */ private _cqcSpawns = [cqcspawn_001,cqcspawn_002,cqcspawn_003,cqcspawn_004,cqcspawn_005,cqcspawn_006,cqcspawn_007]; /* type createUnit [position, group, init, skill, rank] function for spawning a unit */ //Would recommend using the other syntax of create unit { "O_G_Soldier_lite_F" createUnit [ getPosATL _cqcSpawns, //Passing whole array, should be _x current forEach element _cqcLiveTargets, //STRING in STRING notice color of MOVE //Unit is this not _this //again dir of _cqcspawns array not _x "call{_this disableAI "MOVE"; _azimuth = getDir _cqcspawns; _this setDir _azimuth;}", 0.1, "PRIVATE" ];} forEach _cqcSpawns;  So...
  22. Should be possible. All task information ( Task Framework tasks ) have their info stored in a set of missionNamespace variables "@taskID.INDEX" . See... \a3\functions_f\tasks\defines.inc ( for handy macros and INDEX values ) \a3\functions_f\tasks\fn_createTask.sqf ( all this func does is processes params and passes it to below func ) \a3\functions_f\tasks\fn_setTask.sqf ( task information is processed here, which then calls the below based on task owners ) <<This one should give you most of what you need to know \a3\functions_f\tasks\fn_setTaskLocal.sqf ( this is where each TASK is actually created per client/task owner ) So should be something like using missionNamespace vars to collect tasks info, save it off to profile, on mission reload check for saved tasks, gather info from profile and pass them back through taskCreate. Most likely need a few tweaks like making sure any parent tasks are handled first, any objects destination/task owner etc are saved and restored as objectVar's etc. Dont expect the below to work, its just some rough code to get the point across...
  23. Done, updated parameter info and added an example.
  24. That example is correct, add the magazine "SmokeLauncherMag" to the turret at path [0,0]. AmmoCount was a later edition to the command after those examples were written, as such neither example shows using ammoCount.
×