Community Forum

Can I check if a specialization exists in general?

Forum Overview >> Scripting

CategoryScripting
Created17.02.2017 12:43


Tim Derks (timmiej93) 17.02.2017 12:56
I want to check if a specialization exists in general (it's added by a mod), so not specifically in a vehicle or something, but just if it ever has been registered. I tried "SpecializationUtil.getSpecialization('SpecName');", but this always returns nil, even when calling it continuously in the update() function, and even though I'm absolutely positive that the specialization I'm looking for is active.
I then resorted to "ModsUtil.findModItemByModName('ModName');", but this also gives me nil constantly when running in the update() function. What can I do to check if a mod/specialization is active?

Emil Drefers (Unknown) 20.02.2017 16:56
Hi,

specializations which are registered by a mod are moved into the namespace of the mod.

So, calling something like
SpecializationUtil.getSpecialization('MyMod.SpecName');
could give you what you want.

Cheers,
Emil



Note: Log in to post. Create a new account here.