Freezing the vehicle during countdown

Freezing the vehicle during countdown

From BeamNG

Revision as of 20:56, 27 September 2016 by Stenyak (talk | contribs) (Created page with "While your scenario introduction sequence is being shown, and while the countdown is taking place, you usually want to prevet the user from manipulating the vehicle in any way...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

While your scenario introduction sequence is being shown, and while the countdown is taking place, you usually want to prevet the user from manipulating the vehicle in any way. This avoids unfair advantages when the scenario finally starts.

Default behaviour

By default, the user's vehicle drivetrain will be automatically manipulated, to prevent the vehicle from advancing forward or backwards, even if the player is using the throttle and brake controls. However, most other actions are still possible by default.


Custom behaviour

Starting at v0.7.0.0, it is possible to specify a list of vehicle functions that you want to ignore during this scenario start-up procedure.

A different list can be defined for each vehicle in your scenario json file. For example:

[...]
    "vehicles": {
        "scenario_player0": {
            "extensions": {
                "functionFreezer": [
                    "custom_input.fire",
                    "custom_input.liftBarrel"
                ]
            }
[...]

In this example, "custom_input.fire" and "custom_input.liftBarrel" are two functions located in the file cannon/lua/custom_input.lua, and they manage the firing of ball and the barrel movement respectively.


All functions listed under "functionFreezer" will have absolutely no effect during the introduction phase and during the countdown timer.

Once the scenario starts, the functions will start working normally, so the user will be able to use them.