ravenleg 37 Posted April 4, 2016 For a while I've wanted to write a script to generate lists of which items can be sling loaded by which helicopters. I know that you can use the script command canSlingLoad on two instantiated vehicles, but I'm looking for a way to do this simply with config values in an automated manner to generate a large table (rather than doing a single check in-game). The closest I've gotten to reverse-engineering the canSlingLoad method is identifying the slingLoadMinCargoMass and slingLoadMaxCargoMass properties on the helo side of things (guessing that this is all that's necessary to determine if a helo can sling load something); and then on the cargo side, it seems that an object needs to have its slingLoadCargoMemoryPoints[] array have a size > 0 in order to be at least theoretically slingloadable. But I figure that in order to truly duplicate the functionality of canSlingLoad without having to instantiate vehicles, I'd need to know the corresponding masses of each potential cargo item to check that it falls with the helo's sling load capacity range. And that's what I have no idea how to find. This post seems to have those weight values for some cargo objects, but I have no idea where those values came from, or how you can access them via config scripting. Am I even going about this the right way? Anyone able to help point me in the right direction? Share this post Link to post Share on other sites
adanteh 58 Posted April 4, 2016 getMass to return the mass of an object with script. You can't retrieve this from config unfortunately, because the mass values are part of the model (And not the config) Share this post Link to post Share on other sites
DieselJC 196 Posted April 5, 2016 Have you checked out Duda's "Advanced Slingloading" yet..I believe he has already done all of that. Share this post Link to post Share on other sites
DieselJC 196 Posted April 5, 2016 https://forums.bistudio.com/topic/187696-advanced-sling-loading-mp-sp/ Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted April 5, 2016 Sorry to hijack this thread, I'm trying to set an APC as slingable. class CfgVehicles { class LandVehicle; class B_APC_Wheeled_01_base_F; class B_APC_Wheeled_01_cannon_F { slingLoadCargoMemoryPoints[] = {"SlingLoadCargo1","SlingLoadCargo2","SlingLoadCargo3","SlingLoadCargo4"}; }; }; edit: love how the forum cuts off text below a code insert. meant to say I'd gotten this far but unsure how to proceed. I imagine I have to define the memory points somewhere but no idea where that would be. not really a config guy :) Share this post Link to post Share on other sites
ravenleg 37 Posted April 5, 2016 getMass to return the mass of an object with script. You can't retrieve this from config unfortunately, because the mass values are part of the model (And not the config) Okay, well if that's the case then that pretty much answers it. So I could make a script which spawns in a slingloadable item, calls getMass on it, records the value, deletes it, and moves on to spawn the next item, but at that point I might as well have the helicopter also spawned and just call canSlingLoad instead and be 100% sure one way or the other. Could you explain though what it means that the mass is part of the model and not the config? I don't know enough about how this works under the hood to know what things are stored in the config (I guess I thought all of it) and what's not (and why that is). Have you checked out Duda's "Advanced Slingloading" yet..I believe he has already done all of that. I haven't looked much into it yet, but I'm guessing that the script just uses canSlingLoad since the helo and the cargo item are already spawned in and instantiated and the script would only be making a single evaluation on the helo-cargo pair. I was looking for a config-only alternative so I could make an automated script that would evaluate hundreds or thousands of potential helo-cargo combinations to create a big table of what's possible to lift with what helo.E EDIT: Even though Duda's Advanced Slingloading doesn't solve my initial problem, it was helpful in allowing me to slingload CUP vehicles, none of which seem to have any slingLoadCargoMemoryPoints[] and therefore cannot be slingloaded in the vanilla way, even if their masses are less than the lifting capacity of the helo. But with this mod, so long as the math works out, they can be slingloaded, which is also great. Share this post Link to post Share on other sites