I've been unable to find out how to create a brush entity that is visible/not treated as a trigger.
I am currently trying to create a lua version of func_door_rotating, as i cannot really manipulate it in the ways i want.
I also have this issue with the origin datatype crashing the game when the map is loading, not sure how to stop that also.
[FGD]
[code]
@SolidClass base(Origin) = pks_door :
"its a door"
[
angle(string) : "Angle" : "0 0 0" : "Angle to rotate the door to when opened."
]
[/code]
[init.lua]
[code]
ENT.Type = "brush"
ENT.Base = "base_brush"
function ENT:KeyValue(key, value)
if key == "angle" then
self.RotateAngle = Angle(unpack(value:Explode(" ")))
elseif key == "origin" then
self.Origin = Vector(unpack(value:Explode(" ")))
end
end
function ENT:Initialize()
--self:SetSolid(SOLID_NONE)
end
function ENT:StartTouch(ply)
if type(ply) ~= "Player" then return end
self:SetAngles(self.RotateAngle)
end
[/code]
Am i blindly missing something here?
EDIT: Fixed the crashing, apparently the game doesn't like it when you make your own keyvalues named after certain things? Changing the keyvalue names for both the origin and the angle fixed the crashing, however I still don't know how to make the entity visible.
Have you tried using this? [url]http://wiki.garrysmod.com/page/Entity/SetTrigger[/url]
Doesn't do shit for me, maybe i can try use a func_brush as the base entity, probably not though. Not all too familiar with entities.
Don't you need to draw it in the cl_init.lua? I'm not sure about brush entities, but in most cases you need to.
[QUOTE=thegrb93;47465176]Don't you need to draw it in the cl_init.lua? I'm not sure about brush entities, but in most cases you need to.[/QUOTE]
From what i can tell, no clientside hooks are called for brush entities. Kinda stupid
Idk, I've never tried to make custom brush entities visible. Maybe the game devs haven't implemented it. I don't have time to test it though sorry. I'm busy trying to fix pac.
All good, if i cant find a solution then ill probably just have to make models out of my brush doors and make them point entities instead, but i'd rather avoid it.
Brush entities are purely server side. All you can do is add some implementation to render things client side, such as using meshes. If you're trying to make custom doors then you really are better off using other solutions.
I guess ill just resort to using propper then, cheers
Sorry, you need to Log In to post a reply to this thread.