Updated to Revision 318
This commit is contained in:
parent
ef82653fad
commit
2e6047098b
|
@ -2,10 +2,10 @@ ACF = {}
|
|||
ACF.AmmoTypes = {}
|
||||
ACF.MenuFunc = {}
|
||||
ACF.AmmoBlacklist = {}
|
||||
ACF.Version = 316 -- Make sure to change this as the version goes up or the update check is for nothing! -wrex
|
||||
ACF.Version = 318 -- Make sure to change this as the version goes up or the update check is for nothing! -wrex
|
||||
ACF.CurrentVersion = 0 -- just defining a variable, do not change
|
||||
--##############
|
||||
ACF.Version2 = 32
|
||||
ACF.Version2 = 33
|
||||
ACF.CurrentVersion2 = 0
|
||||
print("[[ ACF Loaded ]]")
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@ ENT.AutomaticFrameAdvance = true
|
|||
function ENT:Draw()
|
||||
self:DoNormalDraw()
|
||||
self:DrawModel()
|
||||
Wire_Render(self.Entity)
|
||||
Wire_Render(self)
|
||||
end
|
||||
|
||||
function ENT:DoNormalDraw()
|
||||
local e = self.Entity
|
||||
local e = self
|
||||
if (LocalPlayer():GetEyeTrace().Entity == e and EyePos():Distance(e:GetPos()) < 256) then
|
||||
if(self:GetOverlayText() ~= "") then
|
||||
AddWorldTip(e:EntIndex(),self:GetOverlayText(),0.5,e:GetPos(),e)
|
||||
|
@ -20,12 +20,12 @@ function ENT:DoNormalDraw()
|
|||
end
|
||||
|
||||
function ENT:GetOverlayText()
|
||||
local name = self.Entity:GetNetworkedString("WireName")
|
||||
local Type = self.Entity:GetNetworkedBeamString("Type")
|
||||
local TorqueAdd = self.Entity:GetNetworkedBeamInt("TorqueAdd")
|
||||
local MaxRPMAdd = self.Entity:GetNetworkedBeamInt("MaxRPMAdd")
|
||||
local LimitRPMAdd = self.Entity:GetNetworkedBeamInt("LimitRPMAdd")
|
||||
local Weight = self.Entity:GetNetworkedBeamInt("Weight")
|
||||
local name = self:GetNetworkedString("WireName")
|
||||
local Type = self:GetNetworkedBeamString("Type")
|
||||
local TorqueAdd = self:GetNetworkedBeamInt("TorqueAdd")
|
||||
local MaxRPMAdd = self:GetNetworkedBeamInt("MaxRPMAdd")
|
||||
local LimitRPMAdd = self:GetNetworkedBeamInt("LimitRPMAdd")
|
||||
local Weight = self:GetNetworkedBeamInt("Weight")
|
||||
|
||||
local txt = Type.."\nTorque Add : "..TorqueAdd.."Tq\nMax Rpm Add : "..MaxRPMAdd.."Rpm\nLimit Rpm Add : "..LimitRPMAdd.."Rpm\nWeight : "..Weight.."Kg\n" or ""
|
||||
if (not game.SinglePlayer()) then
|
||||
|
|
|
@ -11,9 +11,9 @@ function ENT:Initialize()
|
|||
|
||||
self.CanUpdate = true
|
||||
|
||||
self.Inputs = Wire_CreateInputs( self.Entity, { "ActiveChips" } )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self.Entity, { "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "Active" }, { "NORMAL", "NORMAL", "NORMAL", "NORMAL" } )
|
||||
Wire_TriggerOutput(self.Entity, "Entity", self.Entity)
|
||||
self.Inputs = Wire_CreateInputs( self, { "ActiveChips" } )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self, { "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "Active" }, { "NORMAL", "NORMAL", "NORMAL", "NORMAL" } )
|
||||
Wire_TriggerOutput(self, "Entity", self)
|
||||
self.WireDebugName = "ACF Chips"
|
||||
|
||||
end
|
||||
|
@ -64,11 +64,6 @@ function MakeACF_Chips(Owner, Pos, Angle, Id, Data1, Data2, Data3)
|
|||
Chips:SetNetworkedBeamInt("LimitRPMAdd",Chips.LimitRPMAdd2)
|
||||
Chips:SetNetworkedBeamInt("Weight",Chips.Weight)
|
||||
|
||||
undo.Create("ACF Chips")
|
||||
undo.AddEntity( Chips )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_chips", Chips)
|
||||
Owner:AddCleanup( "acfmenu", Chips )
|
||||
|
||||
|
@ -131,20 +126,20 @@ function ENT:TriggerInput( iname , value )
|
|||
self.TorqueAdd3 = self.TorqueAdd2
|
||||
self.MaxRPMAdd3 = self.MaxRPMAdd2
|
||||
self.LimitRPMAdd3 = self.LimitRPMAdd2
|
||||
Wire_TriggerOutput(self.Entity, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self.Entity, "MaxRpmAdd", self.MaxRPMAdd3)
|
||||
Wire_TriggerOutput(self.Entity, "LimitRpmAdd", self.LimitRPMAdd3)
|
||||
Wire_TriggerOutput(self.Entity, "Active", self.ActiveChips2)
|
||||
Wire_TriggerOutput(self, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self, "MaxRpmAdd", self.MaxRPMAdd3)
|
||||
Wire_TriggerOutput(self, "LimitRpmAdd", self.LimitRPMAdd3)
|
||||
Wire_TriggerOutput(self, "Active", self.ActiveChips2)
|
||||
elseif (value <= 0) then
|
||||
self.ActiveChips = false
|
||||
self.ActiveChips2 = 0
|
||||
self.TorqueAdd3 = 0
|
||||
self.MaxRPMAdd3 = 0
|
||||
self.LimitRPMAdd3 = 0
|
||||
Wire_TriggerOutput(self.Entity, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self.Entity, "MaxRpmAdd", self.MaxRPMAdd3)
|
||||
Wire_TriggerOutput(self.Entity, "LimitRpmAdd", self.LimitRPMAdd3)
|
||||
Wire_TriggerOutput(self.Entity, "Active", self.ActiveChips2)
|
||||
Wire_TriggerOutput(self, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self, "MaxRpmAdd", self.MaxRPMAdd3)
|
||||
Wire_TriggerOutput(self, "LimitRpmAdd", self.LimitRPMAdd3)
|
||||
Wire_TriggerOutput(self, "Active", self.ActiveChips2)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -152,11 +147,11 @@ end
|
|||
|
||||
|
||||
function ENT:OnRemove()
|
||||
Wire_Remove(self.Entity)
|
||||
Wire_Remove(self)
|
||||
end
|
||||
|
||||
function ENT:OnRestore()
|
||||
Wire_Restored(self.Entity)
|
||||
Wire_Restored(self)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ function ENT:Initialize()
|
|||
self.CutRpm = 0
|
||||
--####################
|
||||
|
||||
self.Inputs = Wire_CreateInputs( self.Entity, { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self.Entity, { "RPM", "Torque", "Power", "Entity" , "Mass" , "Physical Mass" }, { "NORMAL" ,"NORMAL" ,"NORMAL" , "ENTITY" , "NORMAL" , "NORMAL" } )
|
||||
Wire_TriggerOutput(self.Entity, "Entity", self.Entity)
|
||||
self.Inputs = Wire_CreateInputs( self, { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self, { "RPM", "Torque", "Power", "Entity" , "Mass" , "Physical Mass" }, { "NORMAL" ,"NORMAL" ,"NORMAL" , "ENTITY" , "NORMAL" , "NORMAL" } )
|
||||
Wire_TriggerOutput(self, "Entity", self)
|
||||
self.WireDebugName = "ACF Engine2"
|
||||
|
||||
end
|
||||
|
@ -128,11 +128,6 @@ function MakeACF_Engine2(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Data
|
|||
Engine2:SetNetworkedBeamInt("Rpm",Engine2.FlyRPM)
|
||||
--####################################################
|
||||
|
||||
undo.Create("ACF Engine2")
|
||||
undo.AddEntity( Engine2 )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_engine2", Engine2)
|
||||
Owner:AddCleanup( "acfmenu", Engine2 )
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ function ENT:Initialize()
|
|||
self.CutRpm = 0
|
||||
--####################
|
||||
|
||||
self.Inputs = Wire_CreateInputs( self.Entity, { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self.Entity, { "RPM", "Torque", "Power", "Entity" , "Mass" , "Physical Mass" }, { "NORMAL" ,"NORMAL" ,"NORMAL" , "ENTITY" , "NORMAL" , "NORMAL" } )
|
||||
Wire_TriggerOutput(self.Entity, "Entity", self.Entity)
|
||||
self.Inputs = Wire_CreateInputs( self, { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self, { "RPM", "Torque", "Power", "Entity" , "Mass" , "Physical Mass" }, { "NORMAL" ,"NORMAL" ,"NORMAL" , "ENTITY" , "NORMAL" , "NORMAL" } )
|
||||
Wire_TriggerOutput(self, "Entity", self)
|
||||
self.WireDebugName = "ACF Engine3"
|
||||
|
||||
end
|
||||
|
@ -114,11 +114,6 @@ function MakeACF_Engine3(Owner, Pos, Angle, Id)
|
|||
Engine3:SetNetworkedBeamInt("Rpm",Engine3.FlyRPM)
|
||||
--####################################################
|
||||
|
||||
undo.Create("ACF Engine3")
|
||||
undo.AddEntity( Engine3 )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_engine", Engine3)
|
||||
Owner:AddCleanup( "acfmenu", Engine3 )
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ function ENT:Initialize()
|
|||
self.CutRpm = 0
|
||||
--####################
|
||||
|
||||
self.Inputs = Wire_CreateInputs( self.Entity, { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self.Entity, { "RPM", "Torque", "Power", "Entity" , "Mass" , "Physical Mass" }, { "NORMAL" ,"NORMAL" ,"NORMAL" , "ENTITY" , "NORMAL" , "NORMAL" } )
|
||||
Wire_TriggerOutput(self.Entity, "Entity", self.Entity)
|
||||
self.Inputs = Wire_CreateInputs( self, { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self, { "RPM", "Torque", "Power", "Entity" , "Mass" , "Physical Mass" }, { "NORMAL" ,"NORMAL" ,"NORMAL" , "ENTITY" , "NORMAL" , "NORMAL" } )
|
||||
Wire_TriggerOutput(self, "Entity", self)
|
||||
self.WireDebugName = "ACF Engine4"
|
||||
|
||||
end
|
||||
|
@ -128,11 +128,6 @@ function MakeACF_Engine4(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Data
|
|||
Engine4:SetNetworkedBeamInt("Rpm",Engine4.FlyRPM)
|
||||
--####################################################
|
||||
|
||||
undo.Create("ACF Engine4")
|
||||
undo.AddEntity( Engine4 )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_engine4", Engine4)
|
||||
Owner:AddCleanup( "acfmenu", Engine4 )
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ function ENT:Initialize()
|
|||
self.CutRpm = 0
|
||||
--####################
|
||||
|
||||
self.Inputs = Wire_CreateInputs( self.Entity, { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self.Entity, { "RPM", "Torque", "Power", "Entity" , "Mass" , "Physical Mass" }, { "NORMAL" ,"NORMAL" ,"NORMAL" , "ENTITY" , "NORMAL" , "NORMAL" } )
|
||||
Wire_TriggerOutput(self.Entity, "Entity", self.Entity)
|
||||
self.Inputs = Wire_CreateInputs( self, { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self, { "RPM", "Torque", "Power", "Entity" , "Mass" , "Physical Mass" }, { "NORMAL" ,"NORMAL" ,"NORMAL" , "ENTITY" , "NORMAL" , "NORMAL" } )
|
||||
Wire_TriggerOutput(self, "Entity", self)
|
||||
self.WireDebugName = "ACF Engine5"
|
||||
|
||||
end
|
||||
|
@ -168,11 +168,6 @@ function MakeACF_Engine5(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Data
|
|||
Engine5:SetNetworkedBeamInt("Rpm",Engine5.FlyRPM)
|
||||
--####################################################
|
||||
|
||||
undo.Create("ACF Engine5")
|
||||
undo.AddEntity( Engine5 )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_engine5", Engine5)
|
||||
Owner:AddCleanup( "acfmenu", Engine5 )
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ function MakeACF_Gearbox2(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Dat
|
|||
local Gearbox2 = ents.Create("ACF_Gearbox2")
|
||||
local List = list.Get("ACFEnts")
|
||||
local Classes = list.Get("ACFClasses")
|
||||
if not Gearbox2:IsValid() then return false end
|
||||
if not IsValid( Gearbox2 ) then return false end
|
||||
Gearbox2:SetAngles(Angle)
|
||||
Gearbox2:SetPos(Pos)
|
||||
Gearbox2:Spawn()
|
||||
|
@ -138,11 +138,6 @@ function MakeACF_Gearbox2(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Dat
|
|||
Gearbox2.OutL = Gearbox2:WorldToLocal(Gearbox2:GetAttachment(Gearbox2:LookupAttachment( "driveshaftL" )).Pos)
|
||||
Gearbox2.OutR = Gearbox2:WorldToLocal(Gearbox2:GetAttachment(Gearbox2:LookupAttachment( "driveshaftR" )).Pos)
|
||||
|
||||
undo.Create("ACF Gearbox2")
|
||||
undo.AddEntity( Gearbox2 )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_Gearbox2", Gearbox2)
|
||||
Owner:AddCleanup( "acfmenu", Gearbox2 )
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ function MakeACF_Gearbox3(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Dat
|
|||
local Gearbox3 = ents.Create("ACF_Gearbox3")
|
||||
local List = list.Get("ACFEnts")
|
||||
local Classes = list.Get("ACFClasses")
|
||||
if not Gearbox3:IsValid() then return false end
|
||||
if not IsValid( Gearbox3 ) then return false end
|
||||
Gearbox3:SetAngles(Angle)
|
||||
Gearbox3:SetPos(Pos)
|
||||
Gearbox3:Spawn()
|
||||
|
@ -141,11 +141,6 @@ function MakeACF_Gearbox3(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Dat
|
|||
Gearbox3.OutL = Gearbox3:WorldToLocal(Gearbox3:GetAttachment(Gearbox3:LookupAttachment( "driveshaftL" )).Pos)
|
||||
Gearbox3.OutR = Gearbox3:WorldToLocal(Gearbox3:GetAttachment(Gearbox3:LookupAttachment( "driveshaftR" )).Pos)
|
||||
|
||||
undo.Create("ACF Gearbox3")
|
||||
undo.AddEntity( Gearbox3 )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_Gearbox3", Gearbox3)
|
||||
Owner:AddCleanup( "acfmenu", Gearbox3 )
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@ ENT.AutomaticFrameAdvance = true
|
|||
function ENT:Draw()
|
||||
self:DoNormalDraw()
|
||||
self:DrawModel()
|
||||
Wire_Render(self.Entity)
|
||||
Wire_Render(self)
|
||||
end
|
||||
|
||||
function ENT:DoNormalDraw()
|
||||
local e = self.Entity
|
||||
local e = self
|
||||
if (LocalPlayer():GetEyeTrace().Entity == e and EyePos():Distance(e:GetPos()) < 256) then
|
||||
if(self:GetOverlayText() ~= "") then
|
||||
AddWorldTip(e:EntIndex(),self:GetOverlayText(),0.5,e:GetPos(),e)
|
||||
|
@ -20,11 +20,11 @@ function ENT:DoNormalDraw()
|
|||
end
|
||||
|
||||
function ENT:GetOverlayText()
|
||||
local name = self.Entity:GetNetworkedString("WireName")
|
||||
local Type = self.Entity:GetNetworkedBeamString("Type")
|
||||
local TorqueAdd = self.Entity:GetNetworkedBeamInt("TorqueAdd")
|
||||
local Usable = self.Entity:GetNetworkedBeamInt("Usable")
|
||||
local Weight = self.Entity:GetNetworkedBeamInt("Weight")
|
||||
local name = self:GetNetworkedString("WireName")
|
||||
local Type = self:GetNetworkedBeamString("Type")
|
||||
local TorqueAdd = self:GetNetworkedBeamInt("TorqueAdd")
|
||||
local Usable = self:GetNetworkedBeamInt("Usable")
|
||||
local Weight = self:GetNetworkedBeamInt("Weight")
|
||||
|
||||
local txt = Type.."\nTorque Add : "..TorqueAdd.."Tq\nUsable : "..Usable.."\nWeight : "..Weight.."Kg\n" or ""
|
||||
if (not game.SinglePlayer()) then
|
||||
|
|
|
@ -21,9 +21,9 @@ function ENT:Initialize()
|
|||
self.LegalThink = 0
|
||||
self.LastActive = 0
|
||||
|
||||
self.Inputs = Wire_CreateInputs( self.Entity, { "ActiveNos" } )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self.Entity, { "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "Active", "Usable" }, { "NORMAL", "NORMAL", "NORMAL", "NORMAL", "NORMAL" } )
|
||||
Wire_TriggerOutput(self.Entity, "Entity", self.Entity)
|
||||
self.Inputs = Wire_CreateInputs( self, { "ActiveNos" } )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self, { "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "Active", "Usable" }, { "NORMAL", "NORMAL", "NORMAL", "NORMAL", "NORMAL" } )
|
||||
Wire_TriggerOutput(self, "Entity", self)
|
||||
self.WireDebugName = "ACF Nos"
|
||||
end
|
||||
|
||||
|
@ -85,11 +85,6 @@ function MakeACF_Nos(Owner, Pos, Angle, Id, Data1)
|
|||
Nos:SetNetworkedBeamInt("Usable",Nos.UsableNos)
|
||||
Nos:SetNetworkedBeamInt("Weight",Nos.Weight)
|
||||
|
||||
undo.Create("ACF Nos")
|
||||
undo.AddEntity( Nos )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_nos", Nos)
|
||||
Owner:AddCleanup( "acfmenu", Nos )
|
||||
|
||||
|
@ -137,11 +132,11 @@ function ENT:Update( ArgsTable ) --That table is the player data, as sorted in t
|
|||
self.BoostTime = 10
|
||||
|
||||
--send Wire Outputs
|
||||
Wire_TriggerOutput(self.Entity, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self.Entity, "MaxRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self.Entity, "LimitRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self.Entity, "Usable", self.UsableNos)
|
||||
Wire_TriggerOutput(self.Entity, "Active", self.ActiveChips2)
|
||||
Wire_TriggerOutput(self, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self, "MaxRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self, "LimitRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self, "Usable", self.UsableNos)
|
||||
Wire_TriggerOutput(self, "Active", self.ActiveChips2)
|
||||
--Send to GUI
|
||||
self:SetNetworkedBeamString("Type",List["Mobility2"][Id]["name"])
|
||||
self:SetNetworkedBeamInt("TorqueAdd",self.TorqueAdd2)
|
||||
|
@ -168,7 +163,7 @@ function ENT:Think()
|
|||
local Time = CurTime()
|
||||
|
||||
if self.LegalThink < Time and self.LastActive+2 > Time then
|
||||
if self.Entity:GetPhysicsObject():GetMass() < self.Mass or self.Entity:GetParent():IsValid() then
|
||||
if self:GetPhysicsObject():GetMass() < self.Mass or self:GetParent():IsValid() then
|
||||
self.Legal = false
|
||||
else
|
||||
self.Legal = true
|
||||
|
@ -188,10 +183,10 @@ function ENT:Think()
|
|||
end
|
||||
self.Sound = nil
|
||||
--Send Wire Outputs
|
||||
Wire_TriggerOutput(self.Entity, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self.Entity, "MaxRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self.Entity, "LimitRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self.Entity, "Active", self.ActiveChips2)
|
||||
Wire_TriggerOutput(self, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self, "MaxRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self, "LimitRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self, "Active", self.ActiveChips2)
|
||||
--send GUI
|
||||
self:SetNetworkedBeamInt("TorqueAdd",self.TorqueAdd2)
|
||||
self:SetNetworkedBeamInt("Usable",self.UsableNos)
|
||||
|
@ -200,7 +195,7 @@ function ENT:Think()
|
|||
if self.AllowNos < CurTime() and self.UsableNos == 0 then
|
||||
self.UsableNos = 1 --usable
|
||||
--send wire
|
||||
Wire_TriggerOutput(self.Entity, "Usable", self.UsableNos)
|
||||
Wire_TriggerOutput(self, "Usable", self.UsableNos)
|
||||
--send GUI
|
||||
self:SetNetworkedBeamInt("TorqueAdd",self.TorqueAdd2)
|
||||
self:SetNetworkedBeamInt("Usable",self.UsableNos)
|
||||
|
@ -208,7 +203,7 @@ function ENT:Think()
|
|||
end
|
||||
|
||||
|
||||
self.Entity:NextThink(Time+1)
|
||||
self:NextThink(Time+1)
|
||||
return true
|
||||
|
||||
end
|
||||
|
@ -221,11 +216,11 @@ function ENT:PowerUp(value)
|
|||
self.TorqueAdd3 = self.TorqueAdd2 --Get Torque
|
||||
self.RpmAddFinal = self.RpmAdd --Get RPM
|
||||
--Send Wire Outputs
|
||||
Wire_TriggerOutput(self.Entity, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self.Entity, "MaxRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self.Entity, "LimitRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self.Entity, "Usable", self.UsableNos)
|
||||
Wire_TriggerOutput(self.Entity, "Active", self.ActiveChips2)
|
||||
Wire_TriggerOutput(self, "TqAdd", self.TorqueAdd3)
|
||||
Wire_TriggerOutput(self, "MaxRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self, "LimitRpmAdd", self.RpmAddFinal)
|
||||
Wire_TriggerOutput(self, "Usable", self.UsableNos)
|
||||
Wire_TriggerOutput(self, "Active", self.ActiveChips2)
|
||||
--send GUI
|
||||
self:SetNetworkedBeamInt("TorqueAdd",self.TorqueAdd2)
|
||||
self:SetNetworkedBeamInt("Usable",self.UsableNos)
|
||||
|
@ -236,11 +231,11 @@ end
|
|||
|
||||
|
||||
function ENT:OnRemove()
|
||||
Wire_Remove(self.Entity)
|
||||
Wire_Remove(self)
|
||||
end
|
||||
|
||||
function ENT:OnRestore()
|
||||
Wire_Restored(self.Entity)
|
||||
Wire_Restored(self)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@ ENT.AutomaticFrameAdvance = true
|
|||
function ENT:Draw()
|
||||
self:DoNormalDraw()
|
||||
self:DrawModel()
|
||||
Wire_Render(self.Entity)
|
||||
Wire_Render(self)
|
||||
end
|
||||
|
||||
function ENT:DoNormalDraw()
|
||||
local e = self.Entity
|
||||
local e = self
|
||||
if (LocalPlayer():GetEyeTrace().Entity == e and EyePos():Distance(e:GetPos()) < 256) then
|
||||
if(self:GetOverlayText() ~= "") then
|
||||
AddWorldTip(e:EntIndex(),self:GetOverlayText(),0.5,e:GetPos(),e)
|
||||
|
@ -20,10 +20,10 @@ function ENT:DoNormalDraw()
|
|||
end
|
||||
|
||||
function ENT:GetOverlayText()
|
||||
local name = self.Entity:GetNetworkedString("WireName")
|
||||
local Type = self.Entity:GetNetworkedBeamString("Type")
|
||||
local Kicking = self.Entity:GetNetworkedBeamInt("Kicking")
|
||||
local Weight = self.Entity:GetNetworkedBeamInt("Weight")
|
||||
local name = self:GetNetworkedString("WireName")
|
||||
local Type = self:GetNetworkedBeamString("Type")
|
||||
local Kicking = self:GetNetworkedBeamInt("Kicking")
|
||||
local Weight = self:GetNetworkedBeamInt("Weight")
|
||||
|
||||
local txt = Type.."\nKick Rpm : "..Kicking.."Rpm\nWeight : "..Weight.."Kg\n" or ""
|
||||
if (not game.SinglePlayer()) then
|
||||
|
|
|
@ -11,9 +11,9 @@ function ENT:Initialize()
|
|||
|
||||
self.CanUpdate = true
|
||||
|
||||
self.Inputs = Wire_CreateInputs( self.Entity, { "RPM" } )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self.Entity, { "ActiveChips" }, { "NORMAL" } )
|
||||
Wire_TriggerOutput(self.Entity, "Entity", self.Entity)
|
||||
self.Inputs = Wire_CreateInputs( self, { "RPM" } )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self, { "ActiveChips" }, { "NORMAL" } )
|
||||
Wire_TriggerOutput(self, "Entity", self)
|
||||
self.WireDebugName = "ACF Vtec"
|
||||
|
||||
end
|
||||
|
@ -57,11 +57,6 @@ function MakeACF_Vtec(Owner, Pos, Angle, Id, Data1)
|
|||
Vtec:SetNetworkedBeamInt("Kicking",Vtec.KickRpm)
|
||||
Vtec:SetNetworkedBeamInt("Weight",Vtec.Weight)
|
||||
|
||||
undo.Create("ACF Vtec")
|
||||
undo.AddEntity( Vtec )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_vtec", Vtec)
|
||||
Owner:AddCleanup( "acfmenu", Vtec )
|
||||
|
||||
|
@ -111,11 +106,11 @@ function ENT:TriggerInput( iname , value )
|
|||
if (value > self.Kickv) then
|
||||
self.RPM = true
|
||||
self.KickActive = 1
|
||||
Wire_TriggerOutput(self.Entity, "ActiveChips", self.KickActive)
|
||||
Wire_TriggerOutput(self, "ActiveChips", self.KickActive)
|
||||
elseif (value <= self.Kickv) then
|
||||
self.RPM = false
|
||||
self.KickActive = 0
|
||||
Wire_TriggerOutput(self.Entity, "ActiveChips", self.KickActive)
|
||||
Wire_TriggerOutput(self, "ActiveChips", self.KickActive)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -123,10 +118,10 @@ end
|
|||
|
||||
|
||||
function ENT:OnRemove()
|
||||
Wire_Remove(self.Entity)
|
||||
Wire_Remove(self)
|
||||
end
|
||||
|
||||
function ENT:OnRestore()
|
||||
Wire_Restored(self.Entity)
|
||||
Wire_Restored(self)
|
||||
end
|
||||
|
|
@ -121,12 +121,7 @@ function MakeACF_Ammo(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Data5,
|
|||
local phys = Ammo:GetPhysicsObject()
|
||||
if (phys:IsValid()) then
|
||||
phys:SetMass( Ammo.Mass )
|
||||
end
|
||||
|
||||
undo.Create("ACF Ammo")
|
||||
undo.AddEntity( Ammo )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
end
|
||||
|
||||
Owner:AddCount( "_acf_ammo", Ammo )
|
||||
Owner:AddCleanup( "acfmenu", Ammo )
|
||||
|
|
|
@ -33,7 +33,7 @@ function ENT:Initialize()
|
|||
self.CutRpm = 0
|
||||
--####################
|
||||
|
||||
self.Inputs = Wire_CreateInputs( self.Entity, { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Inputs = Wire_CreateInputs( self { "Active", "Throttle", "TqAdd", "MaxRpmAdd", "LimitRpmAdd", "FlywheelMass", "Idle", "DisableCut"} )
|
||||
self.Outputs = WireLib.CreateSpecialOutputs( self, { "RPM", "Torque", "Power", "Entity" , "Mass" , "Physical Mass" }, { "NORMAL" ,"NORMAL" ,"NORMAL" , "ENTITY" , "NORMAL" , "NORMAL" } )
|
||||
Wire_TriggerOutput( self, "Entity", self )
|
||||
self.WireDebugName = "ACF Engine"
|
||||
|
@ -116,11 +116,6 @@ function MakeACF_Engine(Owner, Pos, Angle, Id)
|
|||
Engine:SetNetworkedBeamInt("Rpm",Engine.FlyRPM)
|
||||
--####################################################
|
||||
|
||||
undo.Create("ACF Engine")
|
||||
undo.AddEntity( Engine )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_engine", Engine)
|
||||
Owner:AddCleanup( "acfmenu", Engine )
|
||||
|
||||
|
@ -384,7 +379,7 @@ function ENT:ACFInit()
|
|||
|
||||
end
|
||||
|
||||
function ENT:CalcRPM( )
|
||||
function ENT:CalcRPM()
|
||||
|
||||
local DeltaTime = CurTime() - self.LastThink
|
||||
-- local AutoClutch = math.min(math.max(self.FlyRPM-self.IdleRPM,0)/(self.IdleRPM+self.LimitRPM/10),1)
|
||||
|
|
|
@ -46,7 +46,7 @@ function MakeACF_Gearbox(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Data
|
|||
local Gearbox = ents.Create("ACF_Gearbox")
|
||||
local List = list.Get("ACFEnts")
|
||||
local Classes = list.Get("ACFClasses")
|
||||
if not Gearbox:IsValid() then return false end
|
||||
if not IsValid( Gearbox ) then return false end
|
||||
Gearbox:SetAngles(Angle)
|
||||
Gearbox:SetPos(Pos)
|
||||
Gearbox:Spawn()
|
||||
|
@ -118,11 +118,6 @@ function MakeACF_Gearbox(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Data
|
|||
Gearbox.OutL = Gearbox:WorldToLocal(Gearbox:GetAttachment(Gearbox:LookupAttachment( "driveshaftL" )).Pos)
|
||||
Gearbox.OutR = Gearbox:WorldToLocal(Gearbox:GetAttachment(Gearbox:LookupAttachment( "driveshaftR" )).Pos)
|
||||
|
||||
undo.Create("ACF Gearbox")
|
||||
undo.AddEntity( Gearbox )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_Gearbox", Gearbox)
|
||||
Owner:AddCleanup( "acfmenu", Gearbox )
|
||||
|
||||
|
@ -323,10 +318,10 @@ function ENT:CheckEnts() --Check if every entity we are linked to still actuall
|
|||
end
|
||||
|
||||
function ENT:Calc( InputRPM, InputInertia )
|
||||
|
||||
if self.LastActive == CurTime() then
|
||||
return math.min(self.TotalReqTq, self.MaxTorque)
|
||||
end
|
||||
|
||||
if self.ChangeFinished < CurTime() and self.GearRatio != 0 then
|
||||
self.InGear = true
|
||||
end
|
||||
|
@ -384,8 +379,8 @@ end
|
|||
function ENT:Act( Torque, DeltaTime )
|
||||
|
||||
local ReactTq = 0
|
||||
--local AvailTq = math.min(math.abs(Torque)/self.TotalReqTq,1)/self.GearRatio*-(-Torque/math.abs(Torque)) --Calculate the ratio of total requested torque versus what's avaliable, and then multiply it but the current gearratio
|
||||
|
||||
--local AvailTq = math.min(math.abs(Torque)/self.TotalReqTq,1)/self.GearRatio*-(-Torque/math.abs(Torque))
|
||||
-- Calculate the ratio of total requested torque versus what's avaliable, and then multiply it but the current gearratio
|
||||
local AvailTq = 0
|
||||
if Torque != 0 then
|
||||
AvailTq = math.min(math.abs(Torque)/self.TotalReqTq,1)/self.GearRatio*-(-Torque/math.abs(Torque))
|
||||
|
|
|
@ -126,11 +126,6 @@ function MakeACF_Gun(Owner, Pos, Angle, Id)
|
|||
phys:SetMass( Gun.Mass )
|
||||
end
|
||||
|
||||
undo.Create("ACF Gun")
|
||||
undo.AddEntity( Gun )
|
||||
undo.SetPlayer( Owner )
|
||||
undo.Finish()
|
||||
|
||||
Owner:AddCount("_acf_gun", Gun)
|
||||
Owner:AddCleanup( "acfmenu", Gun )
|
||||
|
||||
|
|
|
@ -21,16 +21,25 @@ cleanup.Register( "acfmenu" )
|
|||
|
||||
if CLIENT then
|
||||
language.Add( "Tool.acfmenu.listname", "ACF Menu" )
|
||||
language.Add( "Tool.acfmenu.name", "ACF Custom BM V6.5" )
|
||||
language.Add( "Tool.acfmenu.name", "Armored Combat Framework Custom" )
|
||||
language.Add( "Tool.acfmenu.desc", "Spawn the ACF weapons and ammo" )
|
||||
language.Add( "Tool.acfmenu.0", "Left click to spawn the entity of your choice, Right click to link an entity to another (+Use to unlink)" )
|
||||
language.Add( "Tool.acfmenu.1", "Right click to link the selected sensor to a pod" )
|
||||
|
||||
language.Add( "Undone_ACF Entity", "Undone ACF Entity" )
|
||||
language.Add( "Undone_ACF Engine", "Undone ACF Engine" )
|
||||
language.Add( "Undone_ACF Gearbox", "Undone ACF Gearbox" )
|
||||
language.Add( "Undone_ACF Ammo", "Undone ACF Ammo" )
|
||||
language.Add( "Undone_ACF Gun", "Undone ACF Gun" )
|
||||
language.Add( "Undone_acf_engine", "Undone ACF Engine" )
|
||||
language.Add( "Undone_acf_engine2", "Undone ACF Engine" )
|
||||
language.Add( "Undone_acf_engine3", "Undone ACF Engine" )
|
||||
language.Add( "Undone_acf_engine4", "Undone ACF Engine" )
|
||||
language.Add( "Undone_acf_engine5", "Undone ACF Engine Maker" )
|
||||
language.Add( "Undone_acf_gearbox", "Undone ACF Gearbox" )
|
||||
language.Add( "Undone_acf_gearbox2", "Undone ACF Gearbox CVT" )
|
||||
language.Add( "Undone_acf_gearbox3", "Undone ACF Gearbox Automatic" )
|
||||
language.Add( "Undone_acf_chips", "Undone ACF Engine Chips" )
|
||||
language.Add( "Undone_acf_vtec", "Undone ACF Vtec Chip" )
|
||||
language.Add( "Undone_acf_nos", "Undone ACF Nos Bottle" )
|
||||
language.Add( "Undone_acf_ammo", "Undone ACF Ammo" )
|
||||
language.Add( "Undone_acf_gun", "Undone ACF Gun" )
|
||||
language.Add( "SBoxLimit_acf_gun", "You've reached the ACF Guns limit!" )
|
||||
language.Add( "SBoxLimit_acf_rack", "You've reached the ACF Launchers limit!" )
|
||||
language.Add( "SBoxLimit_acf_ammo", "You've reached the ACF Explosives limit!" )
|
||||
|
@ -41,7 +50,7 @@ if CLIENT then
|
|||
------------------------------------*/
|
||||
function TOOL.BuildCPanel( CPanel )
|
||||
|
||||
local pnldef_ACFmenu = vgui.RegisterFile( "ACF/Client/cl_ACFMenu_gui.lua" )
|
||||
local pnldef_ACFmenu = vgui.RegisterFile( "acf/client/cl_acfmenu_gui.lua" )
|
||||
|
||||
// create
|
||||
local DPanel = vgui.CreateFromTable( pnldef_ACFmenu )
|
||||
|
@ -82,7 +91,12 @@ function TOOL:LeftClick( trace )
|
|||
else
|
||||
local Ent = DupeClass.Func(ply, unpack(ArgTable)) --Using the Duplicator entity register to find the right factory function
|
||||
Ent:Activate()
|
||||
Ent:GetPhysicsObject():Wake()
|
||||
Ent:GetPhysicsObject():Wake()
|
||||
|
||||
undo.Create( ACF.Weapons[Type][Id]["ent"] )
|
||||
undo.AddEntity( Ent )
|
||||
undo.SetPlayer( ply )
|
||||
undo.Finish()
|
||||
end
|
||||
|
||||
if Feedback != nil then
|
||||
|
|
Loading…
Reference in New Issue