• What do you need help with? V3
    6,419 replies, posted
Is anyone else having issues with adding vtf files to the resources on gmod 13? I add the vmt file using resource.AddFile but the vtf file isn't downloaded. I also tried by using resource.AddSingleFile.
I'm new to LUA, how do i make permanent variables in the server the mod is working on? Like say, what gun is in an inventory slot, or how much money someone has? Also, i'd like some information on HighVoltage's question, too. Thanks in advance.
You can save money data using SQL, file.Write etc. There are multiple methods. [editline]24th September 2012[/editline] [QUOTE=Undefined;37785415]Is anyone else having issues with adding vtf files to the resources on gmod 13? I add the vmt file using resource.AddFile but the vtf file isn't downloaded. I also tried by using resource.AddSingleFile.[/QUOTE] Last time I tried, it worked fine for me.
I'm trying to run animations/gestures on a DModelPanel, I have the code below, it works but I need the names of the animations, the ENUMs don't work. Anyone know where I can find the list of animation names? [lua] function PANEL:DoAnim(name) local iSeq = self.Entity:LookupSequence( name ); if (iSeq <= 0) then iSeq = self.Entity:LookupSequence( "WalkUnarmed_all" ) end if (iSeq <= 0) then iSeq = self.Entity:LookupSequence( "walk_all_moderate" ) end if (iSeq > 0) then self.Entity:ResetSequence( iSeq ) end self:RunAnimation() timer.Simple(3.5, function() self:ResetAnim() end) end [/lua]
Is there any way to make an entities model scale down and have no gravity? This is what I have right now. [lua]function ENT:Initialize() math.randomseed(CurTime()) self.Owner = self.Entity:GetVar("owner",Entity(1)) self.flightvector = self.Entity:GetUp() * ((75*39.37)/66) -- Velocity in m/s, inches to meters conversion, ticks per second.FIRST NUMMER = SPEED self.timeleft = CurTime() + 5 self.Entity:SetModel( "models/Combine_Helicopter/helicopter_bomb01.mdl" ) self.Entity:SetModelScale( Vector( 0.1, 0.1, 0.1 ) ) self.Entity:PhysicsInit( SOLID_VPHYSICS ) self.Entity:SetMoveType( MOVETYPE_NONE ) self.Entity:SetSolid( SOLID_VPHYSICS ) self:Think() end [/lua] No matter what, whatever I change setmodelscale to, it doesn't change size.
Isn't Entity.SetModelScale client side?
Once you draw something using surface library, while in ENT:Draw(), is there a way to read the pixels you've drawn?
Im editing the alyx swep in my attempt to learn sweps better. The only error I seem to get is this. [IMG]http://i.imgur.com/gSJe9.png[/IMG] Im really new to lua, but I think its telling me to make it into a table. Here is the code for what i'm talking about. [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( "arial", ScreenScale( 30 ), 500, true, true, "CSKillIcons" ) surface.CreateFont( "arial", ScreenScale( 60 ), 500, true, true, "CSSelectIcons" ) end[/lua] If anyone can point me in the right direction I would appreciate it. [B]SOLVED[/B]
The surface.CreateFont is changed, so the parameters are now: [code] Now: - surface.CreateFont( string fontName, (table:FontData) fontData ) Old: - surface.CreateFont( string font_name, number size, Number weight, boolean antialiasing, boolean additive, string ew_font_name, boolean drop_shadow, boolean outlined, number blur ) [/code] You can find the possible members of the FontData table here: [URL]http://wiki.garrysmod.com/page/Classes/FontData[/URL] [editline]25th September 2012[/editline] [lua] -- Old surface.CreateFont( "arial", ScreenScale( 60 ), 500, true, true, "CSKillIcons" ) -- New surface.CreateFont( "CSKillIcons", { font = "arial", size = ScreenScale( 60 ), weight = 500, antialias = true, additive = true } ) [/lua]
[QUOTE=MDave;37793460]The surface.CreateFont is changed, so the parameters are now: [code] Now: - surface.CreateFont( string fontName, (table:FontData) fontData ) Old: - surface.CreateFont( string font_name, number size, Number weight, boolean antialiasing, boolean additive, string ew_font_name, boolean drop_shadow, boolean outlined, number blur ) [/code] You can find the possible members of the FontData table here: [URL]http://wiki.garrysmod.com/page/Classes/FontData[/URL] [editline]25th September 2012[/editline] [lua] -- Old surface.CreateFont( "arial", ScreenScale( 60 ), 500, true, true, "CSKillIcons" ) -- New surface.CreateFont( "CSKillIcons", { font = "arial", size = ScreenScale( 60 ), weight = 500, antialias = true, additive = true } ) [/lua][/QUOTE] Thank you, this was helpful.
[QUOTE=Undefined;37785415]Is anyone else having issues with adding vtf files to the resources on gmod 13? I add the vmt file using resource.AddFile but the vtf file isn't downloaded. I also tried by using resource.AddSingleFile.[/QUOTE] Try sending the vmt, the vtf should be sent automatically Make sure the material is present in the "gamemodes/mygamemode/content/materials" directory
[QUOTE=Nikita;37792485]Once you draw something using surface library, while in ENT:Draw(), is there a way to read the pixels you've drawn?[/QUOTE] Actually, I tried to use render.CapturePixels() while inside a draw call, and it crashed my game. Any idea what to do?
Need a bit of SQLite help. [lua] function SQLTest(ply) steamID = ply:SteamID() sql.Query("UPDATE player_weapons SET weapon_ar2 = '1' WHERE steam_id = '"..steamID.."'") print(sql.QueryValue("SELECT weapon_ar2 FROM player_weapons WHERE steam_id = '"..steamID.."'")) if sql.QueryValue("SELECT weapon_ar2 FROM player_weapons WHERE steam_id = '"..steamID.."'") == 1 then ply:Give("weapon_ar2") else Msg("Nope") end end [/lua] The purpose of this function is purely to test whether or not the SQL successfully reads and writes data. It returns the following: 1 Nope The data type for weapon_ar2 is set to byte - I'm essentially using it as a boolean. What did I do wrong?
[QUOTE=Nalestom;37796775]Need a bit of SQLite help. [lua] function SQLTest(ply) steamID = ply:SteamID() sql.Query("UPDATE player_weapons SET weapon_ar2 = '1' WHERE steam_id = '"..steamID.."'") print(sql.QueryValue("SELECT weapon_ar2 FROM player_weapons WHERE steam_id = '"..steamID.."'")) if sql.QueryValue("SELECT weapon_ar2 FROM player_weapons WHERE steam_id = '"..steamID.."'") == 1 then ply:Give("weapon_ar2") else Msg("Nope") end end [/lua] The purpose of this function is purely to test whether or not the SQL successfully reads and writes data. It returns the following: 1 Nope The data type for weapon_ar2 is set to byte - I'm essentially using it as a boolean. What did I do wrong?[/QUOTE] It probably returns a string, try using tonumber() : [lua] if tonumber(sql.QueryValue("SELECT weapon_ar2 FROM player_weapons WHERE steam_id = '"..steamID.."'")) == 1 then [/lua]
I am trying to fix a gamemode that requires gatekeeper BUT the gatekeeper module just crashes when its called with "require("gatekeeper")" i got some dumps if you want to look on them because I D K
[QUOTE=andre_bule;37797533]I am trying to fix a gamemode that requires gatekeeper BUT the gatekeeper module just crashes when its called with "require("gatekeeper")" i got some dumps if you want to look on them because I D K[/QUOTE] updat ehte module [editline]25th September 2012[/editline] oh jesus, let me translate that update the module
[QUOTE=Banana Lord.;37797558]updat ehte module [editline]25th September 2012[/editline] oh jesus, let me translate that update the module[/QUOTE] Unfortunatly I updated the module before I asked and DOESNT WORK it crashes BTW It was from the SVN so its allways updated right?
[QUOTE=andre_bule;37797574]Unfortunatly I updated the module before I asked and DOESNT WORK it crashes BTW It was from the SVN so its allways updated right?[/QUOTE] are you using it for GMod 12? if so, see [url]http://facepunch.com/showthread.php?t=695636&p=37502252&viewfull=1#post37502252[/url]
[QUOTE=Undefined;37796833]It probably returns a string, try using tonumber() : [lua] if tonumber(sql.QueryValue("SELECT weapon_ar2 FROM player_weapons WHERE steam_id = '"..steamID.."'")) == 1 then [/lua][/QUOTE] Works beautifully. Thank you. =)
[QUOTE=Banana Lord.;37797705]are you using it for GMod 12? if so, see [url]http://facepunch.com/showthread.php?t=695636&p=37502252&viewfull=1#post37502252[/url][/QUOTE] If i was in GMod 12 IT would be fully working, in GMod 13 the modules crash the server, btw i made the server in my PC not in a VPS or something like it Dump: [url]https://dl.dropbox.com/u/53962028/Dump/GMod%2013/srcds_1482030_crash_2012_9_25T18_53_15C0.mdmp[/url] I am starting to hate GMod 13
iirc modules are breaking every update in GMod 13, we will probably have to wait for the module gods to update gatekeeper for the latest beta
How draw html boxes below other panels and respect their ZIndex of their parent?
This is for Gmod12, not 13, just in case they're different in this bit. I'm trying to modify this addon, and this piece of code is bugging me [code]if ( slots[selected] ) then RunConsoleCommand( "use", slots[selected].name )[/code] Where slots[selected].name would be slots[selected].ak47 depending on whatever the name is. So when that is chosen, this code appears earlierL [code]weapontab["ak47"].name = "weapon_ak47"[/code] So it would combine the console commands and make "use weapon_ak47" Is there any chance I could change it so instead of making it use the command use, I can just make it enter in the console whatever is in the weapontab? For example, could I make it so instead of already putting "use" in the console, it just goes straight to weapontab, so I can make it like this: [code]weapontab["ak47"].name = "use weapon_ak47"[/code] Or would I need to do more than just swap bits here and there?
[QUOTE=andre_bule;37797826]If i was in GMod 12 IT would be fully working, in GMod 13 the modules crash the server, btw i made the server in my PC not in a VPS or something like it Dump: [url]https://dl.dropbox.com/u/53962028/Dump/GMod%2013/srcds_1482030_crash_2012_9_25T18_53_15C0.mdmp[/url] I am starting to hate GMod 13[/QUOTE] I recompiled gatekeeper for the beta. Windows: [url]http://blackawps-glua-modules.googlecode.com/svn/trunk/gmsv_gatekeeper/bin/gmsv_gatekeeper.dll[/url] Linux: [url]http://g3.iriz.uk.to/~srcds/modules/gm13/bin/gmsv_gatekeeper_linux.dll[/url] (Thanks to python)
[QUOTE=cam64DD;37784132]I've been trying to make a reload function that automatically lowers your weapon whenever you reload, a.k.a goldeneye, but I just have no fucking clue how to do that. Could anyone make me a reload function with that feature and explain how it works? Thanks![/QUOTE] use GetViewModelPosition() to visibly lower the gun, then send the reload func.
I have a question about this entity, teleporting away when you point your crosshair on it. The code works but it teleports like mad and keeps doing that, even when you dont look at the entity (Like with your back turned to it, or you look the other way), I want to make it like, if your crosshair whats in the middle of your screen points at the entity, then it teleports away, otherwise it stays where it is. [lua] for k, v in pairs( _player.GetAll() ) do if( v:GetViewEntity() ) then local teleport = math.random(1, 2); if (teleport == 1) then v:EmitSound("apoc/emily/fear_movesound.mp3", 100, 100) self:SetPos(Vector(-1056.117188, -1054.273682, 256.031250)) elseif (teleport == 2) then v:EmitSound("apoc/emily/fear_movesound.mp3", 100, 100) self:SetPos(Vector(-1241.035889, -277.033936, -81.434555)) end; end; end; [/lua] Entity name is called: aura_stalkemily If you need a full code, I will post it. Thanks in advance :D
Quick question. Are there functions I can put into an autorun lua to lock specific doors on map start? I know all entities in the map have specific Id's but am unsure how to get them or what function I can use to lock them.
got a quick question, im trying to make a derma panel and i need it to be opened with a chat command. whats the easiest way to make one? I have a working console command and Ive been looking on google but have found nothing.
[QUOTE=mil0001;37802028]Quick question. Are there functions I can put into an autorun lua to lock specific doors on map start? I know all entities in the map have specific Id's but am unsure how to get them or what function I can use to lock them.[/QUOTE] [lua] for k, v in pairs( ents.GetAll() ) do if( v:GetClass() == "doorclassiforget" ) then //lock it end end [/lua]
[QUOTE=JustSoFaded;37802850][lua] for k, v in pairs( ents.GetAll() ) do if( v:GetClass() == "doorclassiforget" ) then //lock it end end [/lua][/QUOTE] Yeah similar but that just gets all the doors with "prop_door_rotating" or whatever it is and would lock all of them. What about specific doors on the map?
Sorry, you need to Log In to post a reply to this thread.