Purzel 35 Posted December 8, 2019 Hi there, I´ve made some nice 128x128pixel insignias (.paa) The insignias are in my description.ext class zombiepatch { displayName = "ZombieHunter"; // Name displayed in Arsenal author = "Purzel"; // Author displayed in Arsenal texture = "pictures\zombiepatch.paa"; // Image path textureVehicle = ""; // Currently does nothing, reserved for future use }; My custom-insignias cannot be found in VirtualArsenal, but all vanilla-/mod-Insignias do appear in VA. I can only see my own Insignias (but without preview-picture) in the VA, if I have my custom insignia already on my uniform. We use a dedicated server, how do I write a little Addon, which provides us our custom-insignias? Our clan-tag is shown (that´s not the problem), we want some more patches (e.g. Medic-insignia, etc.). Or is there a working script-solution (without using a selfmade addon) to get custom-patches on a dedicated server. I´ve tried a lot of threads here, but nothing seems to work. Thanks for your help Purzel Share this post Link to post Share on other sites
pierremgi 4737 Posted December 8, 2019 Interesting. I never found a way to use Bis_fnc_setUnitInsignia in MP with CfgUnitInsignia defined in description.ext. That works on hosted server and that returns a path error on client (absolute paths are different) So, mod, yes, should work,... scripted solution, imho, forget. Share this post Link to post Share on other sites
Purzel 35 Posted December 9, 2019 What, if I load our custom insignias to our server and treat them like clan-tags? Using directly the path from there? Share this post Link to post Share on other sites
Muzzleflash 111 Posted December 10, 2019 This is old stuff, from a modified BIS_fnc_setUnitInsignia, uploaded as is it with a few comments. It has been used successfully for many sessions so should work unless I made a screwup with putting it up now. It is missing the actual insignia texture used, and a mission.sqm for it to be a self-contained example. You can download the zip on the button to the right. Note my version is local by default and there is a global function too. https://gist.github.com/senevoldsen/3dd0f7171fc1080cf674a29569d1c5ee Forgot to write, this is only the script-solution part. To Virtual Arsenal to work you will probably have to do more changes to that. In that case the simplest solution is probably to make tiny addon with the insignia. Share this post Link to post Share on other sites
pierremgi 4737 Posted December 11, 2019 hmmm, Not sure to understand why you exec: __EXEC (MISSION_ROOT = __FILE__ select [0, count __FILE__ - 15]) in the description.ext, even if I catch the idea of a full path, and then, you never use MISSION_ROOT in any script. So? Share this post Link to post Share on other sites
Muzzleflash 111 Posted December 11, 2019 12 hours ago, pierremgi said: hmmm, Not sure to understand why you exec: __EXEC (MISSION_ROOT = __FILE__ select [0, count __FILE__ - 15]) in the description.ext, even if I catch the idea of a full path, and then, you never use MISSION_ROOT in any script. So? It can be used in SP to use a texture placed with the mission. That is probably old stuff from before I finished converting BIS_fnc_setUnitInsignia to fully mission-MP compatible. I have removed it now since it is no longer needed. Share this post Link to post Share on other sites
Purzel 35 Posted December 20, 2019 So.... I wrote an addon, to get my custom insignias, which has the following directory-structure:@armpatch / __ addons / armpatch_addon.pbo > > > > > _____ icon-folder > some 128x128pixel insignias (.paa) inside |__ mod.cpp |_____ config.cpp mod.cpp - code: dir = "@armpatch"; name = "Armpatches LLAufKlKp421"; picture = "\armpatch_addon\faspatchbunt.paa"; hidePicture = 0; hideName = 0; The Config.cpp (inside the armpatch_addon) contains this: (list of insignia-patches reduced to two patches) class CfgPatches { class armpatch_addon { units[] = {}; weapons[] = {}; requiredAddons[] = {}; version = "1.0.1"; author[]= {"Purzel"}; authorUrl = "http://www.fas-clan.de"; }; }; class CfgUnitInsignia { class insignia_mp { displayName = "Military Police"; author = "Purzel"; texture = "\armpatch_addon\icon\MP.paa"; textureVehicle = ""; }; class insignia_rkpatch { displayName = "Sani-Patch"; author = "Purzel"; texture = "\armpatch_addon\icon\rkpatch.paa"; textureVehicle = ""; }; }; In Virtual Arsenal I can see all my patches written, but the preview-picture of the armpatch is missing. And I see the addon-logo at the end of of line. (see picture below!) Even if I put some patches by code (if (isServer) then {[this,"insignia_mp"] call BIS_fnc_setUnitInsignia};) via units-init to my player-units, it is not shown. (Squad-XML will be shown on right arm, my custom logo wont be visible). If I use [alpha1,"insignia_alpha1"] call BIS_fnc_getUnitInsignia; in console, it shows that patch "insignia_alpha1" is true..., but it is not shown on the uniform (uniforms of course have a second insignia-field!) Other mods are showing correctly their insignias, but due to the binarisation I cannot compare directly. How do I get the insignias shown? Is there a missing/wrong line in mod.cpp oder config.cpp? Is there a directory/path-problem? Do I have to "mount" the the addon anywhere else (e.g. description.ext, init.sqf, etc...)? Is the .paa-format wrong? Can you see another problem? Thanks for your help Purzel Virtual Arsenal: Addon seems correctly loaded: Share this post Link to post Share on other sites
Larrow 2794 Posted December 20, 2019 Are you sure your texture path is correct? You can always do something like... _nul = [] spawn { _pic = findDisplay 46 ctrlCreate[ "RscPictureKeepAspect", 10001 ]; _texture = getText( configFile >> "CfgUnitInsignia" >> "insignia_rkpatch" >> "texture" ); _pic ctrlSetText _texture; }; ...in an editor preview, you should see your picture on screen. 1 hour ago, Purzel said: class CfgPatches { class armpatch_addon { units[] = {}; weapons[] = {}; requiredAddons[] = {}; version = "1.0.1"; author[]= {"Purzel"}; authorUrl = "http://www.fas-clan.de"; }; }; What is version? This should be requiredVersion, and be a number not text. Whether this being missing is causing you issues? Unlikely but you never know. This is mine and works fine Spoiler class CfgPatches { class FatBloke_Insignia { units[] = {}; requiredVersion = 1.0; requiredAddons[] = {}; }; }; class CfgUnitInsignia { class FatBloke { displayName = "Larrows Army"; // Name displayed in Arsenal author = "Larrow"; // Author displayed in Arsenal texture = "LARs\FatBloke_Insignia\FatBloke_co.paa"; // Image path textureVehicle = ""; // Does nothing currently, reserved for future use }; }; Share this post Link to post Share on other sites
pierremgi 4737 Posted December 20, 2019 Do you respawn on start? For a reason I can't say, I experienced some invisible patches after respawn because the engine works as if the patch is already loaded, confirmed by bis_fnc_getUnitInsignia. What you can test, in this case, is a code like : { _x addMPEventHandler ["MPRespawn", { params ["_unit","_corpse"]; _unit spawn { _unit = _this; uisleep 0.5; [_unit,""] call BIS_fnc_setUnitInsignia; [_unit,"GBGM"] call BIS_fnc_setUnitInsignia; }; }] } forEach units GBGM; // from initServer.sqf (other methods available) Share this post Link to post Share on other sites
Purzel 35 Posted December 20, 2019 A big fat THX to all, for some reasons it suddenly works, after a great workaround with severel tries. I believe it was a path-problem. Share this post Link to post Share on other sites
Purzel 35 Posted January 11, 2020 Uuuh! Thx for all who helped me out with this, now I have to hijack my own thread again to solve the next problem: The insignias don´t show up from the start, not until the player has been in an Arsenal. (the player just have to open and close arsenal (without picking anything!), after that, the insignia is shown... ) But I have a mission without arsenal, so what to do? As stated before I have alpha 1 - 12 (and teams bravo to foxtrot 1 -12) Remember it should be working on a dedicated MP server. Any help is apprechiated Greetz Purzel Share this post Link to post Share on other sites