Unsolved changing waypoint names

Discussion in 'Mod Support' started by The Gas Station, Feb 23, 2019.

  1. The Gas Station

    The Gas Station
    Expand Collapse

    Joined:
    Jul 14, 2016
    Messages:
    272
    Hi!
    I've been working on a scenario that would require the paths you take to change randomly.
    I remember someone made something like this a few years ago, but it's outdated and doesn't work anymore. Also, it used the BNSE thing so I can't re-use anything there.
    So the best way I thought to approach this is maybe to change the names of the waypoints, so if the .json path is waypoint01 -> waypoint02 -> waypoint03, then the waypoints would originaly be named in the prefab in other names, but through .lua, after a certain path is randomly chosen, the relevant waypoints would get the appropriate names (waypoint01, waypoint02, waypoint03).
    Only problem is, I have no idea how to do that.
    Another option I considered is to teleport the waypoints around. Again- no clue on how to do that (maybe Gull's car spawn code can be modified? I tried to do that but it didn't work)
    Any help would be apreciated.
     
  2. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    the scenario code support branching, so if you need to only have multiple possibilities instead of true random, you could do that
    levels\west_coast_usa\scenarios\busdriver_stunt\busdriver_stunt_minspeed.json

    If you really need to have random waypoint goal everytime, you would need to write a small script to change scenario.lapConfig just before the start of the race
     
    • Informative Informative 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