Courseplay / courseplay

Courseplay for Farming Simulator 2019
http://courseplay.github.io/courseplay
GNU General Public License v3.0
955 stars 529 forks source link

Error: LUA running function 'draw' in courseplay_manager.lua(28) #174

Closed DieWaage closed 10 years ago

DieWaage commented 10 years ago

Hello Courseplay team,

I get reproducible (howto see below) following error filling up the LS2013 log in MyDocuments folder:

Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)

How to reproduce this error:

My environment:

=> Immediate the error writing starts and also the help box is filling up the screen (see attached screenshot)

So even if this problem is likely cause by an error in the "ZZZ_MietFunktion*" mods it should not disrupt CP... Thats the reason why I filed an issue here.

Best Regards, Martin

fsscreen_2013_09_23_10_01_38

JakobTischler commented 10 years ago

Interesting. I used to use those rentable steerables, but never got that error. The error also doesn't really make any sense, as we add globalInfoTextOverlay to all steerables when they're loaded.

Some followup questions:

In base.lua, line 99 (line number could vary, must be after self.cp.globalInfoTextOverlay.isRendering = false;), add

print(tableShow(self.cp.globalInfoTextOverlay, nameNum(self) .. " self.cp.globalInfoTextOverlay"));

and then post the log, pleae.

I have a workaround for you, but won't be posting it for now as I'd rather like to actually fix the error than hide it.

DieWaage commented 10 years ago

I have added the "print" line to my CP 3.41.0128 version.

Answers to your questions:

I did the following additional test in 2.0 Beta 4 with only the in "My environment" above listed mods in a new started Hagenstedt game with only Bührer tractor and Fahr M66 as steerable available and "normally owned" (not "rent"). There I made following observations:

Currently the workaround with activated PDA in the game is good for me. Yes, you are right to find the cause and fix it. Is it normal/intentional that CP is not available at the rental machines and the rental machines are not in the "Drescher wählen" list? Perhaps somethings goes wrong at initialization of the rentals at buying?

GIANTS Engine Runtime 5.0.1 64bit (build date: Sep  9 2013)
Copyright (c) 2008-2012, GIANTS Software GmbH (www.giants-software.com), All Rights Reserved.
Copyright (c) 2003-2012, Christian Ammann and Stefan Geiger, All Rights Reserved.
Application: FarmingSimulator2013
Main System
  Core(s): 4 @ 3.3 GHZ
  OS: Windows NT 6.1 64-bit
Physics System
  Driver: NVIDIA PhysX Runtime
  Version: 2.8.4
  Thread(s): 2
Input System
  Keyboard enabled
  Mouse enabled
  Gamepad/Joystick enabled
  Force Feedback disabled
    Name: Xbox 360 Controller
      Number of Axes: 5
      Number of Buttons: 14
Sound System
  Driver: OpenAL
  Version: 1.1
  Device:  Generic Software
  Max. sources: 256
Render System
  Driver: OpenGL
  Card Vendor: ATI Technologies Inc.
  Renderer: AMD Radeon HD 6800 Series
  Version: 4.2.12217 Compatibility Profile Context 12.104.0.0
    GL_NV_texture_compression_vtc not supported
    GL_NV_vertex_program2_option not supported
    GL_NV_vertex_program3 not supported
    max_texture_layers: 8
  OpenGL initialization successful
Hardware Profile
  Level: Very High (forced)
  View Distance Coeff: 1.300000
  Shadow Quality: 2.000000
  Skip Mipmaps: 0
  LOD Distance Coeff: 1.300000
  Terrain LOD Distance Coeff: 2.000000
  Foliage View Distance Coeff: 1.600000
Farming Simulator 2013
  Version: 2.0.0.7 PublicBeta4
  Available Languages: de
  Language: de
Game vehicle types loaded
Mod directory: D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods
Load mod: ZZZ_courseplay
Load mod: ZZZ_MietFunktion_FeldGeraete
Load mod: ZZZ_MietFunktion_Selbstfahrer
    ### Courseplay: initialized 32/32 files (v3.41.0128)
    ### Courseplay: installed into 14 vehicles and 22 fillables
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.sprayer_animatedZGB
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.selfPropelledSprayerPantera
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.sowingMachine_animatedEDX6000
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.sowingMachine_animatedP303
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.sowingMachine_animatedPronto9
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.attachableCombineMex
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.attachableCombineSE75
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.attachableCombineRootster
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.sowingMachine_animatedGL660
  Register vehicle type: ZZZ_MietFunktion_FeldGeraete.defoliator_animatedBM300
  Register vehicle type: ZZZ_MietFunktion_Selbstfahrer.combine_cylinderedMietfahrzeug5465H
  Register vehicle type: ZZZ_MietFunktion_Selbstfahrer.cutterMietfahrzeug5465H
  Register vehicle type: ZZZ_MietFunktion_Selbstfahrer.selfPropelledPotatoHarvesterMietfahrzeug
  Register vehicle type: ZZZ_MietFunktion_Selbstfahrer.selfPropelledPotatoHarvesterMietfahrzeug2
  Register vehicle type: ZZZ_MietFunktion_Selbstfahrer.selfPropelledMowerMietfahrzeug
  Register vehicle type: ZZZ_MietFunktion_Selbstfahrer.combine_cylinderedMietfahrzeugBigX
  Register vehicle type: ZZZ_MietFunktion_Selbstfahrer.cutter_animatedMietfahrzeug
Loading shader WAD 'D:/Users/martinb/Documents/My Games/FarmingSimulator2013/shader_cache/shader_1_1_256_256_OGL_ATI_8.wad' ... 480 hashes, 793 shaders, 1057398 bytes compressed
data/sky/sky_day_night.i3d (0.00mb in 26.09 ms)
Warning (performance): Raw texture format (data/sky/foggy_sky_SIDE.png)
Warning (performance): Raw texture format (data/sky/foggy_sky_TOP.png)
data/sky/rain.i3d (0.00mb in 0.48 ms)
data/sky/hail.i3d (0.00mb in 0.26 ms)
data/maps/map01.i3d (3.36mb in 2339.67 ms)
dataS2/character/pedestrians/casual03.i3d (0.33mb in 17.86 ms)
dataS2/character/pedestrians/executive03.i3d (0.27mb in 14.27 ms)
dataS2/character/pedestrians/casual15.i3d (0.40mb in 22.66 ms)
dataS2/character/pedestrians/casual07.i3d (0.32mb in 17.93 ms)
dataS2/character/pedestrians/casual02.i3d (0.31mb in 16.97 ms)
dataS2/character/pedestrians/casual08.i3d (0.53mb in 29.12 ms)
data/vehicles/steerable/buehrer/buehrer6135A.i3d (0.02mb in 23.53 ms)
data/vehicles/steerable/powerTakeoff.i3d (0.00mb in 0.44 ms)
data/vehicles/steerable/upperLinkMedium.i3d (0.04mb in 1.31 ms)
data/vehicles/steerable/upperLinkSmall.i3d (0.04mb in 0.95 ms)
Bührer 6135 A self.cp.globalInfoTextOverlay = {
    ["visible"] = "true";
    ["a"] = 1;
    ["r"] = 1;
    ["isRendering"] = "false";
    ["b"] = 1;
    ["g"] = 1;
    ["width"] = 0.1;
    ["y"] = 0;
    ["x"] = 0.03;
    ["rotationCenterY"] = 0;
    ["rotationCenterX"] = 0;
    ["height"] = 0.02;
    ["rotation"] = 0;
    ["invertX"] = "false";
    ["overlayId"] = 38011;
};

G:/games/Landwirtschafts Simulator 2013/data/maps/models/objects/egg/egg.i3d (0.01mb in 0.28 ms)
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/img/NurGerade/NurGerade.i3d (0.01mb in 3.16 ms)
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/img/STOP/STOP.i3d (0.00mb in 4.12 ms)
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/img/VorfahrtAnDieserKreuzung/VorfahrtAnDieserKreuzung.i3d (0.01mb in 4.30 ms)
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/img/Parkplatz/Parkplatz.i3d (0.01mb in 3.50 ms)
data/vehicles/steerable/fahr/fahrM66.i3d (0.01mb in 11.54 ms)
Fahr M66 self.cp.globalInfoTextOverlay = {
    ["visible"] = "true";
    ["a"] = 1;
    ["r"] = 1;
    ["isRendering"] = "false";
    ["b"] = 1;
    ["g"] = 1;
    ["width"] = 0.1;
    ["y"] = 0;
    ["x"] = 0.03;
    ["rotationCenterY"] = 0;
    ["rotationCenterX"] = 0;
    ["height"] = 0.02;
    ["rotation"] = 0;
    ["invertX"] = "false";
    ["overlayId"] = 46473;
};

data/vehicles/tools/poettinger/poettingerServo35.i3d (0.00mb in 3.34 ms)
data/vehicles/tools/lemken/lemkenKristall9.i3d (0.75mb in 14.79 ms)
data/vehicles/tools/amazone/amazoneD1.i3d (0.00mb in 2.66 ms)
data/vehicles/trailers/krone/kroneEmsland.i3d (1.11mb in 41.23 ms)
data/vehicles/steerable/fahr/fahrM66Cutter.i3d (0.00mb in 3.10 ms)
data/vehicles/tools/extraWeight01.i3d (0.07mb in 1.69 ms)
data/vehicles/steerable/lizard/golfCart.i3d (0.01mb in 1.61 ms)
Golfwagen self.cp.globalInfoTextOverlay = {
    ["visible"] = "true";
    ["a"] = 1;
    ["r"] = 1;
    ["isRendering"] = "false";
    ["b"] = 1;
    ["g"] = 1;
    ["width"] = 0.1;
    ["y"] = 0;
    ["x"] = 0.03;
    ["rotationCenterY"] = 0;
    ["rotationCenterX"] = 0;
    ["height"] = 0.02;
    ["rotation"] = 0;
    ["invertX"] = "false";
    ["overlayId"] = 49372;
};

Golfwagen self.cp.globalInfoTextOverlay = {
    ["visible"] = "true";
    ["a"] = 1;
    ["r"] = 1;
    ["isRendering"] = "false";
    ["b"] = 1;
    ["g"] = 1;
    ["width"] = 0.1;
    ["y"] = 0;
    ["x"] = 0.03;
    ["rotationCenterY"] = 0;
    ["rotationCenterX"] = 0;
    ["height"] = 0.02;
    ["rotation"] = 0;
    ["invertX"] = "false";
    ["overlayId"] = 51519;
};

Golfwagen self.cp.globalInfoTextOverlay = {
    ["visible"] = "true";
    ["a"] = 1;
    ["r"] = 1;
    ["isRendering"] = "false";
    ["b"] = 1;
    ["g"] = 1;
    ["width"] = 0.1;
    ["y"] = 0;
    ["x"] = 0.03;
    ["rotationCenterY"] = 0;
    ["rotationCenterX"] = 0;
    ["height"] = 0.02;
    ["rotation"] = 0;
    ["invertX"] = "false";
    ["overlayId"] = 53666;
};

Golfwagen self.cp.globalInfoTextOverlay = {
    ["visible"] = "true";
    ["a"] = 1;
    ["r"] = 1;
    ["isRendering"] = "false";
    ["b"] = 1;
    ["g"] = 1;
    ["width"] = 0.1;
    ["y"] = 0;
    ["x"] = 0.03;
    ["rotationCenterY"] = 0;
    ["rotationCenterX"] = 0;
    ["height"] = 0.02;
    ["rotation"] = 0;
    ["invertX"] = "false";
    ["overlayId"] = 55813;
};

data/character/farmer/farmer_player.i3d (1.75mb in 34.50 ms)
data/vehicles/trucks/milktruck.i3d (1.19mb in 74.37 ms)
data/vehicles/cars/car3.i3d (0.39mb in 13.38 ms)
data/vehicles/cars/car6.i3d (0.38mb in 13.90 ms)
data/vehicles/cars/car1.i3d (0.43mb in 18.65 ms)
data/vehicles/cars/car5.i3d (0.37mb in 14.02 ms)
data/vehicles/cars/car2.i3d (0.42mb in 14.70 ms)
data/vehicles/cars/car4.i3d (0.33mb in 11.33 ms)
data/vehicles/steerable/krone/kroneBigX1000.i3d (0.02mb in 169.49 ms)
data/vehicles/cars/car7.i3d (0.47mb in 17.84 ms)
Krone BigX 1000 self.cp.globalInfoTextOverlay = {
    ["visible"] = "true";
    ["a"] = 1;
    ["r"] = 1;
    ["isRendering"] = "false";
    ["b"] = 1;
    ["g"] = 1;
    ["width"] = 0.1;
    ["y"] = 0;
    ["x"] = 0.03;
    ["rotationCenterY"] = 0;
    ["rotationCenterX"] = 0;
    ["height"] = 0.02;
    ["rotation"] = 0;
    ["invertX"] = "false";
    ["overlayId"] = 60457;
};

Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
D:/Users/martinb/Documents/My Games/FarmingSimulator2013/mods/ZZZ_courseplay/courseplay_manager.lua(28) : attempt to index field 'globalInfoTextOverlay' (a nil value)
Error: LUA running function 'draw'
...
DieWaage commented 10 years ago

Additional I want to indicate to the behavior of LS2013 if the error occur (see also screenshot at opening this case): If the error is written then:

Perhaps these are only subsequent errors...

JakobTischler commented 10 years ago

Perhaps these are only subsequent errors...

Yes, that's exactly what they are.

So, I've found the cause of the error: those rentable vehicles, although being steerables (i.e. they have the steerable specification, at least according to the modDesc), are not recognized when installing Courseplay. Which in turn means, they don't get the self.cp.globalInfoTextOverlay table, hence the error.

The weird thing about this is either that Courseplay doesn't recognize them as steerables, or, that they aren't steerables but are in the g_currentMission.steerables table.

I'm not sure how to proceed yet - I'm trying to find the best (meaning not the easiest but the fire safe) way to fix this - but I'll let you know.