Unsolved Spawn new vehicle with custom GE name

Discussion in 'Mod Support' started by chris_lucas, Jul 29, 2017.

  1. chris_lucas

    chris_lucas
    Expand Collapse

    Joined:
    Dec 12, 2012
    Messages:
    1,444
    Hey, Is it possible to spawn a new vehicle in ge lua with a custom world editor name? I know it was possible with meshes.
     
  2. chris_lucas

    chris_lucas
    Expand Collapse

    Joined:
    Dec 12, 2012
    Messages:
    1,444
    Don't wanna clog up with extra threads so I'm gonna post another question here, is it possible to get the terrain height at a certain position.
    For example there's a 400m high mountain on the map, I would enter in the x,y values of the mountains and it would return 400m
     
  3. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,683
    Yep, definitely. There's a raycasting function implemented into GE Lua. In this case, I'm raycasting from a vec3 called castPos, to castPos - 610 meters.
    Code:
    be:castRay(castPos:toPoint3F(), (castPos-vec3(0,0,610)):toPoint3F())
    
    This function will return either
    a) The distance to the hit
    b) Zero, if it did not hit anything
     
    • Like Like x 1
  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