[QUOTE=Gamz365;48101557]Why do my dmodelpanels look like this after the recent gmod update? They used to show the model, but after the update they are like this. No code has changed.
[T]http://i.gyazo.com/19aabaa5925d9f8f4063aac280c98565.png[/T][/QUOTE]
Update your pointshop.
[B]Fixed[/B]
Anyone know how I would set the font of the text on a DButton? I know of [url=http://wiki.garrysmod.com/page/DLabel/SetFont]DLabel:SetFont()[/url], but it supposedly only works on DLabels. Would I use DButton:GetText():SetFont()?
[QUOTE=Robotboy655;48104264]Update your pointshop.[/QUOTE]
It's not pointshop, it's custom
Hi, my server has been running into problems by hitting the entity limit. After checking report_entities a few times, we are up to 2000 entities at around 3 hours up time with 38 - 42 players. Everything looks fine except for Class: info_target which just keeps going up and up and will not stop. How can I solve this? As of right now its at Class: info_target (680)
[IMG]http://speedcap.net/sharing/files/9b/0c/9b0c7970d74301f890f3512975974c3a.png[/IMG]
Must be one of your addons that create it and does not remove it.
[QUOTE=Robotboy655;48106749]Must be one of your addons that create it and does not remove it.[/QUOTE]
Thanks, I will definitely look around and see what I can find. Have a good one!
Because people will probably not stumble across the last page, I'm going to bump this:
[quote=MegaTronJohn;46878235]Anyone know how I would set the font of the text on a DButton? I know of [url=http://wiki.garrysmod.com/page/DLabel/SetFont]DLabel:SetFont()[/url], but it supposedly only works on DLabels. Would I use DButton:GetText():SetFont()?[/quote]
[QUOTE=MegaTronJohn;48106815]Because people will probably not stumble across the last page, I'm going to bump this:[/QUOTE]
DButton derives from DLabel so you'd just do DButton:SetFont()
I have a question regarding the Pointshop.
I would like to change the Data Provider of the Pointshop from 'pdata' to 'data'. Is there any way I can convert it without any extra software? (I don't have anything MySQL-related.)
Or does just changing it automatically transfer all the data?
PData is a meta function and saves to sv.db. You would have to change the loading and saving to use the file library instead.
[del]Wait we didn't get a new thread for July?[/del]
Question: Thanks to ViewModelFOV + FOV, anything drawn in world coordinates, or local to player coordinates, based on the supposed ViewModel position, will not line up properly with the actual ViewModel. Is there a solution to this? If I get the muzzle, and create a sprite, is there a way to guarantee it will draw on the muzzle at any FOV / ViewModelFOV?
[editline]3rd July 2015[/editline]
(or any other attachment)
(or even just the model pos alone)
[QUOTE=WalkingZombie;48116321][del]Wait we didn't get a new thread for July?[/del]
Question: Thanks to ViewModelFOV + FOV, anything drawn in world coordinates, or local to player coordinates, based on the supposed ViewModel position, will not line up properly with the actual ViewModel. Is there a solution to this? If I get the muzzle, and create a sprite, is there a way to guarantee it will draw on the muzzle at any FOV / ViewModelFOV?
[editline]3rd July 2015[/editline]
(or any other attachment)
(or even just the model pos alone)[/QUOTE]
having this issue with drawing halos on viewmodels as well. the only way you can fix it is by setting the viewmodel fov to the player fov, or by doing some hacky cam.Start3D() shit and rendering it in that instance with the viewmodel fov as the camera fov
[QUOTE=AJ10017;48118270]having this issue with drawing halos on viewmodels as well. the only way you can fix it is by setting the viewmodel fov to the player fov, or by doing some hacky cam.Start3D() shit and rendering it in that instance with the viewmodel fov as the camera fov[/QUOTE]
Rendering in a 3D Camera space actually makes a lot of sense though. I think I'm gonna toss a try at that. I have very...devious plans for this. Maybe.
Im using a for loop to get all the model string paths for the darkrp RPExtraTeams table but I have a problem with all of the outputs. When I print all the models I get this
[code]
table: 0x2a1936c0
table: 0x43e70850
table: 0x33ee0b78
models/player/gman_high.mdl
models/player/monk.mdl
models/player/kleiner.mdl
models/player/combine_soldier_prisonguard.mdl
models/player/breen.mdl
models/player/corpse1.mdl
[/code]
and for some reason I dont know why its outputting table: 0x2a1936c0
table: 0x43e70850
table: 0x33ee0b78
How can I resolve this? Im using the table to create DModel panels so of course its going to error because it's not returning string model paths alone...
[QUOTE=_Entity;48119766]Im using a for loop to get all the model string paths for the darkrp RPExtraTeams table but I have a problem with all of the outputs. When I print all the models I get this
[code]
table: 0x2a1936c0
table: 0x43e70850
table: 0x33ee0b78
models/player/gman_high.mdl
models/player/monk.mdl
models/player/kleiner.mdl
models/player/combine_soldier_prisonguard.mdl
models/player/breen.mdl
models/player/corpse1.mdl
[/code]
and for some reason I dont know why its outputting table: 0x2a1936c0
table: 0x43e70850
table: 0x33ee0b78
How can I resolve this? Im using the table to create DModel panels so of course its going to error because it's not returning string model paths alone...[/QUOTE]
It means the member is a table. You can print it using PrintTable.
Trying to make a sound play only once when I hover over the DModelPanal(icon)
but for it to see it's being hovered I have a think hook. but now it just destroys my ears when I hover over it.
[CODE]
local function Think()
if icon:IsHovered() then
sound.Play( "garrysmod/content_downloaded.wav", Vector( 110, 110, 110 ), 75)
else
end
end
[/CODE]
[editline]4th July 2015[/editline]
[QUOTE=_Entity;48119766]Im using a for loop to get all the model string paths for the darkrp RPExtraTeams table but I have a problem with all of the outputs. When I print all the models I get this
[code]
table: 0x2a1936c0
table: 0x43e70850
table: 0x33ee0b78
models/player/gman_high.mdl
models/player/monk.mdl
models/player/kleiner.mdl
models/player/combine_soldier_prisonguard.mdl
models/player/breen.mdl
models/player/corpse1.mdl
[/code]
and for some reason I dont know why its outputting table: 0x2a1936c0
table: 0x43e70850
table: 0x33ee0b78
How can I resolve this? Im using the table to create DModel panels so of course its going to error because it's not returning string model paths alone...[/QUOTE]
Looks like the memory address for the items in the table, so like James said you can use PrintTable and it will print out the table contents instead.
[editline]4th July 2015[/editline]
[QUOTE=Ari_Draconia;48120346]Trying to make a sound play only once when I hover over the DModelPanal(icon)
but for it to see it's being hovered I have a think hook. but now it just destroys my ears when I hover over it.
[CODE]
local function Think()
if icon:IsHovered() then
sound.Play( "garrysmod/content_downloaded.wav", Vector( 110, 110, 110 ), 75)
else
end
end
[/CODE]
[editline]4th July 2015[/editline]
Looks like the memory address for the items in the table, so like James said you can use PrintTable and it will print out the table contents instead.[/QUOTE]
Fixed my problem using this.
[CODE]
icon.OnCursorEntered = function() sound.Play( "garrysmod/content_downloaded.wav", Vector( 110, 110, 110 ), 75) end
[/CODE]
[QUOTE=WalkingZombie;48116321][del]Wait we didn't get a new thread for July?[/del]
Question: Thanks to ViewModelFOV + FOV, anything drawn in world coordinates, or local to player coordinates, based on the supposed ViewModel position, will not line up properly with the actual ViewModel. Is there a solution to this? If I get the muzzle, and create a sprite, is there a way to guarantee it will draw on the muzzle at any FOV / ViewModelFOV?
[editline]3rd July 2015[/editline]
(or any other attachment)
(or even just the model pos alone)[/QUOTE]
Take a look at bone positions of the view model?
Does anyone know how I would modify my weapon's world model's position and angle? Since my weapon is just a crotch gun(it's ported from a game with different rigging for player models and stuff so it isn't meant for the default HL2 skeleton so it stays in the crotch), I want to bonemerge it to my player's right hand and set it's angles to my player's angles. How would I do this with WEAPON:DrawWorldModel?
[code]SWEP.Offset = {
Pos = {
Right = 0,
Forward = 0,
Up = 0,
},
Ang = {
Right = 0,
Forward = 0,
Up = 0,
},
}
function SWEP:DrawWorldModel( )
if not IsValid( self.Owner ) then
return self:DrawModel( )
end
local offset, hand
self.Hand2 = self.Hand2 or self.Owner:LookupAttachment( "anim_attachment_rh" )
hand = self.Owner:GetAttachment( self.Hand2 )
if not hand then
return
end
offset = hand.Ang:Right( ) * self.Offset.Pos.Right + hand.Ang:Forward( ) * self.Offset.Pos.Forward + hand.Ang:Up( ) * self.Offset.Pos.Up
hand.Ang:RotateAroundAxis( hand.Ang:Right( ), self.Offset.Ang.Right )
hand.Ang:RotateAroundAxis( hand.Ang:Forward( ), self.Offset.Ang.Forward )
hand.Ang:RotateAroundAxis( hand.Ang:Up( ), self.Offset.Ang.Up )
self:SetRenderOrigin( hand.Pos + offset )
self:SetRenderAngles( hand.Ang )
self:DrawModel( )
end[/code]
Adjust Pos and Ang as desired - figure out your angle first and then work on position.
[QUOTE=MegaTronJohn;48123976]Does anyone know how I would modify my weapon's world model's position and angle? Since my weapon is just a crotch gun(it's ported from a game with different rigging for player models and stuff so it isn't meant for the default HL2 skeleton so it stays in the crotch), I want to bonemerge it to my player's right hand and set it's angles to my player's angles. How would I do this with WEAPON:DrawWorldModel?[/QUOTE]
Yeah I am interested to know this also, I'll look into it. as for now I would recommend looking at the stuff in the [URL="http://steamcommunity.com/sharedfiles/filedetails/?id=153130501"]SWEP Construction Kit[/URL]. That is a steam guide explaining how to use it. hope that helps at all.
Does anyone know why team.GetColor() returns the yellow for all teams even though I've set it in the shared.lua?
I am calling team.GetColor() on the client but that shouldn't be a issue since I am calling this in the shared.lua.
This is how the CreateTeams function looks:
[lua]
function GM:CreateTeams()
TEAM_BLUE = 1
team.SetUp( TEAM_BLUE, "Blue Team", Color( 0, 0, 255, 255 ), true )
team.SetSpawnPoint( TEAM_BLUE, "ai_hint" )
end
[/lua]
Hello, I'm a lua newbie, and I have a problem with my swep.
I use a c shotgun model, and I want it to load shells 1 by 1, but it loads them all at 1 time, like a magazine. My code.
*REMOVED*
I'm just a newbie, please don't attack me, or tell me this is obvius.
edit: Using weapon_base
Hey I actually have a question as well that I've been working on with a few people(Acecool and another person on my friends list).
I wanted to created a function that searches through players and npcs, then selects one of them to be
set as a target for the searching player. I've got some code of something that works now but it doesnt
always work. Sometimes it'll select Worldspawn instead of an NPC or a player/bot.
[CODE]function FindTargetFunc()
local targets = ents.FindInCone( LocalPlayer():GetPos(), LocalPlayer():GetForward(), 650, 45 )
local me = LocalPlayer()
for i = 1, #targets do
if ( targets[i]:IsPlayer() ) then
me.SelectedTarget = targets[i/#targets+1];
print( me.SelectedTarget )
net.Start( "SendTargetEntity" )
net.WriteEntity( me.SelectedTarget )
net.SendToServer()
elseif ( targets[i]:IsNPC() ) then
me.SelectedTarget = targets[i/#targets+1];
print( me.SelectedTarget )
net.Start( "SendTargetEntity" )
net.WriteEntity( me.SelectedTarget )
net.SendToServer()
else
return false;
end
end
end[/CODE]
Acecool had told me that using ents.FindInCone was really expensive, and I tried using a util.TraceLine but that yielded no results.
One last thing I should mention, this is all clientside.
[QUOTE=Apple_Bloom;48126310]Hey I actually have a question as well that I've been working on with a few people(Acecool and another person on my friends list).
I wanted to created a function that searches through players and npcs, then selects one of them to be
set as a target for the searching player. I've got some code of something that works now but it doesnt
always work. Sometimes it'll select Worldspawn instead of an NPC or a player/bot.
[CODE]function FindTargetFunc()
local targets = ents.FindInCone( LocalPlayer():GetPos(), LocalPlayer():GetForward(), 650, 45 )
local me = LocalPlayer()
for i = 1, #targets do
if ( targets[i]:IsPlayer() ) then
me.SelectedTarget = targets[i/#targets+1];
print( me.SelectedTarget )
net.Start( "SendTargetEntity" )
net.WriteEntity( me.SelectedTarget )
net.SendToServer()
elseif ( targets[i]:IsNPC() ) then
me.SelectedTarget = targets[i/#targets+1];
print( me.SelectedTarget )
net.Start( "SendTargetEntity" )
net.WriteEntity( me.SelectedTarget )
net.SendToServer()
else
return false;
end
end
end[/CODE]
Acecool had told me that using ents.FindInCone was really expensive, and I tried using a util.TraceLine but that yielded no results.
One last thing I should mention, this is all clientside.[/QUOTE]
Use LocalPlayer():GetEyeTrace().Entity. But, you'll have to change some code. Because ents.FindInCone can return multiple entities and GetEyeTrace only returns one entity, you'll have to change the code to set one enemy instead of looping through the table of found entities.
[lua]function FindTargetFunc()
local target = LocalPlayer():GetEyeTrace().Entity
local me = LocalPlayer()
if IsValid( target ) then
print(target)
net.Start( "SendTargetEntity" )
net.WriteEntity( target )
else
return false;
end[/lua]
Untested but should work fine.
[QUOTE=MegaTronJohn;48129770]Use LocalPlayer():GetEyeTrace().Entity. But, you'll have to change some code. Because ents.FindInCone can return multiple entities and GetEyeTrace only returns one entity, you'll have to change the code to set one enemy instead of looping through the table of found entities.
-code-
Untested but should work fine.[/QUOTE]
Missing EOF (end). And you're missing net.SendToServer().
[code]
function FindTargetFunc()
local ply = LocalPlayer()
local target = ply:GetEyeTrace().Entity
if IsValid( target ) then
net.Start( "SendTargetEntity" )
net.WriteEntity( target )
net.SendToServer()
else
return false;
end
end
[/code]
How i can delete old RenderTarget texture? I need to create RenderTarget with other size.
[QUOTE=bran92don;48125643]Does anyone know why team.GetColor() returns the yellow for all teams even though I've set it in the shared.lua?
I am calling team.GetColor() on the client but that shouldn't be a issue since I am calling this in the shared.lua.
This is how the CreateTeams function looks:
[lua]
function GM:CreateTeams()
TEAM_BLUE = 1
team.SetUp( TEAM_BLUE, "Blue Team", Color( 0, 0, 255, 255 ), true )
team.SetSpawnPoint( TEAM_BLUE, "ai_hint" )
end
[/lua][/QUOTE]
Can you give some more info? like how you called the GetColor() function.
[QUOTE=Phoenixf129;48129985]Missing EOF (end). And you're missing net.SendToServer().
[code]
function FindTargetFunc()
local ply = LocalPlayer()
local target = ply:GetEyeTrace().Entity
if IsValid( target ) then
net.Start( "SendTargetEntity" )
net.WriteEntity( target )
net.SendToServer()
else
return false;
end
end
[/code][/QUOTE]
Whoops. Well, we all make mistakes :P
In the Pointshop, between every Model or Material, there is a thin gray line that appears. Can anyone point me to the code that causes this, or how to do it?
I can paste the code, but it's really long and I'm not sure which one it occurs on.
This is what it looks like: [url]http://gyazo.com/48caf0638003b0cd72ba68f06c1dfbf6[/url]
Sorry, you need to Log In to post a reply to this thread.