• What do you need help with? V3
    6,419 replies, posted
When I display a Text in "3D" via cam.start3d2d, the font (especially big fonts) are not sharp and have edges. I've set antialias on true, but it doesn't seem to work as expected :( Font: [CODE] surface.CreateFont( "GarageFont", { font = "Helvetica", size = 20, weight = 620, blursize = 0, scanlines = 0, antialias = true, underline = true, italic = true, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false }); [/CODE]
GMOD 12 classes when coding DarkRP look like this: [CODE]TEAM_CITIZEN = AddExtraTeam("Citizen", Color(20, 150, 20, 255), { "models/player/Group01/Female_01.mdl", "models/player/Group01/Female_02.mdl", "models/player/Group01/Female_03.mdl", "models/player/Group01/Female_04.mdl", "models/player/Group01/Female_06.mdl", "models/player/Group01/Female_07.mdl", "models/player/group01/male_01.mdl", "models/player/Group01/Male_02.mdl", "models/player/Group01/male_03.mdl", "models/player/Group01/Male_04.mdl", "models/player/Group01/Male_05.mdl", "models/player/Group01/Male_06.mdl", "models/player/Group01/Male_07.mdl", "models/player/Group01/Male_08.mdl", "models/player/Group01/Male_09.mdl"}, [[The Citizen is the most basic level of society you can hold, while still more respected then the Hobo.]], {}, "citizen", 0, 45, 0, false, false)[/CODE] The 'new' gmod 13 one looks like [CODE]TEAM_HOBO = AddExtraTeam("Hobo", { color = Color(80, 45, 0, 255), model = "models/jessev92/player/misc/saddam.mdl", description = [[The lowest member of society. All people see you laugh. You have no home. Beg for your food and money Sing for everyone who passes to get money Make your own wooden home somewhere in a corner or outside someone else's door]], weapons = {"weapon_bugbait"}, command = "hobo", max = 5, salary = 0, admin = 0, vote = false, hasLicense = false })[/CODE] [B] Question: [/B]In the GMOD 13 version of coding Im having difficulty giving the option to choose your model. Im unsure as to how to lay it out, currently its just selecting the fist model listed.
[QUOTE=Blobtastic88;38393378]GMOD 12 classes when coding DarkRP look like this: [CODE]TEAM_CITIZEN = AddExtraTeam("Citizen", Color(20, 150, 20, 255), { "models/player/Group01/Female_01.mdl", "models/player/Group01/Female_02.mdl", "models/player/Group01/Female_03.mdl", "models/player/Group01/Female_04.mdl", "models/player/Group01/Female_06.mdl", "models/player/Group01/Female_07.mdl", "models/player/group01/male_01.mdl", "models/player/Group01/Male_02.mdl", "models/player/Group01/male_03.mdl", "models/player/Group01/Male_04.mdl", "models/player/Group01/Male_05.mdl", "models/player/Group01/Male_06.mdl", "models/player/Group01/Male_07.mdl", "models/player/Group01/Male_08.mdl", "models/player/Group01/Male_09.mdl"}, [[The Citizen is the most basic level of society you can hold, while still more respected then the Hobo.]], {}, "citizen", 0, 45, 0, false, false)[/CODE] The 'new' gmod 13 one looks like [CODE]TEAM_HOBO = AddExtraTeam("Hobo", { color = Color(80, 45, 0, 255), model = "models/jessev92/player/misc/saddam.mdl", description = [[The lowest member of society. All people see you laugh. You have no home. Beg for your food and money Sing for everyone who passes to get money Make your own wooden home somewhere in a corner or outside someone else's door]], weapons = {"weapon_bugbait"}, command = "hobo", max = 5, salary = 0, admin = 0, vote = false, hasLicense = false })[/CODE] [B] Question: [/B]In the GMOD 13 version of coding Im having difficulty giving the option to choose your model. Im unsure as to how to lay it out, currently its just selecting the fist model listed.[/QUOTE] Use a table as the model argument.
[QUOTE=Sapd;38393366]When I display a Text in "3D" via cam.start3d2d, the font (especially big fonts) are not sharp and have edges. I've set antialias on true, but it doesn't seem to work as expected :( Font: [CODE] surface.CreateFont( "GarageFont", { font = "Helvetica", size = 20, weight = 620, blursize = 0, scanlines = 0, antialias = true, underline = true, italic = true, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false }); [/CODE][/QUOTE] [lua] render.PushFilterMag(TEXFILTER.ANISOTROPIC) -- Use only one of these, mag if your text is magnified (i.e. scale <1) render.PushFilterMin(TEXFILTER.ANISOTROPIC) -- min if your text is smaller than it would be normally (i.e. scale >1) -- draw text render.PopFilterMag() -- again, just use one of these as explained above render.PopFilterMin()[/lua]
Am I doing this correctly? I dont see any difference: [CODE] local function Draw() cam.Start3D2D(Vector( -5570.689941, -10219.5, 250.031250), Angle(0, 180, 90), 4 ) render.PushFilterMag(TEXFILTER.ANISOTROPIC); draw.DrawText("Garage", "GarageFont", 0, 0, Color(90, 255, 90,255), TEXT_ALIGN_CENTER ) render.PopFilterMag() cam.End3D2D() end hook.Add("PostDrawOpaqueRenderables", "randomname174", Draw) [/CODE]
[code]-- min if your text is smaller than it would be normally (i.e. scale >1)[/code]
Has anyone noticed how glitchy the ShouldCollide function is after Garry made us use EnableCustomCollisions to enable it? [code]function GM:ShouldCollide(enta, entb) if (enta:IsPlayer() and enta:Team() == 3 and entb:IsNPC()) then return false end return true end[/code] With that code, everyone on team 3 can move through npcs with ease, but everyone else that's not on team 3 moves halfway through NPCs and their view stutters forwards and backwards. Edit: This is assuming both the player and the NPC have the EnableCustomCollisions on them.
what's the proper way to check each frame how far the player has moved their mouse (if cursor is visible)? Is there a hook for this or do i need to implement this in a think hook?
@darkwater124 after he posted his answer i googled after the method he used and landed here: [url]http://garry.tv/post/34414478795/texture-filtering[/url] In his post garry said: [QUOTE] *Min is the filtering to use when the texture is smaller than its size on screen, *Mag is the filter to use when it’s larger (magnified). [/QUOTE] (Also look at Drakehawke's secound comment in the code, it makes no sense)
[QUOTE=twoski;38394179]what's the proper way to check each frame how far the player has moved their mouse (if cursor is visible)? Is there a hook for this or do i need to implement this in a think hook?[/QUOTE] You would need to implement this yourself I think
Just do something along this logic: [code]local delay = 5 local function CompareMousePos(oldX, oldY) local x, y = gui.MousePos() if x == oldX and y == oldY then print("You haven't moved your mouse in "..delay.." seconds!") else print("You have moved your mouse within "..delay.." seconds!") end end function CheckMousePos() local x, y = gui.MousePos() timer.Create("NextCheck", delay, 0, function() CompareMousePos(x, y) end) end[/code]
this isnt explicitly a lua question, but does anyone know if there is a command to stop lua surface/hud elements being drawn, (for demo playback)?
cl_drawhud 0 hides the default elements, but if you're talking about elements drawn from code I'm not sure.
[QUOTE=Dark Slayre;38394168]Has anyone noticed how glitchy the ShouldCollide function is after Garry made us use EnableCustomCollisions to enable it? [code]function GM:ShouldCollide(enta, entb) if (enta:IsPlayer() and enta:Team() == 3 and entb:IsNPC()) then return false end return true end[/code] With that code, everyone on team 3 can move through npcs with ease, but everyone else that's not on team 3 moves halfway through NPCs and their view stutters forwards and backwards. Edit: This is assuming both the player and the NPC have the EnableCustomCollisions on them.[/QUOTE] Yeah. Can comfirm this..
Looks like Player:GetFriendStatus() doesn't return "blocked" anymore. [t]http://puu.sh/1oEmL[/t] (It still returns "friend", haven't tried "requested")
you can allways do [lua]local str = "" if Player:GetFriendStatus() == "none" then str = "Blocked" end code here... [/lua]
[QUOTE=NinjaS;38397031]you can allways do [lua]local str = "" if Player:GetFriendStatus() == "none" then str = "Blocked" end code here... [/lua][/QUOTE] That's just bad coding right there..
[QUOTE=NinjaS;38397031]you can allways do [lua]local str = "" if Player:GetFriendStatus() == "none" then str = "Blocked" end code here... [/lua][/QUOTE] Non-friends also show up as "none" [editline]10th November 2012[/editline] Btw, how do I draw PNGs to the screen? [editline]10th November 2012[/editline] Also, is there a DrawPoly for concave shapes?
Does anyone know why pressing q doesn't open the spawn menu in my sandbox derived gamemode?
Did you override GM:OnSpawnMenuOpen()?
Nope, also, just to be sure I've started with a new gamemode with all functions removed.
Is there a method to find a weapon's maximum ammo capacity for one clip? Or will I have to write a table with each individual weapon's max ammo and do it that way?
[QUOTE=jaooe;38399340]Nope, also, just to be sure I've started with a new gamemode with all functions removed.[/QUOTE] you sure you have sandbox as base? or base as base?
-snip-
[QUOTE=Kwaq;38399975]you sure you have sandbox as base? or base as base?[/QUOTE] shared [lua] GM.Name = "commune" GM.Author = "jaooe" GM.Email = "" GM.Website = "jaooe.tumblr.com" DeriveGamemode("sandbox") function GM:Initialize() self.BaseClass.Initialize( self ) end [/lua] cl_init [lua] //include("vgui.lua") [/lua] inti [lua] //AddCSLuaFile("cl_init.lua") //AddCSLuaFile("vgui.lua") [/lua] Literally a fresh gamemode :/
[QUOTE=jaooe;38400198]shared [lua] GM.Name = "commune" GM.Author = "jaooe" GM.Email = "" GM.Website = "jaooe.tumblr.com" DeriveGamemode("sandbox") function GM:Initialize() self.BaseClass.Initialize( self ) end [/lua] cl_init [lua] //include("vgui.lua") [/lua] inti [lua] //AddCSLuaFile("cl_init.lua") //AddCSLuaFile("vgui.lua") [/lua] Literally a fresh gamemode :/[/QUOTE] Don't you have to include shared.lua in both the init and cl_init?
Could we get a fix on GM:PostPlayerDraw() being called twice soon?
Can anyone tell me where the LUA folder is in Gmod 13, or where to put LUA scripts?
[QUOTE=LuckyLuke;38400284]Don't you have to include shared.lua in both the init and cl_init?[/QUOTE] Haha, I'm such an idiot, cheers.
[QUOTE=Dark Slayre;38397059]That's just bad coding right there..[/QUOTE] I've never actually used it so I don't even know what it returns, but it was just an example, at least I can code unlike some people.
Sorry, you need to Log In to post a reply to this thread.