1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.32 Bug Reporting thread
    Solutions and more information may already be available.

AI pathing indexes 'nil' value and error (SOLVED, DELETE ME)

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by bob.blunderton, Jan 4, 2018.

  1. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,290
    ^^^ as stated above.
    Testing mammoth valley 2.0 (unreleased, 1.0 by Ouerbacker is out).
    Reloaded AI after fixing a missing road (not the one where the AI is now) and having saved the map previous to CTRL+L reloading the main lua.
    AI was disabled while I reloaded because it'll NIL ERROR if you do it while it's running.
    So I re-enabled the AI and it nailed a NIL ERROR while it was driving about a few minutes later.
    Just had to CTRL+R and disable-re-enable the AI again, but saved the log about a minute after.

    I know you don't support bugs with mods, however, this is not the first time this has happened, and not the first map this has happened on. However, it DID NOT do this on any version prior to game version 0.11.x.
    It also happened on my Roane County map but I didn't save the log at the time, thinking it was a one-off bug.

    The road it happened on was while using SPAN and having it drive one of the perimeter roads. It may or may not do it again, I had several vehicles going a few nights ago (wall of pianos in the road = smash party!), and it didn't do it until the end. This road exists in the existing Mammoth Valley by Ouerbacker.

    The error is at/near the end of the document.

    For bearing's sake the town is at the top of the picture and the map edge is behind me, this is the turn where it happened, the AI was driving right to left. SPAN, in-lane ON.

    No other settings changed, using a AWS 88' Pessima with NO modded parts. I only have a couple of map mods (mostly my own) and a T-series mod here installed as mods from 0.10.x and previous were mostly broken, so it's mostly vanilla. The error actually happened right above where my odometer is in the turn.

    I don't ask that this be fixed (as mods aren't supported), just file this if you need help tracking down this 'index a nil value' error on the AI.
    I have not modified the AI routines at all here.
     

    Attached Files:

  2. retrospek

    retrospek
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 23, 2016
    Messages:
    19
    Hey bob,

    after making changes to a map and reloading the game engine (cntr+L) so that the changes materialize, you have to reload your vehicles (cntr+R for each of them, which reloads what we call "vehicle Lua") in order for the layout of your edited map to be "transmitted" to each one of them, otherwise they will go by the old map data and you might get nil indexing.

    From what I understand from what you have written
    and from what I see in the log you have attached, you did not cntr+R after you made your changes, but once you did so
    your problem was fixed, which is what you should do.

    Hope this helps. If you believe I have not understood the issue correctly please let me know.
     
  3. bob.blunderton

    bob.blunderton
    Expand Collapse

    Joined:
    Apr 3, 2015
    Messages:
    3,290
    CTRL+R after reloading REQUIRED to avoid a 'nil' index - gotcha.
    It didn't do this in older versions ever. This is my mistake then or lack of understanding - but no longer!
    Will let you know if it ever happens without it - thus far to my best recollection, it has not.
    There is then no problem, it's all happened after CTRL+L before CTRL+R, so this thread can be deleted!

    Figured it was better safe then sorry to mention it ('nil' is the bane of script/coders), as not everyone edits maps, so few would see this error.
    Thanks!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice