Elspin posted:
Some serious problems with the game:
*Devenger said there was a way to reduce lag, please do
*shitty melee system needs to get fixed, person with the highest ping just plain wins.
*MORE SPAWNPOINTS (everyone spawns on top of each other and it's an endless spawn-kill fest)
*more ammo for pistol (2 sucks, 4 at least?)
*possible fix to spawning on top of each other:No collide team mates?
Fix those, and it'd be perfect. We had a lot of fun playing it today :)
-I think lag reduction is possible, but our highest priority was to get it working and playable. Our next goals are fixing the masts so they actually break and reducing lag
-I think blocking would be good (not holding down block key, it's actual timing), but since the animations aren't working it can fire really fast and that needs to be fixed. See code at bottom of post
-Spawnpoints aren't the problem! It's that the spawnpoint chooser doesn't work right because the map uses spawn points with teleporters to the actual ships. That means that everyone teleports to the same spot like it's not blocked. I've tried several systems for fixing this, but may just remove player-player collisions until it's fixed.
-2 is actually fairly balanced, but what about 3?
Anyway, I'm going to nocollide players (right this second) and then work on the masts breaking. Here's the code for the sabre, can anyone figure out why the animation doesn't play/the view model won't change:
DECAL_SCRATCH3 = "MahackCut" //74 --thanks andyvincent - [url]http://forum.facepunchstudios.com/showthread.php?t=62384[/url] (only viewable to goldmembers)
DECAL_BLOOD1 = 20
bloody = false
//justbloodied = false
//local modelDefined = false
if (SERVER) then
AddCSLuaFile( "shared.lua" )
end
if (CLIENT) then
// local MySelf = LocalPlayer()
SWEP.PrintName = "Sabre"
SWEP.Slot = 0
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false
killicon.Add("weapon_sabre", "gmod/SWEP/sabre_select", Color(255,255,255,255))
end
SWEP.Author = "PirateShip Wars GM9 / Metroid48"
SWEP.Contact = "metroid48@gmail.com"
SWEP.Instructions = ""
SWEP.Spawnable = true
SWEP.HoldType = "melee"
SWEP.ViewModel = "models/sabre/v_sabre.mdl"
SWEP.WorldModel = "models/sabre/w_sabre.mdl"
SWEP.Primary.Delay = 5
SWEP.Primary.Recoil = 0
SWEP.Primary.NumShots = 1
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
//Do NOTHING when player hits reload. This is a sword, not a weapon :D
function SWEP:Reload()
return false
end
function SWEP:Initialize()
bloody = false
// self:SetWeaponHoldType("melee")
// justbloodied = false
end
//Only does stuff when you attack. May add some sort of spark effect if someone pistols/sabres you with your sword out.
function SWEP:Thinks()
//Update view model
if self.Owner:Team() == TEAM_BLUE then
if bloody then
self.Owner.GetViewModel():SetModel("models/sabre/v_sab2e.mdl")
else
self.Owner.GetViewModel():SetModel("models/sabre/v_sabre.mdl")
end
else
if bloody then
self.Owner.GetViewModel():SetModel("models/sabre/v_sab22.mdl")
else
self.Owner.GetViewModel():SetModel("models/sabre/v_sabr2.mdl")
end
end
end
//Primary function, swing your sword like a pirate!
function SWEP:PrimaryAttack()
//Do nothing if you're dead
if self.Owner:Alive() == false then return end
//Start trace function to find if there is anything within 75 units infront of you
local tr = {}
tr.start = self.Owner:GetShootPos()
tr.endpos = tr.start +(self.Owner:GetAimVector()*75)
tr.filter = self.Owner
local trace = util.TraceLine(tr)
//Make sure we hit something
if trace.Hit then
self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER)
if trace.Entity:IsPlayer() || trace.Entity:IsNPC() then //Hit a person/npc >:D
bloody = true
end
self.Weapon:EmitSound("physics/flesh/flesh_impact_bullet"..math.random(3,5)..".wav")
bullet = {} //Credit here goes to XcoliahX for his primary fire script of his lightsaber swep
bullet.Num = 1
bullet.Src = self.Owner:GetShootPos()
bullet.Dir = self.Owner:GetAimVector()
bullet.Spread = Vector(0, 0, 0)
bullet.Tracer = 0
bullet.Force = 0
bullet.Damage = 25
self.Owner:FireBullets(bullet)
else //We missed :(
self.Weapon:SendWeaponAnim(ACT_VM_MISSCENTER)
self.Weapon:EmitSound("weapons/iceaxe/iceaxe_swing1.wav")
end
self.Owner:SetAnimation( PLAYER_ATTACK1 )
end
//Sets animation for pulling it out
function SWEP:Deploy()
// self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
// self.Weapon:EmitSound( "weapons/knife/knife_deploy1.wav" )
return true
end
//Should be for blocking attacks, but won't be yet
function SWEP:SecondaryAttack()
return false
end
I'm also adding in a failsafe for the attack frequency of the sabre, but working animations would be great for the game progress.
EDIT: By the way, my server is still up and will continue to be for another day or so. One note though is map restarts may occur fairly frequently due to testing, but it's still only moderate-lag so it's playable and fun.