Yeah, not the best aesthetics. I can guarantee that Divran will love this, though.
Yes
No
Hello all! This be my first posted contraption on here. It's an Anti Air Gun (manned, not automated) made with Wire, PHX, and a custom Pewpew bullet.
It features 2 AA machine guns, time till reloading is finished, ammo left in both guns, and smooth very little bounce pitch adjustments.
It uses an E2 to control the hydraulics, thrusters, firing, and reloading. It was actually harder to do than I thought..
Anyways, pictures:
I didn't feel like making it pretty or anything, but it works, and it works well.. at least against stationary crappy planes made with vanilla props.
Instructions for Adv Dupe fixing (it breaks mah gun >:C)
1. Unpack AA gun.rar into your garrysmod folder, so addons and data both go into steamapps\{STEAMUSERNAME}\garrysmod\garrysmod\ (It should ask if you want to combine the folders or something similar)
2. Spawn gun
3. Rewire the hydraulics's Constant and Damping to the constant value (Constant - 100000, Damping - 4000 for both hydraulics)
4. Rewire both Pewpew guns to the E2 chip (Gun's Fire to E2's Fire, Gun's Reload to E2's Reload - both guns)
5. Rewire E2 to Pewpew guns (Ammo1 to one of the guns and Ammo2 to the other gun)
6. ???????
7. Profit! (hopefully)
Controls
W - Aim down
S - Aim up
A - Swivel left
D - Swivel right
LMB - Fire
You MAY need to runin your console to reload PewPewBulletsCode:lua_run pewpew:LoadBullets()
Credits:
PewPew - Divran
Wiremod - Wiremod team
AA Gun - Me
Constructive criticism please.
Last edited by SouthtownJR; 06-07-2010 at 05:47 PM. Reason: Updated with dupe and instructions
Yeah, not the best aesthetics. I can guarantee that Divran will love this, though.
Aw, no code or dupe or anything? At least let me see the bullet code![]()
SVN Tutorial
My SVN:Get dropbox and get 250 MB extra space: DropboxCode:http://divranspack.googlecode.com/svn/trunk/%20divranspack/
I agree, asthetics need much work. But hey, it works. and kudos on pewpew--I use pewpew nao since gdc is ridiculously unbalanced (a 100-ton tank can't take one hit from a single 120mm gun...wtf?)
Try using vector thrusters and gps coordinates to aim...works MUCH better, and has an element of stabilization built in. It's a lot easier too. Also, feedback loops work better than high constant values, just for future reference. Try: HydraulicOut = HydraulicIn+((WhatIWant-HydraulicIn)*lownumber)
Because you seem ok, here's my ultra-simple code for gps aiming.
Just put that halfway between front and back vector thrusters, make the rear one a - and the front one a + of some high value, up their weight a tad, and wire the XYZ to the pod controller. Works on remote too.Code:@name GPS-Guided Turret @inputs X Y Z @outputs Xout Yout Zout @persist WX WY WZ runOnTick(1) Pos=entity():pos() WX = Pos:x() WY = Pos:y() WZ = Pos:z() Xout = ((WX)-X) Yout = ((WY)-Y) Zout = ((WZ)-Z)
Thank you basement cat, though I'll have to work a little more with GPS before I try that.^_^
As for Divran, here is my bullet code
I do believe I have it balanced, as it's kind of hard to aim until you've used it for a while, plus it has some recoil for aesthetics ^_^Code:-- AA Gun local BULLET = {} -- General Information BULLET.Name = "AA Gun" BULLET.Author = "Kharderid" BULLET.Description = "AA Machine Gun" BULLET.AdminOnly = false BULLET.SuperAdminOnly = false -- Appearance BULLET.Model = "models/combatmodels/tankshell_25mm.mdl" BULLET.Material = nil BULLET.Color = Color( 255, 238, 0 ) BULLET.Trail = { StartSize = 20, EndSize = 0, Length = .5, Texture = "trails/laser.vmt", Color = Color( 138, 0, 0, 255 ) } -- Effects / Sounds BULLET.FireSound = {"ww2/mg151.wav"} BULLET.ExplosionSound = nil BULLET.FireEffect = "muzzleflash" BULLET.ExplosionEffect = "mghit" BULLET.EmptyMagSound = {"weapons/shotgun/shotgun_empty.wav"} -- Movement BULLET.Speed = 120 BULLET.Gravity = 0.10 BULLET.RecoilForce = 100 BULLET.Spread = 0.6 BULLET.AffectedBySBGravity = true -- Damage BULLET.DamageType = "PointDamage" -- Look in gcombat_damagecontrol.lua for available damage types BULLET.Damage = 50 BULLET.Radius = nil BULLET.RangeDamageMul = nil -- This is only used with "BlastDamage". It determines how much less damage it deals depending on the distance from the center of the blast. BULLET.NumberOfSlices = nil -- this is only used with "SliceDamage". It determines how many props in a line you want to deal damage to. BULLET.SliceDistance = nil -- This is only used with "SliceDamage". It determines the total maximum range the trace will travel. BULLET.Duration = nil -- This is only used with "EMPDamage". It determines how long the target entities will be disabled. BULLET.PlayerDamage = 50 -- Damage vs players. This is only used in "BlastDamage". BULLET.PlayerDamageRadius = nil -- Reloading/Ammo BULLET.Reloadtime = 0.12 BULLET.Ammo = 125 BULLET.AmmoReloadtime = 9 -- Other BULLET.Lifetime = {0,0} -- These two numbers determine the random interval of the bullets lifetime. (Meaning, it runs: "self.Lifetime = math.Rand(self.Bullet.Lifetime[1],self.Bullet.Lifetime[2])") BULLET.ExplodeAfterDeath = false -- This determines wether or not the bullet should explode after the lifetime runs out. False: disappears. True: explodes. BULLET.EnergyPerShot = 300 -- This is the amount of energy the bullet will use per shot. It only uses this if the server has Spacebuild 3 (& co.) installed and if pewpew.EnergyUsage is enabled. BULLET.CustomInputs = nil -- Use a table here to replace the default wire inputs (Only for adv users). BULLET.CustomOutputs = nil -- Use a table here to replace the default wire outputs (Only for adv users). -- Custom Functions (Only for adv users) -- (If you set the override var to true, the cannon/bullet will run these instead. Use these functions to do stuff which is not possible with the above variables) -- I suggest you erase any functions you are not using to minimize file size. -- Wire Input (This is called whenever a wire input is changed. Also called whenever a numpad is pressed. "inputname" and "value" will automatically change to "Fire" or "Reload" and 1/0 when a numpad is pressed) (Is run on: Cannon) BULLET.WireInputOverride = false function BULLET:WireInput( self, inputname, value ) -- Nothing end -- Fire (Is called before the cannon is about to fire) (Is run on: Cannon) BULLET.FireOverride = false function BULLET:Fire( self ) -- Nothing end -- Initialize (Is called when the bullet initializes) (Is run on: Bullet) BULLET.InitializeOverride = false function BULLET:InitializeFunc( self ) -- Nothing end -- Cannon Think (Is run on: Cannon) BULLET.CannonThinkOverride = false function BULLET:CannonThink( self ) -- Nothing end -- Think (Is run on: Bullet) BULLET.ThinkOverride = false function BULLET:ThinkFunc( self ) -- Nothing end -- Explode (Is called when the bullet explodes) Note: this will not run if you override the think function (unless you call it from there as well) (Is run on: Bullet) BULLET.ExplodeOverride = false function BULLET:Explode( self, trace ) -- Nothing end -- This is called when the cannon collides (Is run on: Cannon) BULLET.CannonPhysicsCollideOverride = false function BULLET:CannonPhysicsCollideFunc(Data, PhysObj) -- Nothing end -- This is called when the cannon touches another entity (Is run on: Cannon) BULLET.CannonTouchOverride = false function BULLET:CannonTouchFunc(Ent) end -- This is called when the bullet collides (Advanced users only. It only works if you first override initialize and change it to vphysics) (Is run on: Bullet) BULLET.PhysicsCollideOverride = false function BULLET:PhysicsCollideFunc(CollisionData, PhysObj) -- Nothing end -- Client side overrides: -- Initialize (Is run on: Bullet) BULLET.CLInitializeOverride = false function BULLET:CLInitializeFunc() -- Nothing end -- Cannon Initialize (Is run on: Cannon) BULLET.CLCannonInitializeOverride = false function BULLET:CLCannonInitializeFunc() -- Nothing end -- Think (Is run on: Bullet) BULLET.CLThinkOverride = false function BULLET:CLThinkFunc() -- Nothing end -- Cannon Think (Is run on: Cannon) BULLET.CLCannonThinkOverride = false function BULLET:CLCannonThinkFunc() -- Nothing end -- Draw (Is run on: Bullet) BULLET.CLDrawOverride = false function BULLET:CLDrawFunc() -- Nothing end -- Cannon Draw (Is run on: Cannon) BULLET.CLCannonDrawOverride = false function BULLET:CLCannonDrawFunc() -- Nothing end pewpew:AddBullet( BULLET )
I'll update the first post with an adv dupe, and instructions on how to fix it after you spawn it (adv dupe breaks some of it D: )
Edit: First post updated!
Last edited by SouthtownJR; 06-07-2010 at 05:49 PM. Reason: Had to fix Divran's name lol.. I spelled it wrong
adv dupe breaks EVERYTHING it seems. Your bullet looks good, seems a tad bit overpowered for ME, but I make very light planes so you should be good. It actually resembles an AA code I made. One suggestion, try as an experiment changing the effect on impact from mghit to pewpew_smokepuff. I use it for my mortar, it's the effect of the flak cannon.(adv dupe breaks some of it D: )
Good to see other people making pew pew stuff. I think it's gonna catch on. Just gotta keep it balanced XD
I am hesitant answer your poll: the answer I would give is not yes or no.
Bookmarks