[QUOTE=twoski;38109495][img_thumb]http://i.imgur.com/ehwil.jpg[/img_thumb]
I've had this problem before but i forget what i did to fix it. some ignorez fuckery or something?[/QUOTE]
You are probably using the wrong render hook for that, try using [b][url=http://wiki.garrysmod.com/page/Events/Entity/DrawTranslucent]Events/Entity/DrawTranslucent[img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b].
In GMod 13 I've noticed that some entities doesn't support transparency at all.
In other words.
self:SetColor( Color(255, 0, 0, 0) ) is the same thing as self:SetColor( Color(255, 0, 0, 255) ).
Anyone got any solution for this?
I know i can solve it by manually drawing it and using render.SetBlend to control the transparency but
I think that solution is far from optimal.
[QUOTE=Sakarias88;38110198]In GMod 13 I've noticed that some entities doesn't support transparency at all.
In other words.
self:SetColor( Color(255, 0, 0, 0) ) is the same thing as self:SetColor( Color(255, 0, 0, 255) ).
Anyone got any solution for this?
I know i can solve it by manually drawing it and using render.SetBlend to control the transparency but
I think that solution is far from optimal.[/QUOTE]
I believe the problem is that setcolor doesn't set the rendermode to support alpha blending anymore, so you'll have to do it manually, like the color mode on the toolgun does.
Try setting the rendermode to RENDERMODE_TRANSALPHA or RENDERMODE_TRANSCOLOR after setting the color.
How do you even add an entity to the entity list in GM13 because I thought you just need the shared stuff.
Hello, I'm trying to import the css weapons from gmod 12 into the beta, but i get this error:
[lua]
[ERROR] lua/weapons/weapon_cs_base/shared.lua:20: bad argument #2 to 'CreateFont' (table expected, got number)
1. CreateFont - [C]:-1
2. unknown - lua/weapons/weapon_cs_base/shared.lua:20
[/lua]
Can anyone help me understand and fix the error?
Here's the section which bugged:
[lua]
if ( CLIENT ) then
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = false
SWEP.ViewModelFOV = 82
SWEP.ViewModelFlip = true
SWEP.CSMuzzleFlashes = true
// This is the font that's used to draw the death icons
surface.CreateFont( "csd", ScreenScale( 30 ), 500, true, true, "CSKillIcons" )
surface.CreateFont( "csd", ScreenScale( 60 ), 500, true, true, "CSSelectIcons" )
end
[/lua]
Thanks in advance, stay greasy...
[QUOTE=bertilml;38112889]Hello, I'm trying to import the css weapons from gmod 12 into the beta, but i get this error:
[lua]
[ERROR] lua/weapons/weapon_cs_base/shared.lua:20: bad argument #2 to 'CreateFont' (table expected, got number)
1. CreateFont - [C]:-1
2. unknown - lua/weapons/weapon_cs_base/shared.lua:20
[/lua]
Can anyone help me understand and fix the error?
Here's the section which bugged:
[lua]
if ( CLIENT ) then
SWEP.DrawAmmo = true
SWEP.DrawCrosshair = false
SWEP.ViewModelFOV = 82
SWEP.ViewModelFlip = true
SWEP.CSMuzzleFlashes = true
// This is the font that's used to draw the death icons
surface.CreateFont( "csd", ScreenScale( 30 ), 500, true, true, "CSKillIcons" )
surface.CreateFont( "csd", ScreenScale( 60 ), 500, true, true, "CSSelectIcons" )
end
[/lua]
Thanks in advance, stay greasy...[/QUOTE]
Fonts are being created differently in GMod 13.
Heres what you want:
[lua]
surface.CreateFont("CSKillIcons", {
font = "csd",
size = ScreenScale(30),
weight = 500
})
surface.CreateFont("CSSelectIcons", {
font = "csd",
size = ScreenScale(60),
weight = 500
})
[/lua]
It seems that my entities are not being loaded in GM13.
I copied and pasted sent_ball code and changed the name and what not but it doesn't appear in the spawnmenu nor can I do ent_create sent_ball2
I figured it out. Dumb on my part.
How can I fix my NPC's stances? They're all like this
[img]http://i.imgur.com/pMRAE.png[/img]
Is there something I can do to make them stand normally with their arms to their sides or do I have to move their bones manually?
inb4 leaked gamemode
The model isn't on the server's models folder.
[QUOTE=Chessnut;38113802]The model isn't on the server's models folder.[/QUOTE]
The model is there, there's the hitbox and the use hook works as well.
[QUOTE=xaviergmail;38113950]The model is there, there's the hitbox and the use hook works as well.[/QUOTE]
The model is not player model, but human model. It doesn't have the correct bones.
Seems to me that something is wrong with WalkSpeed in my gamemode. Setting the walkspeed ingame using lua_run doesn't change the fact. I can set it to 500, but it still wont change from an extremely slow crawling pace. The player goes maybe 5 units a second. Is anyone else having this issue?
[editline]20th October 2012[/editline]
I'm also getting this derma error all the time, and i cant figure out how to trace it to the problem:
[code]
[ERROR] lua/vgui/dlabel.lua:68: attempt to index local 'col' (a number value)
1. ApplySchemeSettings - lua/vgui/dlabel.lua:68
2. PerformLayout - lua/vgui/dlabel.lua:74
3. unknown - lua/vgui/dbutton.lua:125
[/code]
[code][ERROR] gamemodes/bhop/gamemode/init.lua:40: attempt to index a nil value
1. v - gamemodes/bhop/gamemode/init.lua:40
2. unknown - lua/includes/modules/hook.lua:86
[/code]
Is there a way to check if an index in a table exists?
[lua]
if (!records[game.GetMap()][v:SteamID()]) then
[/lua]
[lua]
if (records[game.GetMap()][v:SteamID()] == nil) then
[/lua]
I get thrown the same error on both of these methods.
[QUOTE=Hyper Iguana;38122422][code][ERROR] gamemodes/bhop/gamemode/init.lua:40: attempt to index a nil value
1. v - gamemodes/bhop/gamemode/init.lua:40
2. unknown - lua/includes/modules/hook.lua:86
[/code]
Is there a way to check if an index in a table exists?
I get thrown the same error on both of these methods.[/QUOTE]
[lua]
if( records[game.GetMap()] and records[game.GetMap()][v:SteamID()]) then
[/lua]
[QUOTE=Jvs;38122479][lua]
if( records[game.GetMap()] and records[game.GetMap()][v:SteamID()]) then
[/lua][/QUOTE]
Looks like that fixed the if...then statement, but half of that hook isn't working for me. Am I doing something wrong here? I feel like I'm creating the indexes incorrectly.
[lua]local records = glon.decode(file.Read("bhop_records.txt"))
if( !records[game.GetMap()] or !records[game.GetMap()][v:SteamID()]) then
records[game.GetMap()][v:SteamID()]["name"] = v:Nick()
records[game.GetMap()][v:SteamID()]["time"] = finishtime
else
if (records[game.GetMap()][v:SteamID()]["time"] > finishtime) then
records[game.GetMap()][v:SteamID()]["name"] = v:Nick()
records[game.GetMap()][v:SteamID()]["time"] = finishtime
end
end
PrintTable(records)
file.Write("bhop_records.txt", glon.encode(records))[/lua]
I want the table to look like this:
[lua]
Table = {
["gm_flatgrass"] = {
["STEAM_0:0:293874"] = {
["time"] = 1.29384
["name"] = "player name"
}
}
}[/lua]
The code is supposed to check if the index is there, and if not, create all the indexes needed and inset the ["time"] and ["name"] values into the table.
[QUOTE=Hyper Iguana;38122533]Looks like that fixed the if...then statement, but half of that hook isn't working for me. Am I doing something wrong here? I feel like I'm creating the indexes incorrectly.
[lua]
if( !records[game.GetMap()] or !records[game.GetMap()][v:SteamID()]) then
records[game.GetMap()][v:SteamID()]["name"] = v:Nick()
[/lua]
[/QUOTE]
In this case, it might happen that the records[game.GetMap()] table does not exists, so you need to make sure you are initializing it.
You can do this in several ways, personally I prefer "lazy" initiation of these tables, like this:
[lua]
local currMap = game.GetMap()records[currMap] = records[currMap] or {}
[/lua]
You should consider localizing your tables, so the code would become more readable, and nicer, like this:
[lua]
local playerRecord = records[game.GetMap()][v:SteamID()]
if ( playerRecord.time > finishtime ) then
playerRecord.name = v:Nick()
playerRecord.time = finishtime
end
[/lua]
Also, on a final note, glon is removed from the gmod13 beta, you should use [B][URL="http://wiki.garrysmod.com/page/Libraries/util/TableToJSON"]util.TableToJSON[/URL][/B] and [B][URL="http://wiki.garrysmod.com/page/Libraries/util/JSONToTable"]util.JSONToTable[/URL][/B] instead.
Wait, so how're you using these records? Is what you posted being run in a loop?
[i]e:[/i] damnit ninja'd
[QUOTE=Archemyde;38116375]
I'm also getting this derma error all the time, and i cant figure out how to trace it to the problem:
[code]
[ERROR] lua/vgui/dlabel.lua:68: attempt to index local 'col' (a number value)
1. ApplySchemeSettings - lua/vgui/dlabel.lua:68
2. PerformLayout - lua/vgui/dlabel.lua:74
3. unknown - lua/vgui/dbutton.lua:125
[/code][/QUOTE]
[lua]
AccessorFunc( PANEL, "m_colText", "TextColor" )
AccessorFunc( PANEL, "m_colTextStyle", "TextStyleColor" )
PANEL.SetColor = PANEL.SetTextColor
function PANEL:ApplySchemeSettings()
self:SetFontInternal( self.m_FontName )
self:UpdateColours( self:GetSkin() );
local col = self.m_colTextStyle
if ( self.m_colText ) then col = self.m_colText end
self:SetFGColor( col.r, col.g, col.b, col.a )
end
[/lua]
I remember you posted about a custom skin, it appears that your DLabels lack a default color setting.
When errors are comeing from GCF files, always take a look of their contents, check out this site: [URL="http://luabin.overvprojects.nl/svn"]http://luabin.overvprojects.nl/svn[/URL]
[editline]21st October 2012[/editline]
[QUOTE=Matt W;38076762]Is there any way to draw binary PNG data as a texture?[/QUOTE]
There isnt a nice and native way to do that. If you really, really, REALLY need to do this, and there is sure no other way, then you could hack together a HTML page with your raw PNG data, and render it to the disk with [URL="http://www.facepunch.com/showthread.php?t=1209423&p=37737751&viewfull=1#post37737751"]this little PNG rendering workaround[/URL].
Then you can load it with the default material system.
How to disable the ability to manipulate props when pressing TAB and right mouse button in Gmod13?
You cant disable the menu by default, but you can individual tools:
[lua]
hook.Add( "CanProperty", "DisablePropManipulation", function( ply, action, ent ) return false end )
[/lua]
ty i was using InKeyDown but i think id rather use that.
There any way to have the mouse activated but not visible? I'm near positive I recall seeing a function to set the visibility of the mouse but I can't seem to remember what it was.
[b]Edit:[/b] Nevermind, I can just use an empty panel with panel.SetCursor
[lua]string.ToMinutesSeconds[/lua]
[lua]string.ToMinutesSecondsMilliseconds[/lua]
I'm using a CurTime() time (so around 9 decimal places) and whenever the amount of seconds gets above ~32, a 1 is added to the time (ex: should be 0:32, becomes 1:32). I'm also making checks to see if the time is being calculated wrong, and it's not.
[img]http://i.imgur.com/uYtMJ.png[/img]
Any suggestions?
edit:
Tried making my own time format function, not looking too good either:
[lua]
local function FormatTime( sec )
local hours = 0
local minutes = 0
local seconds = 0
local millaseconds = 0
sec = math.Round(sec, 2)
if sec >= 3600 then
hours = sec % 3600
sec = sec - (hours * 3600)
end
if sec >= 60 then
minutes = sec % 60
sec = sec - (minutes * 60)
end
seconds = sec % 1
sec = sec - seconds
if sec < 1 and sec > 1 then
millaseconds = sec
end
local formatted = minutes..":"..seconds
if millaseconds > 0 then
formatted = formatted..":"..string.Explode(".",millaseconds)[2]
end
if hours > 0 then
formatted = hours..":"..formatted
end
MsgN("hours = "..hours)
MsgN("minutes = "..minutes)
MsgN("second = "..seconds)
MsgN("millaseconds = "..millaseconds)
return formatted
end
[/lua]
edit:
Another attempt:
[lua]string.FormattedTime(CurTime() - StartTime, "%02i:%02i:%02i")[/lua]
[img]http://i.imgur.com/mLkwl.png[/img]
EDIT:
Finally got it ;p
[lua]
function FormatTime( seconds )
local hrs,mins,secs,ms = 0,0,0,0
hrs = math.floor(seconds / 3600)
mins = math.floor((seconds - (3600 * hrs)) / 60)
secs = math.floor((seconds - (3600 * hrs) - (60 * mins)))
ms = string.Explode(".",tostring(math.Round((seconds - (3600 * hrs) - (60 * mins) - secs),1)))[2] or 0
local format = ""
if hrs > 0 then
format = hrs..":"
end
if mins < 10 then
mins = "0"..mins
end
if secs < 10 then
secs = "0"..secs
end
return format..mins..":"..secs..":"..ms
end[/lua]
how do you make it so everyone in the server can see chat.AddText?
[QUOTE=Swiftone;38127425]how do you make it so everyone in the server can see chat.AddText?[/QUOTE]
SERVERSIDE
[lua]
umsg.Start("broadcast")
umsg.String("I love you all")
umsg.End()
[/lua]
CLIENTSIDE
[lua]
usermessage.Hook("broadcast", function(data)
local message = data:ReadString()
chat.AddText(message)
end)
[/lua]
derp, tyvm
[QUOTE=Hyper Iguana;38127533]SERVERSIDE
[lua]
umsg.Start("broadcast")
umsg.String("I love you all")
umsg.End()
[/lua]
CLIENTSIDE
[lua]
usermessage.Hook("broadcast", function(data)
local message = data:ReadString()
chat.AddText(message)
end)
[/lua][/QUOTE]
You Forgot To Send Colors You Stupid Ass Skid Swiftone Dont View This Thread If You Have A Problem Use The Wiki Like The Rest Of These Skids
Is tmysql4 working on GMod 13?
Whenever I start my server, it crashes when it tries loading the module.
Sorry, you need to Log In to post a reply to this thread.