Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 11 12 13 14 15 … 18 Next »
:vel() weirdness
Thread Closed 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
:vel() weirdness
26-08-2015, 06:30 PM,
#1
Destiny's Player Offline
A passing by member
***
Posts: 237
Threads: 35
Joined: Dec 2013
:vel() weirdness
Basically - when you parent the ship and move it even a single inch, :vel()'s Z starts rapidly decreasing until it hits -805.138184, after which it gets stuck, while all the other values stay at 0.
And THEN, when you UNPARENT it, Z goes to -0.

Here's the code where I noticed that.

--@name SubMat Light Effects
--@author The Next Decade
--@model models/slyfo_2/holo_blockblock1.mdl

if SERVER then
Self = ents.self()
MainEngine = {}
SideEngine = {}
SideEngineCap = {}
HoverEngine = {}
Slipstream = {}

function getProps()
local Consts = Self:getConstraints()
m = 0
s = 0
c = 0
h = 0
for i=1, #Consts do
local Cur = Consts[i]
CurMdl = Cur:model()
--printConsole(CurMdlConfusedub(-11))
if CurMdlConfusedub(-13) == "eng_sq11b.mdl" then
m = m+1
MainEngine[m] = Cur
end
if CurMdlConfusedub(-8) == "wd11.mdl" then
s = s+1
SideEngine[s] = Cur
end
if CurMdlConfusedub(-9) == "wdc11.mdl" then
c = c+1
SideEngineCap[c] = Cur
end
if CurMdlConfusedub(-11) == "eng_p31.mdl" then
h = h+1
HoverEngine[h] = Cur
end
if Cur:class() == "quantum_slipstream_drive" then
Slipstream = Cur
end
end
end

function tablesInfo()
if MainEngine ~= nil then
for i=1,#MainEngine do
printConsole("Num - "..i.." "..MainEngine[i]:model())
end
end
if SideEngine ~= nil then
for i=1,#SideEngine do
printConsole("Num - "..i.." "..SideEngine[i]:model())
end
end
if SideEngineCap ~= nil then
for i=1,#SideEngineCap do
printConsole("Num - "..i.." "..SideEngineCap[i]:model())
end
end
if HoverEngine ~= nil then
for i=1,#HoverEngine do
printConsole("Num - "..i.." "..HoverEngine[i]:model())
end
end
end

function propMaterials()
if MainEngine ~= nil then
MainMts = MainEngine[1]:getMaterials()
SideMts = SideEngine[1]:getMaterials()
CapsMts = SideEngineCap[1]:getMaterials()
HovrMts = HoverEngine[1]:getMaterials()
for i=1, #MainMts do
printConsole(MainMts[i])
end
printConsole("---")
for i=1, #SideMts do
printConsole(SideMts[i])
end
printConsole("---")
for i=1, #CapsMts do
printConsole(CapsMts[i])
end
printConsole("---")
for i=1, #HovrMts do
printConsole(HovrMts[i])
end
printConsole("---_____---")
printConsole(SideEngine[1]:getSubMaterial(2))
printConsole(SideEngine[1]:getSubMaterial(1))
printConsole(SideEngine[1]:getSubMaterial(1))
printConsole(SideEngine[1]:getSubMaterial(1))
end
end

function enginesActive()
local SVel = Self:vel()
--printConsole(SVel)
local SVelAdd = math.floor(SVel[1]+SVel[2]+SVel[3])
--printConsole(SVelAdd)
if SVelAdd ~= 0 then
for i=1,#MainEngine do
MainEngine[i]ConfusedetSubMaterial(2,"cmats/light")
end
for i=1,#SideEngine do
SideEngine[i]ConfusedetSubMaterial(2,"cmats/light")
end
for i=1,#HoverEngine do
HoverEngine[i]ConfusedetSubMaterial(2,"cmats/light")
end
else
for i=1,#MainEngine do
MainEngine[i]ConfusedetSubMaterial(2,"pyro_overloader/diffuse")
end
for i=1,#SideEngine do
SideEngine[i]ConfusedetSubMaterial(2,"pyro_overloader/diffuse")
end
for i=1,#HoverEngine do
HoverEngine[i]ConfusedetSubMaterial(2,"pyro_overloader/diffuse")
end
end

end

getProps()
--tablesInfo()
propMaterials()
timer.create("Check",1,0,function()
enginesActive()
end)


end
Find
« Next Oldest | Next Newest »
Thread Closed 


Messages In This Thread
:vel() weirdness - by Destiny's Player - 26-08-2015, 06:30 PM
RE: :vel() weirdness - by Person8880 - 26-08-2015, 06:35 PM
RE: :vel() weirdness - by Destiny's Player - 26-08-2015, 06:46 PM
RE: :vel() weirdness - by Person8880 - 26-08-2015, 06:53 PM
RE: :vel() weirdness - by Destiny's Player - 26-08-2015, 06:55 PM

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.