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 »
Running out of Ops when simply setting a holograms material
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Running out of Ops when simply setting a holograms material
02-10-2015, 10:10 PM,
#1
Destiny's Player Offline
A passing by member
***
Posts: 237
Threads: 35
Joined: Dec 2013
Running out of Ops when simply setting a holograms material
Basically that. What in the world?
Spoiler Expand

--@name Power Turbine
--@author The Next Decade
--@model models/hunter/blocks/cube025x025x025.mdl

Self = ents.self()
Owner = ents.owner()

SpawnFinished = 0

SelfPos = Self:pos()
SelfAng = Self:ang()
SelfCon = Self:getConstraints()

Spin1C = 0
Spin2C = 0
Spin3C = 0

Node = nil
WireNode = nil

Start = 0

function starting()
Turbine = holograms.create(SelfPos,SelfAng,"models/Mechanics/gears2/gear_12t3.mdl",Vector(1.3,1.3,2))
TurbineConfusedetMaterial("sprops/textures/sprops_chrome")

TurbinePower = holograms.create(SelfPos,SelfAng,"models/Mechanics/gears2/gear_12t3.mdl",Vector(1.5,1.5,2))
TurbinePowerConfusedetMaterial("models/alyx/emptool_glow")
TurbinePowerConfusedetColor(255,200,100)
TurbinePowerConfusedetAlpha(0)

BallPower = holograms.create(SelfPos,SelfAng,"models/sprops/geometry/sphere_84.mdl",0.9)
BallPowerConfusedetMaterial("models/alyx/emptool_glow")
BallPowerConfusedetColor(255,200,100)
BallPowerConfusedetAlpha(0)

BallFusion = holograms.create(SelfPos,SelfAng,"models/sprops/geometry/sphere_84.mdl",0.85)
BallFusionConfusedetMaterial("spacebuild/Fusion")
BallFusionConfusedetAlpha(0)

Sound1 = sounds.create(Self,"ambient/wind/underground_wind_lp_01.wav")
Sound2 = sounds.create(Self,"br/ambience/gas_release_lp.wav")

Sound1:play()
Sound2:play()

print("Hologram set up finished")
SpawnFinished = 1
end

starting()

if SpawnFinished == 1 then
SelfCon = Self:getConstraints()
local i = 0
timer.create("NodeGet",0.1,#SelfCon,function()
i = i+1
printConsole(SelfCon[i]:class())
if SelfCon[i]:class() == "stargazer_node" then
Node = SelfCon[i]
WireNode = Node:getWirelink()
print("Node Found")
Start = 1
timer.remove("NodeGet")
return
end
error("No node found")
end)

if Start ~= 0 then
timer.create("refresh",0.1,0,function()
if Node ~= nil and WireNode["Max Energy"] ~= 0 then
Sound1ConfusedetVolume(1/WireNode["Max Energy"]*WireNode["Energy"])
Sound2ConfusedetVolume(0.6/WireNode["Max Energy"]*WireNode["Energy"])
Sound2ConfusedetPitch(10/WireNode["Max Energy"]*WireNode["Energy"]+math.random(1))
AlphaFusion = 150/WireNode["Max Energy"]*WireNode["Energy"]
AlphaPower = 255/WireNode["Max Energy"]*WireNode["Energy"]
BallSize = 0.9+(math.random()/20)

Spin1 = 10/WireNode["Max Energy"]*WireNode["Energy"]
Spin1C = Spin1C + Spin1
Spin2 = 15/WireNode["Max Energy"]*WireNode["Energy"]
Spin2C = Spin2C + Spin2
Spin3 = 20/WireNode["Max Energy"]*WireNode["Energy"]
Spin3C = Spin3C + Spin3

if Spin1C > 360 then
Spin1C = 0
end
if Spin2C > 360 then
Spin2C = 0
end
if Spin3C > 360 then
Spin3C = 0
end

TurbineConfusedetAng(Angle(0,Spin3C,0))
TurbinePowerConfusedetAng(Angle(0,Spin3C,0))
TurbinePowerConfusedetAlpha(AlphaPower)

BallPowerConfusedetAng(Angle(Spin3C,Spin1C,Spin2C))
BallPowerConfusedetAlpha(AlphaPower)
BallPowerConfusedetScale(BallSize)
BallFusionConfusedetAng(Angle(Spin3C,Spin1C,Spin2C))
BallFusionConfusedetAlpha(AlphaFusion)
BallFusionConfusedetScale(BallSize-0.05)
end
end)
end
end
Find
Reply
03-10-2015, 10:52 AM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Running out of Ops when simply setting a holograms material
Creating entities (i.e. creating the holograms) is massively costly since a GMod update from last year. You're hitting it in setMaterial purely by co-incidence, it's the creation that's eating the quota.
Find
Reply
03-10-2015, 11:26 AM,
#3
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: Running out of Ops when simply setting a holograms material
Worked fine when i spawned it though

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
03-10-2015, 03:35 PM,
#4
Red The Blue Color Offline
TSCM Super Donating Member
****
Posts: 422
Threads: 34
Joined: Feb 2015
RE: Running out of Ops when simply setting a holograms material
(03-10-2015, 11:26 AM)T-17 Wrote: Worked fine when i spawned it though

I say moderator cheatz lol

"with it's superior software, i have no doubt it will succeed in finding fuck all" - T-17, 2016

[Super Member] [ENCOM] т-ѕсм.Red The Blue Color™: server do you support Hitler?
[Server] srcds_linux: The probabilty is about 99.99%, so interpret that how you want to.
Find
Reply
03-10-2015, 04:21 PM,
#5
Destiny's Player Offline
A passing by member
***
Posts: 237
Threads: 35
Joined: Dec 2013
RE: Running out of Ops when simply setting a holograms material
Okay, it seems that ALL of my screens that use auto-wirelink crash out of Ops shortage when I try to connect them to my 1041 entity ship.
Find
Reply
03-10-2015, 05:03 PM,
#6
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Running out of Ops when simply setting a holograms material
(03-10-2015, 04:21 PM)Destinys Player Wrote: my 1041 entity ship.
There's your problem. That's a lot of entities (what even needs that many?) and so you're not going to be able to go through the constraints with the standard getConstraints() method without hitting the quota.

Look into getSingleConstrainedEnts(), and avoiding trying to find all constraints all at once.
Find
Reply
03-10-2015, 05:30 PM,
#7
Destiny's Player Offline
A passing by member
***
Posts: 237
Threads: 35
Joined: Dec 2013
RE: Running out of Ops when simply setting a holograms material
Person8880 Wrote:That's a lot of entities (what even needs that many?)

A big ship with a highly detailed interior.

Thanks a lot, though, I'll look into this function.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


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

Powered By MyBB, © 2002-2026 MyBB Group.