Waldemar 337 12 Posted April 18, 2022 Is there a limit for the number of items in the ListBox ( https://community.bistudio.com/wiki/CT_LISTBOX ) ? I am facing a strange bug which happens when the number of items inside the listbox is very large. Share this post Link to post Share on other sites
7erra 629 Posted April 18, 2022 There's only the limit that you implement yourself. How many items are we talking about and what exactly is the bug? Share this post Link to post Share on other sites
Waldemar 337 12 Posted April 18, 2022 I am moving an array of all classes in CfgVehicles into a listbox. Some of the classes like "B_AssaultPack_rgr_Medic" and other assault backpacks produce strange bugs when I use some methods on them. For example, when I use isClass, getText and getNumber with these classes, I not only receive the output values (boolean, string and number), but also see these backpacks created on the ground around the player. This looks strange. I am trying to make a minimal working example of this behaviour, but it takes a lot of time, because I have dozens of script files ... Share this post Link to post Share on other sites
Waldemar 337 12 Posted April 18, 2022 I have re-checked. This bug does not depend on the listbox size. It just happens when I select one of the assault backpack classes in the list box. After this selection I make some checks with isClass, getText and getNumber and I see the backpack created on the ground, though I did not run any createVehicle functions. Looks like a game's bug, not mine. Share this post Link to post Share on other sites
dreadedentity 278 Posted April 18, 2022 I'm not able to reproduce what you describe with: _var = configFile >> "CfgVehicles" >> "B_AssaultPack_blk"; I tried this both in debug console and init.sqf. No backpacks spawned 20 minutes ago, Waldemar 337 said: // MCA_fn_getParentClasses.sqf. Makes me think you're using some custom scripts. Of course, the bug could be there, not necessarily in code you wrote. Can you tell me where _currentVehicleClass comes from? I bet if you trace this backward you will eventually find somewhere that an object is created near a player. I don't understand how you traced the issue to that specific line, it doesn't contain any creation commands, and doesn't have player anywhere. So even if something did get created, how would it spawn near a player? Share this post Link to post Share on other sites
Waldemar 337 12 Posted April 18, 2022 I am sorry. I have found a reason but wanted to change my original message. I create an object using the createVehicle function. Then I delete this object with deleteVehicle function. // MCA_fn_getVehicleParameters.sqf. // This function tries to get the mass of a vehicle and some other parameters. // This is a hack, it may not work every time. params ["_caller", "_vehClassName"]; if (!(isClass (configFile >> "CfgVehicles" >> _vehClassName))) exitWith { [0.0, [0, 0, 0], []] }; // Create a vehicle in the sky. private ["_callerPos", "_vehPos", "_veh", "_mass", "_dimensions", "_seats"]; _callerPos = position _caller; _vehPos = [_callerPos select 0, _callerPos select 1, (_callerPos select 2) + 5000 + (random 2000)]; _veh = createVehicle [_vehClassName, _vehPos, [], 0, "FLY"]; _veh allowDamage false; // Get the parameters. _mass = getMass _veh; _dimensions = _veh call MCA_fn_getObjectDimensions; // _dimensions = [1,2,3]; _seats = fullCrew [_veh, "", true]; _veh allowDamage true; // Delete the vehicle. deleteVehicle _veh; [_mass, _dimensions, _seats] If the object was a backpack it is created on the ground instead of the sky and is not deleted. So if this file is the source of the function MCA_fn_getVehicleParameters then the following code will reproduce the bug: [player, "B_AssaultPack_rgr_Medic"] call MCA_fn_getVehicleParameters; Share this post Link to post Share on other sites
Waldemar 337 12 Posted April 18, 2022 Seems that I have found a similar thread. Share this post Link to post Share on other sites
Waldemar 337 12 Posted April 18, 2022 Thanks for your help ! Share this post Link to post Share on other sites
dreadedentity 278 Posted April 18, 2022 Ah, the weaponholder problem. That one gets everybody at least once. To offer some context, most of the "items" can't be just "on" the ground, so the weaponholder is just an invisible container that displays the stuff inside. This is why you can drop stuff and move slightly and keep dropping stuff and it all gets stacked together, they are going to the same weaponholder. If you ever run into this again, you can detect a weaponholder with the nearestObjects command nearestObjects [position player, [], 5] 1 Share this post Link to post Share on other sites