#I need a way to retrieve the classname
1 messages · Page 1 of 1 (latest)
post me a picture of your respawn menu as you want it atm
and post all of your relevant scripts via pastebin or short code blocks
why would I need to change the respawn menu?
you don't, i just want to see what you currently have
It's the same as it always was
now what 3CB classes do you want to use? i'll be in the process of downloading the mod
what units do you have placed down in the editor? what unit inventories do you want to replicate
like what is in blufor_squad, give me the whole array
No units placed down in the editor. No specific units or inventories, basically whatever is defined in the faction array. There is a parameter in the multiplayer menu where the faction can be selected.
(https://pastebin.com/5Mzd7u1Y)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
This is the init:
call compileFinal preprocessFileLineNumbers "classnames.sqf";
uk3cbFoundWest = false;
uk3cbFoundEast = false;
private _infantryWest = blufor_squad;
private _infantryEast = opfor_squad;
{
if ((toLower _x find "uk3cb") == 0 || (toLower _x find "uk3cb") == (count _x - count "uk3cb")) then {
uk3cbFoundWest = true;
} else {
uk3cbFoundWest = false;
};
} forEach _infantryWest;
{
if ((toLower _x find "uk3cb") == 0 || (toLower _x find "uk3cb") == (count _x - count "uk3cb")) then {
uk3cbFoundEast = true;
} else {
uk3cbFoundEast = false;
};
} forEach _infantryEast;
// Client Functions
if (!isDedicated) then {
[] spawn compileFinal preprocessFileLineNumbers "scripts\client\client_init.sqf";
};
// Create Loadouts
{
[west, [_x]] call BIS_fnc_addRespawnInventory;
} forEach blufor_squad;
{
[east, [_x]] call BIS_fnc_addRespawnInventory;
} forEach opfor_squad;
alright give me a sec to download the 3cb factions
i need to dig through their configs
opfor_faction_3cb_csatpacific = [
[
"UK3CB_CSAT_G_O_GL",
"UK3CB_CSAT_G_O_RIF_1",
"UK3CB_CSAT_G_O_RIF_2",
"UK3CB_CSAT_G_O_SNI",
"UK3CB_CSAT_G_O_TL",
"UK3CB_CSAT_G_O_UAV",
"UK3CB_CSAT_G_O_AR",
"UK3CB_CSAT_G_O_JNR_OFF",
"UK3CB_CSAT_G_O_MK",
"UK3CB_CSAT_G_O_SL",
"UK3CB_CSAT_G_O_MG",
"UK3CB_CSAT_G_O_MD",
"UK3CB_CSAT_G_O_LMG",
"UK3CB_CSAT_G_O_LAT",
"UK3CB_CSAT_G_O_HAT"
],
[
"UK3CB_CSAT_G_O_BMD1",
"UK3CB_CSAT_G_O_BMD1K",
"UK3CB_CSAT_G_O_BMD1P"
]
];
This is the first faction I am testing. opfor_squad = the first array in this array
my preemptive tells me that because of how that mod is made, which has a post init script that fills the inventory will either break everything else in that list, or it won't work for itself. all 3CB stuff has that. and its the main reason why I actually never use it
its really a mod for the layman, non modder. and its always annoying for modders
but hold out until i get it downloaded and i'll dig through their stuff
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
here's a snippet I have been using for reference
what main class is all of that under?
I already added an arsenal init script (the arsenal is populated only with items from the classes) that parses the custom configs.
let me check, it was a unit
ok so a unit. thats all i need
UK3CB_CSAT_G_O_RIF_1
this one specifically
3cb is certainly not a mod for the layman. You can't utilize the factions without intimate knowledge of how the mod works, which is why I question the design
I would make a patch if it was reasonable to attempt
first off, obfuscated - for not even a pvp mission/mod. straight dump. can get through it anyways, its just annoying to do.
secondly, I win:
you'll have to do your own function with the classname that I can get you though for post spawning adding of items. that's on you. I did the ui work lol
proof of concept code, you'll have to modify if the event handler doesn't keep on respawn (readd it)
your loadout data will be saved in
`player getVariable "Rylan_LoadoutData"`
unpack it with:
private _loadoutData = player getVariable "Rylan_LoadoutData";
if (isNil "_loadoutData") exitWith {};
_loadoutData params ["_classname", "_displayName", "_config"];
// you now have _classname _displayName and _config to work with
@open moon
I'll look at it right now
If I put systemChat str _loadoutData; after line 64 the text should show the correct classname as the first element in the displayer array, or is that not the proper way to check its accuracy?
look in your log file, i used diag_log
and what you suggest will do the whole 3 element array
index 0 is the classname
I really hate to say it but it's wrong
a few of the classes produce a zero divisor error on line 51
it doesn't seem to update when you only select the left dropdown. Maybe my implementation is wrong. Probably that's it, I'll try and figure it out
tysm for having the patience to help me on this lol
I owe you one
it works for the 3 things I tested but that's all i tested
and if it errors, its not going to update anyways as the code is killed early
are those three units you tested in the same role?
where did you execute the script from?
just had it in init.sqf
if it errored at 51, that means nothing was returned at index 1 from the metadata function. so something wasn't populated at some point. just add a check after that to make sure that index 1 exists
I'll do that. Seems the same classes always make it fail. LAT Riflemen, HAT Rifleman, Junior officer, and a few others. I don't see why that should happen, everything should be configured the same way as your test, in essence
give me the class names of those and ill test them
"UK3CB_CSAT_G_O_GL",
"UK3CB_CSAT_G_O_RIF_1",
"UK3CB_CSAT_G_O_RIF_2",
"UK3CB_CSAT_G_O_SNI",
"UK3CB_CSAT_G_O_TL",
//"UK3CB_CSAT_G_O_UAV",
"UK3CB_CSAT_G_O_AR",
"UK3CB_CSAT_G_O_JNR_OFF",
"UK3CB_CSAT_G_O_MK",
"UK3CB_CSAT_G_O_SL",
"UK3CB_CSAT_G_O_MG",
"UK3CB_CSAT_G_O_MD",
"UK3CB_CSAT_G_O_LMG",
"UK3CB_CSAT_G_O_LAT",
"UK3CB_CSAT_G_O_HAT"
It might only happen when they are all added
"UK3CB_CSAT_G_O_JNR_OFF",
"UK3CB_CSAT_G_O_LAT",
"UK3CB_CSAT_G_O_HAT"
I can check for all the ones that cause the fault
Oh and I commented the UAV class to see if that was the issue. It causes an error because of the role definition being bad so it switches to default. Removing it didn't seem to help
yeah those last 2 error for me. let me see what it is doing
all the other classes are incorrect as well. It doesn't look like they are shifted or anything though so idk what it might be
so the respawn menu is failing to add it to the metadata array... the JNR_OFF works though, the other 2 nope
For me everything after "Grenedier" in the rifleman role causes the error
the error is gone but the classes are not associated correctly. Perhaps an issue with the order? Do the loadouts appear in your respawn menu in the same order they appear in your script?
ooo yeah i missed that since i used 2 riflemen
if (uk3cbFoundWest || uk3cbFoundEast) then {execVM "scripts\client\LoadoutClassCheck.sqf"};
// Create Loadouts
{
[west, [_x]] call BIS_fnc_addRespawnInventory;
} forEach blufor_squad;
{
[east, [_x]] call BIS_fnc_addRespawnInventory;
} forEach opfor_squad;
Perhaps this causes a discrepancy?
no its because the UI orders it in order of alphabetical, so i'll have to sort the array after that manually alphabetically. annoying lol
ill pick this up tomorrow, im headed to bed
Ok, sounds good. Thanks again
i lied, thought about it in the shower and i'll just do a index search through the data array:
try that
This appears to work entirely as expected
nice work, seriously
I appreciate it so much
thank you
One question though, do you know if the loadout variable updates when a player selects only something on the left, or simply doesn't select anything at all?
on role menu change (selects the default right after it populates) AND right loadout dropdown change