Solved Manual vehicle pooling from lua

Discussion in 'Mod Support' started by RcCookie, Feb 14, 2023.

  1. RcCookie

    RcCookie
    Expand Collapse

    Joined:
    Feb 24, 2018
    Messages:
    37
    Is it possible to use the traffic system's vehicle pooling system without the traffic system? That is, "enabling" and "disabling" specific vehicles without completely unloading them so that they can be re-enabled without freezing, and in the meantime disabling or reducing their physics calculations?
     
  2. RcCookie

    RcCookie
    Expand Collapse

    Joined:
    Feb 24, 2018
    Messages:
    37
    Well, found it myself by looking though the lua flowgraph implementation:
    Code:
    vehicle:setActive(0|1)
    and
    Code:
    onVehicleActiveChanged(id, active)
    to listen to changes. Not quite sure why there is no function vehicle:isActive() but I guess with the listener function you can create your own lookup.
     
  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