Unsolved No collision with trees in a groundcover

Discussion in 'Mod Support' started by Aboroath, Mar 1, 2017.

  1. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Good day,

    I am attempting to implement ECUSA pine trees as a shapefile into a groundcover object.
    When doing this the trees fail to have collision. I have saved the level, exited the editor and
    restarted the game. I have also noted groundcovers are not updating in realtime anymore and
    require a save and restart to show changes. Bug?....or more likely I am missing something?

    Thanks!
     
  2. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Has any other map maker experienced this? Certainly not everyone hand paints entire forests to get collision?....or do they?

    Can anyone describe their forest practices? I've been informed by a well known map maker they have issues with this too.
     
  3. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    what I did for the GTA4 map is reuse the forest trees as TSStatic because at this time i couldn't make it a item forest

    Now I can generate a json that place all trees (and other object if i want) at exactly the same spot as in GTA

    You are right collision isn't updated, I have to load another map (grid for instance) and them go back the the map I was modding

    what i do to check collision is loading the dae as a TSstatic, them you're good to go
     
    • Informative Informative x 1
  4. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Thank you Thomatoes50. There are some things there I am not familiar with ( json creation, TSstatic vs .dae loading ).

    Good points to look into and research though. I have over half the forest laid down by hand because I am.....impatient:p.
     
  5. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    I hope I didn't create misunderstanding with my previous reply

    TSStatic are a class in Torque3D (BeamNG graphic engine) which load a .dae and just do a 'basic' mesh with lod and collision support.

    forestItem is another class and add support for wind with all the previous ability of TSStatic.

    My point was loading the tree mesh as a TSStatic will allow to use the material editor and the shape editor to find something

    The json file I was talking about is a file which store the coordinates of tree you place, you can place them by hand in the editor or edit the file.
     
    • Informative Informative x 1
  6. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Thanks again Thomatoes50. The json thing is what I'm most confused about. Can you explain a bit on how a json would work for a forest?
     
  7. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    First you don't really need to modify by hand (with a text editor) the json forest file, BeamNG forest editor handle it

    Here goes the explanation :

    This is a json forest file
    Code:
    {
    "header": {
      "version": 2,
      "format description": "posX, posY, posZ, rotX, rotY, rotZ, rotW, scale",
      "format": "JSON Forest Data v2"},
      "instances": {
        "bm_air_landlites01": [
          [2828.732, 460.8426, 47.101556, 0.0, 0.0, 0.3542911, 0.9351352, 1.0],
          [2823.153, 465.8889, 47.101556, 0.0, 0.0, 0.3542911, 0.9351352, 1.0],
          [2835.044, 468.4349, 47.037686, 0.0, 0.0, 0.3542911, 0.9351352, 1.0],
          [2817.528, 470.8728, 47.101556, 0.0, 0.0, 0.3542911, 0.9351352, 1.0],
          [2829.465, 473.4813, 47.037686, 0.0, 0.0, 0.3542911, 0.9351352, 1.0],
          [2823.84, 478.4652, 47.037686, 0.0, 0.0, 0.3542911, 0.9351352, 1.0],
          [2840.468, 485.1613, 47.96094, 0.0, 0.0, 0.352631, 0.9357625, 1.0],
          [2846.065, 480.1347, 47.96094, 0.0, 0.0, 0.352631, 0.9357625, 1.0],
          [2850.806, 486.0406, 47.875295, 0.0, 0.0, 0.3463889, 0.938091, 1.0],
          [2834.826, 490.1252, 47.96094, 0.0, 0.0, 0.352631, 0.9357625, 1.0],
          [2845.142, 490.9921, 47.875295, 0.0, 0.0, 0.3463889, 0.938091, 1.0],
          [2839.434, 495.8804, 47.875295, 0.0, 0.0, 0.3463889, 0.938091, 1.0]
          ]
      }
    }
    The header is just a description of the file type and how the content is stored (just like jbeam)

    Rotation work as quaternion, you can use blender or online tools to convert angles.

    The declaration of tree instance are located in another file mapfolder\art\forest\managedItemData.cs
    Code:
    datablock TSForestItemData(bm_air_landlites01)
    {
       internalName = "bm_air_landlites01";
       shapeFile = "levels/GTA4/art/east/queens_e/object/prop/bm_air_landlites01.dae";
    };
    Here is where you can set the mesh file and other parameters like wing force etc...


    I say it again you can do most of the work without editing file with external tools
     
  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