Jump to content
  • Topics

  • Posts

    • I have a custom player marker system. For the most part, it functions fine. However I had to implement some workarounds. 4 sides PVP only (Blufor, Opfor, Independent and Civilian.)
      Simply put, it creates markers on the map and gps minimap for each teammate, in addition to one for the player. 

      However, since I am making use of civilians as a playable faction, they occasionally showed up with Blufor's team markers until I set side relations and -10000 rating for each civilian. Once that was solved I ran into a new issue: (I didn't know this) Players apparently become civilians from the moment they die until they respawn - meaning civilian positions would be relayed to a non civilian player. 
      As such, I figured I might be able to make the regular markers only appear when the player is alive. That worked. So I also figured I could make some OTHER markers display based on _oldUnit in onPlayerRespawn. But I get nothing. My intent is to have RespawnOnStart = 0, so that _oldunit would have a chance to be set, because while I am sure there's a way to get the team the player selected in the lobby and display markers based on that but I wouldn't quite know where to begin.

      onPlayerRespawn.sqf params ["_oldUnit", "_killer", "_respawn", "_respawnDelay"]; _miniMapEH = ((uiNamespace getVariable "RscCustomInfoMiniMap") displayCtrl 101) ctrlAddEventHandler ["Draw",  {         private ["_color"];                            switch (side _oldUnit) do              {                 case west:                  {                     _color = [0, 0.3, 0.6, 1]; // Blue color for BLUFOR                 };                 case east:                  {                     _color = [0.5, 0, 0, 1]; // Red color for OPFOR                 };                 case independent:                  {                     _color = [0, 0.5, 0, 1]; // Green color for Independent                 };                 default                 {                     _color = [0.4, 0, 0.5, 1]; // Purple color for Civilian                 };             };                      // Loop through all playable units to draw icons for each player on the same side             {                 if (side _x == side _oldUnit) then                  {                     // Draw colored dot icons for team players on the map                     _this select 0 drawIcon [                     "\A3\ui_f\data\map\markers\military\dot_CA.paa", // Icon path                     _color, // Color based on player's side                     getPosASLVisual _x,                     32, // Icon width                     32, // Icon height                     getDirVisual _x,                     "", // Empty text                     1, // Scale                     0.04, // Text size                     "PuristaMedium", // Text font                     "right" // Text align                     ];                                                                                   _this select 0 drawIcon [                         "\A3\ui_f\data\map\vehicleicons\iconManVirtual_ca.paa", // Icon path                         [1, 1, 1, 0.65], // White color with 65% opacity                         getPosASLVisual _x,                         25, // Icon width                         25, // Icon height                         getDirVisual _x,                         name _x, // Name                         1, // Scale                         0.04, // Text size                         "PuristaMedium", // Text font                         "right" // Text align                         ];                                    };             } forEach allUnits;              }]; diag_log format ["_oldUnit Side: %1", side _oldUnit];  
    • Nice work - I've always thought about doing something like this.   Have you thought about modelling some real military ration packs for more of the military side of things?
    • If you pay attentionyou can see before the end of the timer something moved and get ping as an enemy. Then as the timer end kill one of us in spawn and we kill him. He moving before the game start   https://youtube.com/watch?v=WOYYotncC44&feature=shared
    • hey welcome to the Arma mission making zone ^_^,   to get started I really recommend you explore the Arma documentation https://community.bistudio.com/wiki/Category:Arma_3:_Scripting_Commands,  all the explanation of the magic is there in the documentation, or you could try tutorials on youtube to get started ^_^   so to spawn a unit Arma uses "createUnit" command, a unit needs a group it can be your group, to add a unit to your group, you get your group with the command: private _playerGrp = group player; next you place down the unit you want to spawn and copy his class by right clicking him and going to Log >> Log Classes to Clipboard, after you got the class into your clipboard you delete the unit and use the "createUnit" command to spawn in the unit to a group https://community.bistudio.com/wiki/createUnit private _unit = _playerGrp createUnit ["B_crew_F", getPosATL player, [], 0, "FORM"]; that is kinda the basics on how you spawn a unit in Arma, but to actually spawn in some units for empty vehicle seats, driver, gunner, etc..., here is a script I wrote(that probably took less then a second, probably 😃 ) spawnAssistantUnits = { params ["_veh","_unitGrp","_unitClass"]; // if provided object is not a vehicle, exit if (_veh isKindOf "Man") exitWith {}; // get commander seat, gunner seats, driver seat private _commander = commander _veh; private _turrets = allTurrets _veh; private _driver = driver _veh; // spawn commander if there is no unit in commander seat if (isNull _commander) then { private _unit = _unitGrp createUnit ["B_Soldier_F", getPos _veh, [], 0, "FORM"]; _unit assignAsCommander _veh; [_unit] orderGetIn true; _unit moveInCommander _veh; // if vehicle doesn't have a commander seat, delete unit if (vehicle _unit == _unit) then { deleteVehicle _unit; }; }; // spawn driver if there is no unit in driver seat if (isNull _driver) then { private _unit = _unitGrp createUnit ["B_Soldier_F", getPos _veh, [], 0, "FORM"]; _unit assignAsDriver _veh; [_unit] orderGetIn true; _unit moveInDriver _veh; // if vehicle doesn't have a driver seat, delete unit if (vehicle _unit == _unit) then { deleteVehicle _unit; }; }; // get current full crew of the vehicle private _fullCrew = fullCrew _veh; // get occupied turret paths private _occupied_turret_paths = []; { private _x_seatType =_x select 1; private _x_turretPath =_x select 3; _occupied_turret_paths pushBack str(_x_turretPath); } forEach _fullCrew; // spawn units for gunners empty { private _x_str_turret = str(_x); // if turret gunner doesn't have a unit assigned if (!(_x_str_turret in _occupied_turret_paths)) then { // then spawn unit private _unit = _unitGrp createUnit ["B_Soldier_F", getPos _veh, [], 0, "FORM"]; _unit assignAsTurret [_veh, _x]; [_unit] orderGetIn true; _unit moveInTurret [_veh, _x]; }; } forEach _turrets; }; the above function might not work in 3DEN editor object inits, but you can in your mission folder directory "Documents\Arma 3\missions\YourMissionName", inside the folder create a file named "init.sqf", and paste the above code there, next you want to radio activate to call the function [vehicle player, group player, "B_Soldier_F"] call spawnAssistantUnits;   to call the function through radio commands, place a trigger, set activation type to "Radio Alpha" and give it a text, now in "On Activation" paste the above code, you can now hop into any vehicle and and press 0, 0 2x and you should see your text which would spawn in some units to all the empty gunner, driver, commander seats, also make sure you set the trigger to repeat or you can only call the function once   P.S: why am I seriously writing all this down?, simple because I got nothing to do ^_^, also don't feel pity for me for wasting my time writing all the code, I'm a fast typer 😃   
×