It works with the font string as 'BebasNeue' if I manually install the font, gonna try the dev branch now.
EDIT: So after 6 hours of trying to figure it out, turns out a restart of my PC fixed the issue, turns out I'd apparently got a half-installed corrupted font. I think I need to sleep now.
EDIT2: Yeah looks like a bunch of users had the corrupt version, so I guess i'm just going to have to rename it bebasneue_adzter.ttf and hopefully that'll get around it.
Whats the best way to deal with having players of opposite teams no collide?
[QUOTE=wranders;46980642]Is there a way to check if a workshop addon is mounted by workshopID?
I want to avoid 'file.Exists()' because i want it to work regardless if it's renamed or not.[/QUOTE]
engine.GetAddons( ) is supposed to list all addons mounted... It doesn't work on the server any longer but it works on the client.
The closest thing I found: [url]http://wiki.garrysmod.com/page/steamworks/ShouldMountAddon[/url] but it is also clientside. A lot of useful functions have been removed from being able to be used and placed in the menu realm which is terrible.
[editline]22nd January 2015[/editline]
[QUOTE=stupid-;46983787]Whats the best way to deal with having players of opposite teams no collide?[/QUOTE]
Are you asking how to set up no collide or ??
Take a look at the ShouldCollide hook, and enable custom collisions on the players on spawn. Also, set up ShouldCollide and don't create a system where the collision is toggle-able because it can break physics and cause vehicles to fall through the world.
Well, by default it seems that teammates don't collide with each other. But you can run through people on the opposing team and was just wondering what would be the best way to set up no collide so you can't run through players on the opposite team.
[QUOTE=stupid-;46984052]Well, by default it seems that teammates don't collide with each other. But you can run through people on the opposing team and was just wondering what would be the best way to set up no collide so you can't run through players on the opposite team.[/QUOTE]
Likely someone set up ShouldCollide with code similar to the following:
[code]hook.Add( "ShouldCollide", "NoCollideWithNonTeamPlayers", function( _ent1, _ent2 )
if ( IsValid( _ent1 ) && IsValid( _ent2 ) && _ent1:IsPlayer( ) && _ent2:IsPlayer( ) && _ent1:Team( ) != _ent2:Team( ) ) then
return true;
end
end );[/code]
Change the != to == to disable opposite team ghosting and enable ghosting through players of same team.
If you want to remove that all together you could use PrintTable( hook.GetTable( )[ "ShouldCollide" ] ); to see which hooks are set up in ShouldCollide, then use hook.Remove( "ShouldCollide", "X" ); where X is the infringing hooks name.
Well it's for my own gamemode, but I haven't touched ShouldCollide at all. I'm using base, so whatever is set in the base gamemode. I'll try this out though, thanks!
how can i keep an addon from loading depending on the gamemode?
Sticking
if (engine.ActiveGamemode() ~= "Trouble in Terrorist Town") then MsgN("Skipped Loading Addon: TTT Damagelog") return end
at the top does nothing as engine.ActiveGamemode() returns base at the time; GAMEMODE_NAME is nil at the time; and GAMEMODE (for GAMEMODE.Name) is nil at the time.
sticking the whole loader file in an initialize hook for that would also mess up other files that use the initialize hook right
[QUOTE=Acecool;46984189]Likely someone set up ShouldCollide with code similar to the following:
[code]hook.Add( "ShouldCollide", "NoCollideWithNonTeamPlayers", function( _ent1, _ent2 )
if ( IsValid( _ent1 ) && IsValid( _ent2 ) && _ent1:IsPlayer( ) && _ent2:IsPlayer( ) && _ent1:Team( ) != _ent2:Team( ) ) then
return true;
end
end );[/code]
Change the != to == to disable opposite team ghosting and enable ghosting through players of same team.
If you want to remove that all together you could use PrintTable( hook.GetTable( )[ "ShouldCollide" ] ); to see which hooks are set up in ShouldCollide, then use hook.Remove( "ShouldCollide", "X" ); where X is the infringing hooks name.[/QUOTE]
Hmm, is there a bug with the player_class system?
There are currently no hooks using ShouldCollide, and here's what happens.
Red team members can't collide with red team members.
Red team can run through members of the blue team.
Blue team can run through other members of blue team, but can't run through red team.
Both teams use the same player classes, and have
[CODE]PLAYER.TeammateNoCollide = true -- Do we collide with teammates or run straight through them[/CODE]
Set.
I'm having trouble optimizing client performance with high amounts of NextBots on large open maps (think flatgrass).
SetNoDraw does get them to not draw (confirmed with mat_wireframe) but clients will still lag when looking at large numbers of them. I've also tried to use SetPreventTransmit but this does not seem to work with NextBots.
See bug report here: [url]https://github.com/Facepunch/garrysmod-issues/issues/1736[/url]
Why is it still lagging despite them not being drawn and what can I do to improve performance?
[QUOTE=stupid-;46984459]Hmm, is there a bug with the player_class system?
There are currently no hooks using ShouldCollide, and here's what happens.
Red team members can't collide with red team members.
Red team can run through members of the blue team.
Blue team can run through other members of blue team, but can't run through red team.
Both teams use the same player classes, and have
[CODE]PLAYER.TeammateNoCollide = true -- Do we collide with teammates or run straight through them[/CODE]
Set.[/QUOTE]
Fretta used to have this as a feature. Look at how it did it back in GMod 10.
Is there anyway to trace through prop_static fences?
Make a function tcheck if ent is prop_static and if its mode a fence and pass it as a filter?
[QUOTE=zerf;46984332]how can i keep an addon from loading depending on the gamemode?
Sticking
if (engine.ActiveGamemode() ~= "Trouble in Terrorist Town") then MsgN("Skipped Loading Addon: TTT Damagelog") return end
at the top does nothing as engine.ActiveGamemode() returns base at the time; GAMEMODE_NAME is nil at the time; and GAMEMODE (for GAMEMODE.Name) is nil at the time.
sticking the whole loader file in an initialize hook for that would also mess up other files that use the initialize hook right[/QUOTE]
can you try
[LUA]GetConVar("gamemode"):GetString()[/LUA]
?
I have no access to gmod right now so it'd be useful to see if that works for an addon I'm writing
edit a few days later: this method works :)
[QUOTE=rejax;46986586]can you try
[LUA]GetConVar("gamemode"):GetString()[/LUA]
?
I have no access to gmod right now so it'd be useful to see if that works for an addon I'm writing[/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/engine/ActiveGamemode]engine.ActiveGamemode[/url]
That will return the shortname, so SandBox will be sandbox and Trouble in Terrorist Town will be terrortown.
[QUOTE=bobbleheadbob;46986926][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/engine/ActiveGamemode]engine.ActiveGamemode[/url]
That will return the shortname, so SandBox will be sandbox and Trouble in Terrorist Town will be terrortown.[/QUOTE]
I am aware of engine.ActiveGamemode, but
[QUOTE=zerf;46984332]...does nothing as engine.ActiveGamemode() returns base at the time;[/QUOTE]
I am wondering if retrieving the convar string is a possible solution to getting the current gamemode before it has loaded.
Does anybody have any idea how to compensate or have a fix for this? Basically I'm doing the ToolTracer effect from the muzzle to a trace point, however the attachment on the Muzzle doesn't seem to stick? If I shoot then move, there's a slight delay/lag and it trails behind.
Any help is appreciated! :)
[CODE]
local tr = {}
tr.start = self.Owner:GetShootPos()
tr.endpos = self.Owner:GetShootPos() + 600 * self.Owner:GetAimVector()
local trace = util.TraceLine(tr)
if trace.HitWorld then
local effectdata = EffectData( );
effectdata:SetAttachment( 1 );
effectdata:SetOrigin( trace.HitPos );
effectdata:SetEntity( self.Weapon );
effectdata:SetStart( self.Owner:GetShootPos( ) );
effectdata:SetNormal( trace.HitNormal );
util.Effect( "ToolTracer", effectdata );
end
[/CODE]
This is inside my SWEP's PrimaryAttack.
Is there a way I can insert a new table with multiple keys I.E
[code]
Officials = {
{ Key = "Official", AName = "Something Here", Other = "And Here" },
{ Key = "Official", AName = "Stuff", Other = "More stuff" }
// I want to insert a new table here through a button?
}
[/code]
Had no luck with table.Insert so far?
[QUOTE=arcaneex;46986048]Make a function tcheck if ent is prop_static and if its mode a fence and pass it as a filter?[/QUOTE]
Nope. It won't even recognize the entity as anything more than just the world. Trying to capture the texture results in **STUDIO**.
[QUOTE=wauterboi;46986023]Is there anyway to trace through prop_static fences?[/QUOTE]
Mess around with trace masks.
Need help with my SENT I'm scripting.
I want it so whenever its pressed E on (used), it'll do some stuff, freeze and emit a DynamicLight, which will be deleted upon removal.
Unfortunately as of now the light is the only thing that doesnt work. It simple doesn't show up. [B]However copying this exact dlight code into a ENT:Think function works perfectly...[/B] If anyone could take a look at my code and tell me how I can approach this better:
Relevant code:
[CODE]function ENT:Use()
Phyself:EnableMotion(false)
self.BaseClass.Think(self)
if ( CLIENT ) then
local dlight = DynamicLight( self:EntIndex() )
if ( dlight ) then
dlight.Pos = self:GetPos()
dlight.r = 255
dlight.g = 2
dlight.b = 0
dlight.Brightness = 1
dlight.Decay = 10
dlight.Size = 200
dlight.DieTime = CurTime() + 1
end
end
end
[/CODE]
Logical conclusion from what you said is that the code is never ran clientside.
[editline]22nd January 2015[/editline]
As shown on this page: [url]http://wiki.garrysmod.com/page/ENTITY/Use[/url]
The hook is serverside only.
Is there a module that allows me to save lua generated material in somewhere in the filesystem?
I want to render an icon with rendertarget and save it into the data folder for cache purpose.
[QUOTE=rebel1324;46989825]Is there a module that allows me to save lua generated material in somewhere in the filesystem?
I want to render an icon with rendertarget and save it into the data folder for cache purpose.[/QUOTE]
You can save it into the data folder with file.Write and read it with Material() as far as I know.
[QUOTE=Robotboy655;46989795]Logical conclusion from what you said is that the code is never ran clientside.
[editline]22nd January 2015[/editline]
As shown on this page: [URL]http://wiki.garrysmod.com/page/ENTITY/Use[/URL]
The hook is serverside only.[/QUOTE]
Thanks. Silly me.
E: Then how should this be done? :P Right now I have:
[CODE]
function ENT:Use()
self:SetVar("active", 1)
end
function ENT:Think()
if ( CLIENT ) then
if (self:GetVar("active", 0) != 1) then return end
local dlight = DynamicLight( self:EntIndex() )
if ( dlight ) then
dlight.Pos = self:GetPos()
dlight.r = 255
dlight.g = 2
dlight.b = 0
dlight.Brightness = 1
dlight.Decay = 10
dlight.Size = 200
dlight.DieTime = CurTime() + 1
end
end
end
[/CODE]
Still not working :S
You do realize Set/GetVar is not networked to client right? LOOK UP THE FUNCTIONS YOU USE ON THE WIKI BEFORE ASKING QUESTIONS.
[QUOTE=rejax;46986586]can you try
[LUA]GetConVar("gamemode"):GetString()[/LUA]
?
I have no access to gmod right now so it'd be useful to see if that works for an addon I'm writing[/QUOTE]
tested:
it does the same as engine.GetActiveGamemode() (prints whatever the gamemode's base is) :S
I guess what I'll do is write the next gamemode to some nextgamemode.txt file in my gamemode changing code
[QUOTE=zerf;46990687]tested:
it does the same as engine.GetActiveGamemode() (prints whatever the gamemode's base is) :S
I guess what I'll do is write the next gamemode to some nextgamemode.txt file in my gamemode changing code[/QUOTE]
Can't you just use GM.Name?
Try GAMEMODE_NAME
[QUOTE=Robotboy655;46989847]You can save it into the data folder with file.Write and read it with Material() as far as I know.[/QUOTE]
Really? It can save Image file?
[editline]23rd January 2015[/editline]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/file/Write]file.Write[/url]
It only saves string.
Sorry, you need to Log In to post a reply to this thread.