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 … 13 14 15 16 17 18 Next »
Starfall Help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pages (5): « Previous 1 2 3 4 5 Next »
Threaded Mode
Starfall Help
24-05-2015, 08:34 PM, (This post was last modified: 24-05-2015, 08:39 PM by Alanzote.)
#11
Alanzote Offline
TSCM Member
***
Posts: 123
Threads: 40
Joined: Oct 2013
RE: Starfall Help
(24-05-2015, 08:33 PM)Person8880 Wrote: Read my last sentence again.

You have:
for I = 0, #Corridors do
you should have:
for I = 1, #Corridors do
I read, that's why I deleted the post. :/

EDIT: IT WORKED! THX PERSON!

[Image: stargate_kawoosh_animation_HD_by_SergeyDruid.gif] [Image: kecepatan-cahaya-light-speed-warp-drive2....gif?w=640]
Find
Reply
24-05-2015, 08:36 PM,
#12
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Starfall Help
(24-05-2015, 08:34 PM)Alanzote Wrote: I read, that's why I deleted the post. :/
I replied before you deleted it.

Is it resolved now?
Find
Reply
24-05-2015, 08:39 PM, (This post was last modified: 24-05-2015, 09:07 PM by Alanzote.)
#13
Alanzote Offline
TSCM Member
***
Posts: 123
Threads: 40
Joined: Oct 2013
RE: Starfall Help
(24-05-2015, 08:36 PM)Person8880 Wrote:
(24-05-2015, 08:34 PM)Alanzote Wrote: I read, that's why I deleted the post. :/
I replied before you deleted it.

Is it resolved now?
YEP! Thx!

Another Thing, in E2 you could use the '*' to define all the models from that section, in Starfall how do I do that?
EDIT: I mean that I want to have all the corridors entitys in 1 array"

This is for Starfall optimization, because a lot of 'for' is really bad.

[Image: stargate_kawoosh_animation_HD_by_SergeyDruid.gif] [Image: kecepatan-cahaya-light-speed-warp-drive2....gif?w=640]
Find
Reply
24-05-2015, 09:34 PM,
#14
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Starfall Help
You can't use wildcards in find.byModel, but you can just use:
find.byClass( "prop_physics", function( Ent )
--The path should be everything up to the point you would have added * in E2
if Ent:model():find( "models/whatever/path/you/want" ) then
return Ent:owner() == Owner
end
end )
Find
Reply
24-05-2015, 09:48 PM,
#15
Alanzote Offline
TSCM Member
***
Posts: 123
Threads: 40
Joined: Oct 2013
RE: Starfall Help
(24-05-2015, 09:34 PM)Person8880 Wrote: You can't use wildcards in find.byModel, but you can just use:
find.byClass( "prop_physics", function( Ent )
--The path should be everything up to the point you would have added * in E2
if Ent:model():find( "models/whatever/path/you/want" ) then
return Ent:owner() == Owner
end
end )
"Operations Quota Exeeced"

[Image: stargate_kawoosh_animation_HD_by_SergeyDruid.gif] [Image: kecepatan-cahaya-light-speed-warp-drive2....gif?w=640]
Find
Reply
24-05-2015, 09:51 PM,
#16
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Starfall Help
Probably because people have spawned tonnes of props. Might be better to get your constrained entities instead then.

local Constrained = ents.self():getConstraints()
local Corridors = {}
for i = 1, #Constrained do
local Ent = Constrained[ i ]
if Ent:class() == "prop_physics" and Ent:model():find( "models/whatever/path/you/want" ) then
Corridors[ #Corridors + 1 ] = Ent
end
end
Though that might also hit the ops quota if your ship has a lot of parts. Try it and see.
Find
Reply
25-05-2015, 10:07 PM, (This post was last modified: 25-05-2015, 10:08 PM by Alanzote.)
#17
Alanzote Offline
TSCM Member
***
Posts: 123
Threads: 40
Joined: Oct 2013
RE: Starfall Help
(24-05-2015, 09:51 PM)Person8880 Wrote: Probably because people have spawned tonnes of props. Might be better to get your constrained entities instead then.

local Constrained = ents.self():getConstraints()
local Corridors = {}
for i = 1, #Constrained do
local Ent = Constrained[ i ]
if Ent:class() == "prop_physics" and Ent:model():find( "models/whatever/path/you/want" ) then
Corridors[ #Corridors + 1 ] = Ent
end
end
Though that might also hit the ops quota if your ship has a lot of parts. Try it and see.
Is there a way to slow it down? Still getting ops quota!

[Image: stargate_kawoosh_animation_HD_by_SergeyDruid.gif] [Image: kecepatan-cahaya-light-speed-warp-drive2....gif?w=640]
Find
Reply
25-05-2015, 10:39 PM,
#18
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
RE: Starfall Help
Well i can try to help. My ship has about 450 props and this just works fine. I am using the subMaterial lib from Rouing.

--@name Set Sub Material B
--@author Rouing

-- Function is designed to take material 1 and set it to material 2 instead of using an index

function setSubMaterialB(ent, mat1, mat2)
local mats = ent:getMaterials()
for i = 1, #mats do
if mats[i] == mat1 then
entConfusedetSubMaterial(i-1,mat2)
end
end
end
To go into red allert I am using this

function redAllert()
for I = 1,#Props do
setSubMaterialB(Props[I], "cmats/base_metal_light", "cmats/flash_red")
end

end

And to go back into green allert i use

function greenStatus()
for I = 1,#Props do
setSubMaterialB(Props[I], "cmats/base_metal_light", "cmats/base_metal_light")
end
end

I am getting all the props at the beginning with. I am getting this just ones so it saves ops.

Props = ents.self():getConstrained()

Maybe this helps you.Big Grin

SuperPlayer
Find
Reply
25-05-2015, 10:59 PM, (This post was last modified: 25-05-2015, 11:27 PM by Alanzote.)
#19
Alanzote Offline
TSCM Member
***
Posts: 123
Threads: 40
Joined: Oct 2013
RE: Starfall Help
(25-05-2015, 10:39 PM)SuperPlayer Wrote: Well i can try to help. My ship has about 450 props and this just works fine. I am using the subMaterial lib from Rouing.

--@name Set Sub Material B
--@author Rouing

-- Function is designed to take material 1 and set it to material 2 instead of using an index

function setSubMaterialB(ent, mat1, mat2)
local mats = ent:getMaterials()
for i = 1, #mats do
if mats[i] == mat1 then
entConfusedetSubMaterial(i-1,mat2)
end
end
end
To go into red allert I am using this

function redAllert()
for I = 1,#Props do
setSubMaterialB(Props[I], "cmats/base_metal_light", "cmats/flash_red")
end

end

And to go back into green allert i use

function greenStatus()
for I = 1,#Props do
setSubMaterialB(Props[I], "cmats/base_metal_light", "cmats/base_metal_light")
end
end

I am getting all the props at the beginning with. I am getting this just ones so it saves ops.

Props = ents.self():getConstrained()

Maybe this helps you.Big Grin

SuperPlayer
Helped! But Quota execeeded! Just 2 more to go! How sad! =(
I have 407 props
THE MAX: 185

[Image: stargate_kawoosh_animation_HD_by_SergeyDruid.gif] [Image: kecepatan-cahaya-light-speed-warp-drive2....gif?w=640]
Find
Reply
25-05-2015, 11:13 PM,
#20
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
RE: Starfall Help
Well this what i am showing you now i have never tested so i dont know if it works


function redAllert()
for I = 1,#Props/2 do
setSubMaterialB(Props[I], "cmats/base_metal_light", "cmats/flash_red")
end
timer.simple(1,function()
for I = #Props/2 ,#Props do
setSubMaterialB(Props[I], "cmats/base_metal_light", "cmats/flash_red")
end
end)
end

Maybe it works. I dont know. But when i am in game again i will try to find a solution for you.

SuperPlayer
Find
Reply
« Next Oldest | Next Newest »
Pages (5): « Previous 1 2 3 4 5 Next »


  • 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.