Michal Joska
Michal Joska

Reputation: 1

A nil value specializationUtil LUA

I'm trying to convert fs17 to fs19 mouse steering mod.

Console shows up:

register.lua:11: attempt to call field 'registerSpecialization' (a nil value)

Code look like this:

SpecializationUtil.registerSpecialization("ControlMouse", "ControlMouse", g_currentModDirectory.."ControlMouse.lua")

ControlMouse_Register = {};

I tried to solve it by:

if SpecializationUtil.specializations["ControlMouse"] == nil then
   SpecializationUtil.registerSpecialization("ControlMouse", "ControlMouse", g_currentModDirectory.."ControlMouse.lua");
   addSpecialization.isLoaded = false;
else
   -- print("  mod controlmouse is loaded!");
end;

After that it show this:

/mods/ControlMouse/register.lua:1: attempt to index field 'specializations' (a nil value)

Thanks for solution. If you want I'll send you full code

Upvotes: 0

Views: 461

Answers (1)

try to check SpecializationUtil:

if SpecializationUtil ~= nil then
  -- do
end

Upvotes: 0

Related Questions