Released Holey fuel tank

Discussion in 'Programming' started by Incognito, Nov 12, 2013.

  1. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    It is a simple racing mode. You need to pass the track from start to finish without total fuel loss.
    The track is divided into sections, each section has the minimum speed. If you move with a speed less minimum for this section, you start losing fuel. The lower the speed, the more fuel you lose.
    In the upper right corner displays some information: current time, fuel leak (in L/s), min and current speed.

    To create your own tracks you need to add BeamNGTrigger in the necessary places and write in enterCommand:
    Code:
    holeyFuelTank.setMinSpeed(50)
    For start trigger:
    Code:
    holeyFuelTank.start(50)
    For finish trigger:
    Code:
    holeyFuelTank.finish()
    Where 50 - is the minimum speed for the section.

    Here a mis file for Stockcar-Madness-racing-map-update-9-29-2013 (prefab does not work for some reason :()
    View attachment stockcar_madness.zip (just put stockcar_madness.mis file in levels\stockcar_madness\)

    Installation
    Automatic (with Lua mod installer and install script) or:
    1. Open lua\system\main.lua and after:
      Code:
      json      = require("json")
      add with a new line:
      Code:
      holeyFuelTank = require("holeyFuelTank")
    2. After:
      Code:
          raceTimer = raceTimer + dt
      add with a new line:
      Code:
          if ( holeyFuelTank.isEnabled() == 1 ) then
              holeyFuelTank.update(dt)
          end
    3. Copy holeyFuelTank.lua in lua\system\ .
    4. Open lua\vehicle\drivetrain.lua and after "end" of the "refill" function add with a new line:
      Code:
      local function decFuel( value )
          if ( M.fuel > 0 ) then
              M.fuel = M.fuel - value
          end
      end
      
      local function incFuel( value )
          if ( M.fuel < M.fuelCapacity ) then
              M.fuel = M.fuel + value
          end
      end
    5. After:
      Code:
      M.refill          = refill
      add with a new line:
      Code:
      M.decFuel         = decFuel
      M.incFuel         = incFuel
    6. Enjoy :)
     

    Attached Files:

    #1 Incognito, Nov 12, 2013
    Last edited: Nov 12, 2013
  2. SkritCraft

    SkritCraft
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    338
    Cool idea :D I will test it tomorrow :D
     
  3. RobertGracie

    RobertGracie
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    3,779
    Install guide PLEASE....
     
  4. Incognito

    Incognito
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    246
    In the first post :)
     
  5. RobertGracie

    RobertGracie
    Expand Collapse

    Joined:
    Oct 15, 2013
    Messages:
    3,779
    Thanks the last mod I tried to install failed flat on its face...due to the idiot that I was by not following instructions come on we are guys we dont need instructions..we make things work! (SARCASM)
     
  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