Solved Deleted the Forest, now crashing into invisible stuff?

Discussion in 'Mod Support' started by RecklessPancake, Jan 16, 2017.

  1. RecklessPancake

    RecklessPancake
    Expand Collapse

    Joined:
    Aug 25, 2014
    Messages:
    18
    I'm creating a scenario on the East Coast USA map. Needed to remove theForest since the AI keeps crashing into it. I removed it with this code (thanks bidwars!):

    Code:
    local function onScenarioLoaded()
        TorqueScript.eval('if(isObject("theForest")) {"theForest".delete(); }')
    end
    The forest does delete, and I can drive around where the trees used to be freely. BUT, every now and then, I or an AI will crash into something invisible! I've tried going into the Editor as soon as I crashed into something and dragging a selection box around to see if there's anything there. Found nothing. There are multiple invisible colliders where this happens.

    Any ideas?
     
  2. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,683
    In the debug menu, there is an option for 'Static Collisions'.
    If you turn it on, you should see anything collide-able highlighted.
    IIRC it should be accessible while in scenario mode still.
     
  3. meywue

    meywue
    Expand Collapse
    Administrator
    BeamNG Team

    Joined:
    Nov 19, 2015
    Messages:
    339
    Your function is just deleting 'theForest' objects.

    You should also call 'be:reloadCollision()' to recalculate collisions.
     
  4. RecklessPancake

    RecklessPancake
    Expand Collapse

    Joined:
    Aug 25, 2014
    Messages:
    18
    Sweet, thanks for the solutions guys! Since I highly doubt I ever would have come across that reloadCollision function, do you have any tips on how to find functions/commands for modding like this? I've looked through the Lua wiki but it doesn't seem to have functions like the one you referenced or TorqueScript commands listed.
     
  5. meywue

    meywue
    Expand Collapse
    Administrator
    BeamNG Team

    Joined:
    Nov 19, 2015
    Messages:
    339
    Unfortunately there's no complete reference for functions, properties etc. yet.

    The easiest solution for now is probably to search in stock-lua files for a specific keyowrd e.g. 'collision'

    Sublime Text has a quite nice and relatively fast function by pressing Ctrl+Shift+F.
     
  6. BowlerHatJack

    BowlerHatJack
    Expand Collapse

    Joined:
    Aug 5, 2016
    Messages:
    1,388
    Hey even I didn't know that and I use sublime text in school. Thanks that will be useful!
     
  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