Jump to content
TeardownMods

elboydos vehicle and mounted gun Script - script only 1.0.1

   (4 reviews)

9 Screenshots

About This File

A mod that enables player controlled turrets through both physics based control and in vehicle control - includes extensions to change fire rate, type, and ammo capacities. 


Excerpt from Readme: 






ELBOYDOS MOUNTED GUN AND PLAYER CONTROLLED TURRET SCRIPT

Author : elboydo

published 11-11-2020

i dunno, i may extend this readme later. 

____________________________________________________________


To install::

Place files within create folder here to your create folder in teardown/create


To enable weapon usage, copy the hud.lua file to teardown/data/ui


IF YOU DON'T WANT TO MESS WITH YOUR HUD.LUA DUE TO OTHER MODS: 

    copy this line into the "draw()" method in hud.lua

    if UiIsMousePressed() then
        SetBool("mouse.pressed",true)
    else
        SetBool("mouse.pressed",false)
    end

    SetInt("mouse.wheel", UiGetMouseWheel()) 

if you have these methods already in your hud.lua then happy days, the mods should work fine.


FAILURE TO COPY THE HUD.LUA FILE WILL MEAN WEAPONS WON'T WORK AND ASKING WHY WEAPONS WON'T WORK DUE TO NOT DOING THIS 
         MAY RESULT IN PANDAS HAVING THEIR FAVOURITE TOYS TAKEN AWAY FROM THEM
 


Setting configs:

A default config for a mounted gun has been included in this script. description to modify for your vehicular setups as follows: 

Always include "#include mountedGun.lua" to enable mounted gun functionality. 


config values: 


--[[
 Vehicle config
]]

vehicle = {
    mainName                 = <VEHICLE NAME> ,
    Vehiclename             = <VEHICLE BODY NAME>,
      CannonName                 = <VEHICLE TURRET / GUN NAME> ,
      CannonJointName         = <VEHICLE TURRET JOINT NAME>,
      Create                     = "elboydo",
      barrelOffset             = <Y OFFSET FROM TURRET TO SPAWN MUNITIONS>
      manualControl            = <ONLY ENABLE PHYSICS BASED CONTROL - FALSE BY DEFAULT, SET TO TRUE TO BLOCK IN VEHICLE TURRET CONTROL>
}
--[[
 Mounted gun config
]]

weaponFeatures = {
    armed                     = <TRUE/FALSE     - VEHICLE CAN USE WEAPONS>
    timeToFire                 = <INT             - PERIOD OVER WHICH TO FIRE A BURST>,
    magazineCapacity         = <INT             - TOTAL NUMBER OF SHOTS PER BURST>,
    reloadTime                 = <INT             - TIME AFTER BURST TO RELOAD WEAPON>,
    hasRockets                 = <BOOL         - CAN THE GUN  FIRE ROCKETS>,
    hasRocketCapacity        = <BOOL         - DOES THE GUN HAVE A FINITE ROCKET SUPPLY,
    rocketCapacity             = <INT             - TOTAL NUMBER OF ROCKETS THE VEHICLE CAN HAVE>,
    rocketStartingAmmo         = <INT             - NUMBER OF ROCKETS THE GUN  SPAWNS WITH>,
    startRockets            = <BOOL         - DOES THE GUN SPAWN WITH ROCKETS LOADED>,  
    hasMG                     = <BOOL         - CAN THE GUN USE AN MG>,
    hasMGCapacity            = <BOOL         - DOES THE MG HAVE A FINITE MG ROUND SUPPLY>,
    MGCapacity                 = <INT             - TOTAL NUMBER OF MG ROUNDS THE GUN CAN HAVE>,
    MGStartingAmmo             = <INT             - NUMBER OF MG ROUNDS THE GUN SPAWNS WITH>,
    displayWeaponDetails    = <BOOL         - DISPLAY EXTRA WEAPON DETAILS ABOUT AMMO LEFT SHOWS ON THE GUN ITSELF>,
    rocketExtraconsumption     = <INT             - DOES FIRING ROCKETS USE EXTRA MUNITIONS (ONLY IMPACTS BURST LENGTH NOT ROCKET AMMMO)>,
    rocketReloadPenalty     = <INT             - EXTRA TIME ADDED TO RELOAD TIME PER ROCKET FIRED>,
    ammoBoxMGName             = <STRING         - NAME OF PROP ACTING AS MG AMMO BOX FOR CHOOSING MUNITION>,
    ammoBoxRocketName         = <STRING         - NAME OF PROP ACTING AS ROCKET AMMO BOX FOR CHOOSING MUNITIONS>
}

Edited by elboydo


What's New in Version 1.0.1   See changelog

Released

added updated bmp code for mode of fire switching


User Feedback

Recommended Comments

There are no comments to display.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

How to Disable AdBlock - And why you should do it?

I have disabled AdBlocker. Refresh the page.