Problem with registering mission type
Posted: Fri Jan 09, 2015 5:55 pm
Hello,
Sorry to bombard this forum with lua scripting questions...
I can't create new missions (Mission:New()). According to the wiki I should be able to just come up with any random mission type I want. But that doesn't work. It always complains that "NONE" is not a registered mission type. Even if I use a "normal" mission type like "Delivery" I still get the same error. I don't get that if I create a mission (Mission:New()) interactively in the game - just when loading a script. I then dug into the mission.lua script and figured I have to register the type I want to use before using it. But whenever I try that (i.e. Mission:RegisterType("test", "test", test)) I get the error: "error: [string "[T] @libs/Mission.lua"]:162: typeid: String expected". This happens interactively via the in-game console and in a script.
What am I missing? When I look at other scripts (such as DeliverPackage) I don't see that the mission type had to be registered before creating the mission.
I must be making some stupid mistake. Can anybody help me find it?
Thank you!
Sorry to bombard this forum with lua scripting questions...
I can't create new missions (Mission:New()). According to the wiki I should be able to just come up with any random mission type I want. But that doesn't work. It always complains that "NONE" is not a registered mission type. Even if I use a "normal" mission type like "Delivery" I still get the same error. I don't get that if I create a mission (Mission:New()) interactively in the game - just when loading a script. I then dug into the mission.lua script and figured I have to register the type I want to use before using it. But whenever I try that (i.e. Mission:RegisterType("test", "test", test)) I get the error: "error: [string "[T] @libs/Mission.lua"]:162: typeid: String expected". This happens interactively via the in-game console and in a script.
What am I missing? When I look at other scripts (such as DeliverPackage) I don't see that the mission type had to be registered before creating the mission.
I must be making some stupid mistake. Can anybody help me find it?
Thank you!