BL1P 35 Posted December 18, 2014 I run a script which adds insignias to players based on inhouse factions within our clan. That all works fine, player has both Xml and insignia... until they use the Virtual Arsenal to get a new uniform. When a uniform is added to the player from the Arsenal the insignias get removed but the Xmls stay. We use a whitelist Virtual Arsenal. Anyone know of a work around for this ? Thanks in advance. BL1P. Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted December 18, 2014 I run a script which adds insignias to players based on inhouse factions within our clan.That all works fine, player has both Xml and insignia... until they use the Virtual Arsenal to get a new uniform. When a uniform is added to the player from the Arsenal the insignias get removed but the Xmls stay. We use a whitelist Virtual Arsenal. Anyone know of a work around for this ? Thanks in advance. BL1P. https://community.bistudio.com/wiki/Arsenal Access You can use Arsenal in a scenario you're designing simply by calling the following function: [] spawn BIS_fnc_arsenal; This version has several limitations as opposed to the Virtual one: Voice, Face and Insignia are not available (to avoid clashing with profile) Not all assets are automatically present, designer has to whitelist allowed classes. By default, only player's current equipment is available. There are several ways around this. Just have to have a profile function that gets called when you close the interface. As for how to go about that... Can either have a separate button somewhere, or run some code when the Arsenal display opens, and then when the display closes, the loop terminates and your profile function is called to load these insignia things. As for how to do that? I think Xeno nailed it in Dom 3.00 with the cleanest way of opening the Arsenal display, using InventoryOpened event handler. Can also add some code in which waits for the arsenal display to open, and then waits for it to close. Once closed, your profile function gets called. Not that helpful I'm sure, but I think it points you toward a solution. Share this post Link to post Share on other sites
BL1P 35 Posted December 18, 2014 (edited) https://community.bistudio.com/wiki/ArsenalThere are several ways around this. Just have to have a profile function that gets called when you close the interface. As for how to go about that... Can either have a separate button somewhere, or run some code when the Arsenal display opens, and then when the display closes, the loop terminates and your profile function is called to load these insignia things. As for how to do that? I think Xeno nailed it in Dom 3.00 with the cleanest way of opening the Arsenal display, using InventoryOpened event handler. Can also add some code in which waits for the arsenal display to open, and then waits for it to close. Once closed, your profile function gets called. Not that helpful I'm sure, but I think it points you toward a solution. Thanks m8 but... I cannot find what to use to find out if the Arsenal is opened or is closed. there doesn't seem to be any information on those variables. PS. We dont want to open the Virtual Arsenal anywhere but at base. Elite difficulty no 3rd too easy etc etc :) Edited December 18, 2014 by BL1P Share this post Link to post Share on other sites
Nagrom 10 Posted December 20, 2014 Hello, I don't have solution for your problem but I'm very interested about your script. Is it possible to share it please? I've not found anything like that and i thinks it's very usefull for a clan. Thank you and good luck for your issue Share this post Link to post Share on other sites
BL1P 35 Posted December 21, 2014 (edited) Hello,I don't have solution for your problem but I'm very interested about your script. Is it possible to share it please? I've not found anything like that and i thinks it's very usefull for a clan. Thank you and good luck for your issue Hello Relianor. I think you mean the inhouse factions right ? Step : 1 create a file in a folder in the SERVERS Arma3 root folder. We called our folder dRnF (Dedicated Rejects and Friends) and place an .sqf in there. we called ours dRFriends.sqf Our list is obviously quite a bit larger than this example I show below. private ["_players", "_player"]; _players = []; _player = ["PlayersUIDGoesHere",1,"Falcons"]; //--- BL1P - lvl 2 - Falcon _players set [(count _players), _player]; _player = [""PlayersUIDGoesHere",0,"Eagles"]; //--- ANOTHER MEMBER - lvl 1 - Eagle _players set [(count _players), _player]; _player = [""PlayersUIDGoesHere",0,""]; //--- ANOTHER MEMBER - lvl 1 - NO FACTION _players set [(count _players), _player]; _players; Step : 2 In the main mission Init.sqf we have this snippet. //--- Check if player is a dR member or friend (ran by players and server) _handle3 = execVM "core\dR_N_Friends.sqf"; waitUntil{scriptDone _handle3}; Step : 3 Create the insignias :- Place the insignia images in a folder in your mission Ours is in Core\Images Add the insignias via the description.ext. class CfgUnitInsignia { class Falcons { displayName = "Falcons"; // Name displayed in Arsenal author = "BL1P"; // Author displayed in Arsenal texture = "Core\Images\Falcons.paa"; // Image path textureVehicle = ""; // Does nothing currently, reserved for future use }; class Eagles { displayName = "Eagles"; // Name displayed in Arsenal author = "BL1P"; // Author displayed in Arsenal texture = "Core\Images\Eagles.paa"; // Image path textureVehicle = ""; // Does nothing currently, reserved for future use }; }; Step : 4 We have a folder called Core in the mission root folder with a script called dR_N_Friends.sqf inside it. This script will sort out :- Who is allowed to take command slot Who can take pilot slot Who gets which insignia Who gets which type of random welcome message ////////////////////////////////////////////// // dR_N_Friends.sqf // by Fluit n BL1P // execVM "dR_N_Friends.sqf"; ////////////////////////////////////////////// private ["_dRFriends","_IamAdRFriend", "_isAdmin", "_welcome", "_welcomeadmin", "_isFalcon"]; _IamAdRFriend = false; _isAdmin = false; _welcome = [ "Welcome back %1", "Hello %1!", "What's up %1!", "Hey its %1!", "Wotcha %1", "Ay-up %1", "Welcome home Lord %1", " %1! Thou hast returneth", "Delighted to see you %1", "Golly gosh...! if it isnt %1", "My word %1 is that a gun in your pants or are you pleased to be back?", "%1 Today try to remember G is not for Gear !!", "Accessing Bank details for %1", "player %1 Connected dangerous weapons removed", "Its a bird ! ... Its a plane !... NO its %1", "OMG! Yay! its %1", "Ladies and Gentlemen.... I present to you... %1", "%1.. %1.. %1.. hip.. hip.. hooorah", "Jolly hockey sticks its %1", "Well slap me in the face with a wet kipper... if it isnt %1", "Shhhh %1s back", "%1 connected ..... accessing password details .... password taken from %1", "The people await your orders %1." ]; _welcomeadmin = [ "Welcome back %1", "Hello %1!", "What's up %1!", "Hey its %1!", "Wotcha %1", "Ay-up %1", "Welcome home Lord %1", "%1! Thou hast returneth", "Delighted to see you %1", "Golly gosh...! if it isnt %1", "My word %1 is that a gun in your pants or are you pleased to be back?", "%1 Today try to remember G is not for Gear !!", "Accessing Bank details for %1", "player %1 Connected dangerous weapons removed", "Its a bird ! ... Its a plane !... NO its %1", "OMG! Yay! its %1", "Ladies and Gentlemen.... I present to you... %1", "%1.. %1.. %1.. hip.. hip.. hooorah", "Jolly hockey sticks its %1", "Well slap me in the face with a wet kipper... if it isnt %1", "Shhhh %1s back", "%1 connected ..... accessing password details .... password taken from %1", "The people await your orders %1." ]; systemchat "dRnF is running on this Server."; if (isServer) exitWith { dRFriendsArray = call compile preprocessFile "\dRnF\dRFriends.sqf"; publicVariable "dRFriendsArray"; }; if (isNil ("dRFriendsArray")) then { waitUntil {!isNil("dRFriendsArray")}; }; sleep 1; { if ( (getPlayerUID player) == (_x select 0)) then { // Player UID is in friend list => he is our friend _IamAdRFriend = true; if ( (_x select 1) == 1) then { // Player is an admin _isAdmin = true; }; //--- set faction Insignias player setVariable["Faction", (_x select 2), true]; switch ((_x select 2)) do { case "Falcons": { [player, "Falcons"] call BIS_fnc_setUnitInsignia; systemChat format ["Welcome %1 Fellow Falcon", name player]; }; case "Eagles": { [player, "Eagles"] call BIS_fnc_setUnitInsignia; systemChat format ["Welcome %1 Fellow Falcon", name player]; }; }; }; } forEach dRFriendsArray; player setVariable["friend", _IamAdRFriend, true]; player setVariable["admin", _isAdmin, true]; _playerType = typeOf player; if ((_playerType == "B_officer_F") && !(_isAdmin)) then {failMission "END6";}; //--- bl1p sent back to lobby if ((_playerType == "B_Pilot_F" || _playerType == "B_Helipilot_F" || _playerType == "B_helicrew_F" || _playerType == "B_soldier_repair_F") && !(_IamAdRFriend)) then {failMission "END7";}; //--- bl1p sent back to lobby if (_IamAdRFriend) then { if (_isAdmin) then { //--- level 2 systemChat format [_welcomeadmin call BIS_fnc_selectRandom, name player]; } else { //--- level 1 systemChat format [_welcome call BIS_fnc_selectRandom, name player]; }; } else { //--- level None systemChat format ["Hello %1 you are not a dR registered Friend or Member",name player]; systemChat "Contact info is in the map info... or on a Sign in base"; systemChat "Enjoy your stay"; }; Step : 5 If you plan on using the Slot restrictions you will need to create the following :- (if you dont comment that part out) In the description.ext add the following. //--- Slot restrictions #include "core\Debriefing.hpp" In the core folder add a file called Debriefing.hpp Put this in the file class CfgDebriefing { class End6 { title = "WARNING"; subtitle = ""; description = "Level 2 Access required. This slot is reserved for dr members and trusted friends. More info at http://www.dedicatedrejects.com"; pictureBackground = "core\signs\NoEntry2.jpg"; }; class End7 { title = "WARNING"; subtitle = ""; description = "Level 1 Access required. This slot is reserved for dr members and trusted friends. More info at http://www.dedicatedrejects.com"; pictureBackground = "core\signs\NoEntry1.jpg"; }; }; I have two image files in core\signs that are pictures of no entry with the level number on them. I think thats all ? Use as you wish m8, alter however you want :p Credit would be cool... dont forget Fluit :) Hope that helps m8. BL1P P.S Credit --- this method was created from a script created by TG Unk. Edited December 21, 2014 by BL1P Share this post Link to post Share on other sites
Larrow 2818 Posted December 21, 2014 There are likely lots of ways you can accomplish this BL1P. Using the uiNameSpace variable BIS_fnc_arsenal_cam will tell you whether the arsenal is open or not, its objNulll if its not open. How to check for this could also be written slightly differently dependent on how/where your calling the arsenal in the first place e.g from an ammo box, player action or from inventoryOpened. Heres some code from a quick test. It checks via an onEachFrame, its stacked ID is added to the player in a variable called "VAcatch" just incase you maybe want to turn the stacked event off (no sense checking for arsenal ever frame if the only place you can use it is while your back at base). It also checks to see if the player has changed their uniform and reapplies their insignia. Not thoroughly checked but should give you something to go from.. player setVariable [ "VAcatch", [ "VAcatch", "onEachFrame", { if ( !( isNil { _this getVariable "VAcatch" } ) && { !( isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) ) } ) then { _this setVariable [ "VAcatch", nil ]; _thread = _this spawn { _uniform = uniform _this; waitUntil { isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) }; _faction = _this getVariable [ "Faction", nil ]; if ( _uniform != uniform _this && { !( isNil "_faction" ) } ) then { [ _this, _faction ] call BIS_fnc_setUnitInsignia; }; _this setVariable [ "VAcatch", "VAcatch" ]; }; }; }, player ] call BIS_fnc_addStackedEventHandler ]; As i said above there are likely better ways to implement this based on what you actually need but the above serves as a catch all example. 1 Share this post Link to post Share on other sites
BL1P 35 Posted December 21, 2014 (edited) There are likely lots of ways you can accomplish this BL1P.Using the uiNameSpace variable BIS_fnc_arsenal_cam will tell you whether the arsenal is open or not, its objNulll if its not open. How to check for this could also be written slightly differently dependent on how/where your calling the arsenal in the first place e.g from an ammo box, player action or from inventoryOpened. Heres some code from a quick test. It checks via an onEachFrame, its stacked ID is added to the player in a variable called "VAcatch" just incase you maybe want to turn the stacked event off (no sense checking for arsenal ever frame if the only place you can use it is while your back at base). It also checks to see if the player has changed their uniform and reapplies their insignia. Not thoroughly checked but should give you something to go from.. player setVariable [ "VAcatch", [ "VAcatch", "onEachFrame", { if ( !( isNil { _this getVariable "VAcatch" } ) && { !( isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) ) } ) then { _this setVariable [ "VAcatch", nil ]; _thread = _this spawn { _uniform = uniform _this; waitUntil { isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) }; _faction = _this getVariable [ "Faction", nil ]; if ( _uniform != uniform _this && { !( isNil "_faction" ) } ) then { [ _this, _faction ] call BIS_fnc_setUnitInsignia; }; _this setVariable [ "VAcatch", "VAcatch" ]; }; }; }, player ] call BIS_fnc_addStackedEventHandler ]; As i said above there are likely better ways to implement this based on what you actually need but the above serves as a catch all example. You, are a scholar and a gentleman sir. Once again you supply the goods, Thank you Larrow. Haven't tested it but I know your work, I have faith :) This is how we call the Virtual Arsenal Whitelist btw. in the init of the object (Land_Pallet_MilBoxes_F) _Ammo = [this] execVM "scripts\VA_Ammo\VA.sqf"; VA.sqf //--- Ammobox Start _DRBox = _this select 0; ["AmmoboxInit",[_DRBox,false]] call BIS_fnc_arsenal; [_DRBox,[true],true] call BIS_fnc_removeVirtualBackpackCargo; [_DRBox,[true],true] call BIS_fnc_removeVirtualItemCargo; [_DRBox,[true],true] call BIS_fnc_removeVirtualWeaponCargo; [_DRBox,[true],true] call BIS_fnc_removeVirtualMagazineCargo; [_DRBox,[ "classname", "classname" ],true] call BIS_fnc_addVirtualBackpackCargo; [_DRBox,[ "classname", "classname" ],true] call BIS_fnc_addVirtualMagazineCargo; [_DRBox,[ "classname", "classname" ],true] call BIS_fnc_addVirtualWeaponCargo; [_DRBox,[ "classname", "classname" ],true] call BIS_fnc_addVirtualItemCargo; Dont know if this is the best way or not but seems to work ok for us. Although sometimes it freaks out, greying out loadouts etc. Also sometimes it seems to be the cause of some red chain dsync. But since last update we have been having massive problems with dsync, especially in vehicles. Anyway once again Thank you. Edited December 21, 2014 by BL1P Share this post Link to post Share on other sites
BL1P 35 Posted December 22, 2014 Here is a short video of the script working Larrow. Twitch - http://www.twitch.tv/bl1p/c/5731834 Youtube :- Was done on a dedicated server. It sometimes freaks out when using load for gear but a quick swap of uniform fixes that. Thanks once again Larrow ! Share this post Link to post Share on other sites
BL1P 35 Posted December 29, 2014 We have a working version of the insignias script I will post details when I am sober some time soon :) Share this post Link to post Share on other sites
firefox1 12 Posted January 3, 2015 It would be nice a script where the insignia was the nickname of the player, the script would take the player ID and put the nickname insignia as well would be easier to identify the player. Share this post Link to post Share on other sites
shadowmarine578 11 Posted January 19, 2015 There are likely lots of ways you can accomplish this BL1P.Using the uiNameSpace variable BIS_fnc_arsenal_cam will tell you whether the arsenal is open or not, its objNulll if its not open. How to check for this could also be written slightly differently dependent on how/where your calling the arsenal in the first place e.g from an ammo box, player action or from inventoryOpened. Heres some code from a quick test. It checks via an onEachFrame, its stacked ID is added to the player in a variable called "VAcatch" just incase you maybe want to turn the stacked event off (no sense checking for arsenal ever frame if the only place you can use it is while your back at base). It also checks to see if the player has changed their uniform and reapplies their insignia. Not thoroughly checked but should give you something to go from.. player setVariable [ "VAcatch", [ "VAcatch", "onEachFrame", { if ( !( isNil { _this getVariable "VAcatch" } ) && { !( isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) ) } ) then { _this setVariable [ "VAcatch", nil ]; _thread = _this spawn { _uniform = uniform _this; waitUntil { isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) }; _faction = _this getVariable [ "Faction", nil ]; if ( _uniform != uniform _this && { !( isNil "_faction" ) } ) then { [ _this, _faction ] call BIS_fnc_setUnitInsignia; }; _this setVariable [ "VAcatch", "VAcatch" ]; }; }; }, player ] call BIS_fnc_addStackedEventHandler ]; As i said above there are likely better ways to implement this based on what you actually need but the above serves as a catch all example. so where does this go into the mission init or a trigger? i am confused where to place this Share this post Link to post Share on other sites
jshock 513 Posted January 19, 2015 so where does this go into the mission init or a trigger? i am confused where to place this Create a file named initPlayerLocal.sqf, place this in it, and the code will do the rest. Share this post Link to post Share on other sites
shadowmarine578 11 Posted January 19, 2015 Create a file named initPlayerLocal.sqf, place this in it, and the code will do the rest. lol I love you guys!!!! i just wish i was a better script writer so i could help you all out to Share this post Link to post Share on other sites
edbusana 10 Posted February 5, 2015 (edited) Create a file named initPlayerLocal.sqf, place this in it, and the code will do the rest. I created the initPlayerLocal.sqf file, but here still did not work. I init in ammobox (0 = [this] execVM "scripts\VAserver.sqf") file that contains this: VAserver.sqf if (!isServer) exitWith {};private ["_box"]; _box = _this select 0; ["AmmoboxInit",[_box,false,{true}]] call BIS_fnc_arsenal; [_box, [ "B_Kitbag_Base","B_Kitbag_mcamo",... ], true ] call BIS_fnc_addVirtualBackpackCargo; [_box, [ "1Rnd_HE_Grenade_shell","UGL_FlareWhite_F",... ], true ] call BIS_fnc_addVirtualMagazineCargo; [_box, [ "srifle_GM6_camo_F","srifle_LRR_camo_F",... ], true ] call BIS_fnc_addVirtualWeaponCargo; [_box, [ "G_B_Diving","G_Balaclava_blk",... ], true ] call BIS_fnc_addVirtualItemCargo; I have another file containing VAcliente.sqf: ["Preload"] call BIS_fnc_arsenal; Remembering: Class already added in Description.ext class CfgUnitInsignia{ class Test { displayName = "Test"; // Name displayed in Arsenal author = "Desconhecido"; // Author displayed in Arsenal texture = "Test.paa"; // Image path textureVehicle = ""; // Does nothing currently, reserved for future use }; } At login the player already attached the insignia Test.paa. Changing the Arsenal uniform insignia to remove. Have solve the problem in VAS and Respawn, only lack with the same Arsenal. Edited February 5, 2015 by edbusana Share this post Link to post Share on other sites
BL1P 35 Posted February 5, 2015 (edited) We run this on clients player setVariable [ "VAcatch", [ "VAcatch", "onEachFrame", { if ( !( isNil { _this getVariable "VAcatch" } ) && { !( isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) ) } ) then { _this setVariable [ "VAcatch", nil ]; _thread = _this spawn { _uniform = uniform _this; waitUntil { isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) }; // Arsenal closed // Set unit insignia _faction = _this getVariable [ "Faction", nil ]; if !( isNil "_faction" ) then { [ _this, _faction ] call BIS_fnc_setUnitInsignia; }; //--- not on list if ( isNil "_faction" ) then { [ _this, "GUEST" ] call BIS_fnc_setUnitInsignia; }; _this setVariable [ "VAcatch", "VAcatch" ]; }; }; }, player ] call BIS_fnc_addStackedEventHandler ]; So... join server have insig open VA box insig there get new uniform insig goes close VA box and insig is back :) Obviously we are using the faction system, you can just use the [ _this, Test ] call BIS_fnc_setUnitInsignia; and remove the extra stuff. erm think this would work :- player setVariable [ "VAcatch", [ "VAcatch", "onEachFrame", { if ( !( isNil { _this getVariable "VAcatch" } ) && { !( isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) ) } ) then { _this setVariable [ "VAcatch", nil ]; _thread = _this spawn { _uniform = uniform _this; waitUntil { isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) }; // Arsenal closed // Set unit insignia [ _this, Test ] call BIS_fnc_setUnitInsignia; _this setVariable [ "VAcatch", "VAcatch" ]; }; }; }, player ] call BIS_fnc_addStackedEventHandler ]; Edited February 5, 2015 by BL1P Share this post Link to post Share on other sites
edbusana 10 Posted February 5, 2015 I still can not make it work. Ja pasted the script in various files and nothing: initPlayerLocal.sqf scripts/VAserver.sqf scripts/VAcliente.sqf initServer.sqf onPlayerRespawn.sqf player setVariable [ "VAcatch", [ "VAcatch", "onEachFrame", { if ( !( isNil { _this getVariable "VAcatch" } ) && { !( isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) ) } ) then { _this setVariable [ "VAcatch", nil ]; _thread = _this spawn { _uniform = uniform _this; waitUntil { isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) }; // Arsenal closed // Set unit insignia [ _this, Test ] call BIS_fnc_setUnitInsignia; _this setVariable [ "VAcatch", "VAcatch" ]; }; }; }, player ] call BIS_fnc_addStackedEventHandler ]; The script works only online or in the editor tb is possible to test it? Maybe I'm missing something? Gotta change something in the init ammobox? I'm using to write the insignia in the preview (offline) command in initPlayerLocal.sqf [player, "Test"] call BIS_fnc_setUnitInsignia; Now to use the online login, have within the init.sqf: _null = [] execVM "scripts \ fn_slot.sqf"; that seeks playe ID and assigns if so the insignia. Share this post Link to post Share on other sites
BL1P 35 Posted February 5, 2015 Create a file called EH_Client.sqf put that script from above in it. Then in your initPlayerLocal.sqf put :- //--- Load client Event Handlers _null = [] execVM "EH_Client.sqf"; Should work. Share this post Link to post Share on other sites
edbusana 10 Posted February 5, 2015 (edited) BL1P, after I discovered the error did not have to create the file EH_Cliente.sqf So much mess discovered the problem, follow the corrected script the way it worked. For those who also want to use. Now I will add restrictions which UID can use. player setVariable [ "VAcatch", [ "VAcatch", "onEachFrame", { if ( !( isNil { _this getVariable "VAcatch" } ) && { !( isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) ) } ) then { _this setVariable [ "VAcatch", nil ]; _thread = _this spawn { _uniform = uniform _this; waitUntil { isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) }; // Arsenal closed // Set unit insignia [player,"Test"] call BIS_fnc_setUnitInsignia; // Error line _this setVariable [ "VAcatch", "VAcatch" ]; }; }; }, player ] call BIS_fnc_addStackedEventHandler ]; Edited February 5, 2015 by edbusana Share this post Link to post Share on other sites
BL1P 35 Posted February 6, 2015 cool glad its working for you now Share this post Link to post Share on other sites
Hossus 13 Posted March 6, 2015 hi we are useing more then one Insignia how would i do this ? Share this post Link to post Share on other sites