406 Results
Actually, since gamemodes are being tied to the menu, let gamemodes define custom binds that can be changed in the options menu.
Nerdeboy Addons Reply
Automatically load config files named after a gamemode when the player joins a server running them. For example, sandbox.cfg would be called whenever I join a sandbox server.
Nerdeboy Addons Reply
Can you print(global.child) from the function or is that returning nil?
Nerdeboy Developing Reply
No problem!
Nerdeboy Developing Reply
The function you should be using is "include": [lua]include( 'drivers.lua' )[/lua] Also, just because you're defining the global doesn't mean it's loaded by all lua files. It can only be accessed if the defining file is included, so if you're defining it in init.lua and acce...
Nerdeboy Developing Reply
You're probably not including the file where the variable is defined, so when it goes to look it up, it will just return nil because it's not in its scope. As long as the lua file with the variable's definition is included you should be able to share globals between the two fi...
Nerdeboy Developing Reply
If you're trying to do this for something in Garry's Mod, you can use console commands in conjunction with usermessages to give the appearance of simultaneous editing of files. If you just want you and a friend to be able to code at the same time, consider using a plugin such...
Nerdeboy Developing Reply
Something like [b][url=http://luasearch.netau.net/?list=findinbox&func=ents.FindInBox]ents.FindInBox [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b]? I'd recommend creating a brush entity though.
Nerdeboy Developing Reply
[QUOTE=Chessnut;35252038]Would be neat if they could form groups.[/QUOTE] Color half of them red and half of them blue, then make them fight. Just like a real city.
Nerdeboy Developing Reply
Are you sure it's a real model?
Nerdeboy Developing Reply
They should at least run around in circles or something.
Nerdeboy Developing Reply
Do you want to close the panel or just return control to the player?
Nerdeboy Developing Reply
You could try using [b][url=http://luasearch.netau.net/?list=gui&func=gui.EnableScreenClicker]gui.EnableScreenClicker [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b] set to false.
Nerdeboy Developing Reply
[b][url=http://luasearch.netau.net/?list=Panel+methodmatch&func=Panel.Remove]Panel:Remove [img]http://luasearch.netau.net/media/favicon.png[/img][/url][/b]
Nerdeboy Developing Reply
Serverside hooks don't mean they can't access shared information. Shared is present and runs on both the client and the server, so creating an entity in shared.lua will make it accessible in init.lua. The difference is that what happens on the server doesn't happen on the clie...
Nerdeboy Developing Reply
You can create a custom brush entity using Lua. Create a folder in garrysmod\gamemodes\yourgamemode\entities\entities\ with the name of the entity you want to create, like "trigger_boolean". Then create a shared.lua inside of that with this code: [lua]ENT.Type = "brush" Add...
Nerdeboy Developing Reply
You have to wake the physics object in your initialize function, like this [lua] local phys = self:GetPhysicsObject() if (phys:IsValid()) then phys:EnableCollisions(true) phys:EnableDrag(false) phys:EnableGravity(true) phys:SetMass( 500 ) phys:Wake() end[/lua]
Nerdeboy Developing Reply
Add this to your cl_init.lua: [lua]function ENT:Draw() self.Entity:DrawModel() end[/lua]
Nerdeboy Developing Reply
[url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4389.html?title=Enumeration_List#COLLISION_GROUP]Here's one[/url]
Nerdeboy Developing Reply
Can you add permalinking to the individual functions?
Nerdeboy Developing Reply
Is your gamemode derived from any other gamemode?
Nerdeboy Developing Reply
Right, try "base_anim" instead
Nerdeboy Developing Reply
Just launch any gamemode derived from fretta with your server.
Nerdeboy Developing Reply
First of all, I wouldn't recommend overriding the base entities like prop_physics, but rather creating your own with a different name that is functionally the same. Secondly, you need to add this to your shared.lua: [lua]ENT.Type = "anim" ENT.Base = "prop_physics"[/lua]...
Nerdeboy Developing Reply
We're not being hard on you because you're bad at coding. We're being hard on you because you conned someone.
Nerdeboy Developing Reply
Yeah, create the folder with the same name as the entity class that you want to spawn. Look at how other gamemodes do it if you're confused on how to set it up.
Nerdeboy Developing Reply
Entities need to be defined in \gamemodes\yourgamemode\entities\entities\, not in the gamemode directory itself.
Nerdeboy Developing Reply
I lied, StartTouch should work. Where is the lua file located and what is it called?
Nerdeboy Developing Reply
StartTouch is limited to brush entities. It won't function for point entities.
Nerdeboy Developing Reply
Then pay your friend to give back the money or something.
Nerdeboy Developing Reply
Give him the $5 back.
Nerdeboy Developing Reply
You could make a table of buffs/debuffs and use table.insert to add new buffs. Then, when drawing, you just have to loop through the components and increment the position of them each time. For example, [lua]function GM:HUDPaint() xpos = 0 xoffset = 32 for k,v in pairs( B...
Nerdeboy Developing Reply
[QUOTE=vexx21322;35168195]Need some help with derma. Say I have two elements that I want to dock to each side of a frame, but I want the frame to scale depeneding on the size that I set the elements to. I tried SizeToContents.[/QUOTE] You could modify the position of one of...
Nerdeboy Developing Reply
You shouldn't have done that.
Nerdeboy Developing Reply
You'll need to manually override the reload and primary fire functions in order to make it pump action and reload shell by shell. That means more than just variables. First of all, to make it pump after every shot, I recommend adding a new function that will play the pump ani...
Nerdeboy Developing Reply
God why not just make a feedback addon and have someone else run the server, then ask for whatever the feedback thing outputs at the end of the test so you don't have to pay intense detail to everyone.
Nerdeboy Developing Reply
Bleh, paying too much attention to anime and not enough to lua.
Nerdeboy Developing Reply
You could spawn the other entity in the ENT.Initialize() function of either the turret or the base. That would also allow you to communicate between the two. So if this is my base code: [lua]ENT.Turret = nil function ENT:Initialize() self.Turret = ents.Create( "turret_ent...
Nerdeboy Developing Reply
Just set the angles of the turret and not of the base?
Nerdeboy Developing Reply
[QUOTE=JustSoFaded;35128952]If it were %25 visibility then he would want SetColor(255, 255, 255, 65). Since ~63 is a 4rth of 255 (255 being maximum alpha)[/QUOTE] Or you could do SetColor(255, 255, 255, 255*0.25)
Nerdeboy Developing Reply
Try this instead [lua]if self.Owner:GetEyeTrace().Entity and self.Owner:GetEyeTrace().Entity:GetClass("prop_ragdoll") then[/lua]
Nerdeboy Developing Reply
I find that 50 units or so is pretty good for player reach.
Nerdeboy Developing Reply
If you did a gamemode_reload that would be why.
Nerdeboy Developing Reply
It's being sent too late because you're defining variables before sending the Lua files.
Nerdeboy Developing Reply
You could do hull traces instead. They'll hit a larger area than just where the player's crosshair is. [b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexd642.html?title=Util.TraceHull]Util.TraceHull [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
Nerdeboy Developing Reply
Physical bullets have nothing to do with bullet penetration. In fact, they'd probably be the opposite. I'm assuming he's referring to physical bullets as they're commonly called, which means projectiles that actually have to travel distances rather than use hitscan, complete w...
Nerdeboy Addons Reply
Really though, physical bullets would be the worst thing. Balance-wise that is.
Nerdeboy Addons Reply
Make sure that the ass is in bold in game too.
Nerdeboy Developing Reply
[QUOTE=mil0001;35100258]Some kind of detection for an entity to detect if another entity is within x radius to it.[/QUOTE] [b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf7e1-2.html?title=Ents.FindInSphere]Ents.FindInSphere [img]http://wiki.garrysmod.c...
Nerdeboy Developing Reply
Could you post your player spawn function?
Nerdeboy Developing Reply
No, you don't. Assuming ID is defined somewhere.
Nerdeboy Developing Reply
Try moving the DeriveGamemode line to the top of shared.lua.
Nerdeboy Developing Reply
Assuming it's a SWEP you can use the clip size it has defined: [lua]ActiveWeapon.Primary.ClipSize[/lua] Otherwise you'd need to look it up yourself.
Nerdeboy Developing Reply
[QUOTE=SiPlus;35088439]Would be good HUD for Warsow, but too cartoony for gm_construct.[/QUOTE] Construct is obviously not the gamemode's map.
Nerdeboy Developing Reply
No problem!
Nerdeboy Developing Reply
[lua]Ammo = LocalPlayer():GetAmmoCount(ActiveWeapon:GetPrimaryAmmoType()) + ActiveWeapon:Clip1()[/lua]
Nerdeboy Developing Reply
What function are you calling this in or hooking this to? Also, you're getting the player's current reserve ammunition, not their current clip.
Nerdeboy Developing Reply
[img_thumb]http://i52.tinypic.com/2z8x3sp.jpg[/img_thumb][img_thumb]http://i54.tinypic.com/24fxzyc.jpg[/img_thumb] Just doing some simple HUD work
Nerdeboy Developing Reply
Probably because it hasn't been made to run in singleplayer. Try running a LAN listen server to test it instead.
Nerdeboy Addons Reply
Does it work fine in multiplayer?
Nerdeboy Addons Reply
You don't have permission to view this result. It's probably in a forum that your account has no access to.
[QUOTE=DylanWilson;35052639]someone should up the max map size from a short int to a regular int, because it's not 2004 anymore and even so, the rest of quake-based games don't have this annoying restriction that would be a nice addition, assuming everyone doesn't max the ma...
Nerdeboy Addons Reply
[lua]function GM:PlayerShouldTakeDamage( ply, att ) return not (ply:Team() == att:Team()) end[/lua] Adding this to a serverside file will disable friendly fire.
Nerdeboy Developing Reply
What color is the error?
Nerdeboy Developing Reply
All .vtf files need an associated .vmt file. [url=https://developer.valvesoftware.com/wiki/Creating_a_Material#Creating_a_material]More information here[/url]
Nerdeboy Developing Reply
Did you mean to do this? [lua] for k, v in pairs( LastStand.Config.ZombieEntities ) do for c, d in pairs( ents.FindByClass( v ) ) do d:Remove() end end [/lua]
Nerdeboy Developing Reply
[QUOTE=Hentie;35019129]drunk eye angles[/QUOTE] Touch zombie, get dizzy?
Nerdeboy Developing Reply
Could you provide a little more detail? I don't understand what you're asking.
Nerdeboy Developing Reply
Try to see if [b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index8c6a.html?title=Entity.GetGroundEntity]Entity.GetGroundEntity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] still works. [b]edit:[/b] Someone rate me late.
Nerdeboy Developing Reply
I haven't worked much with string.find, but if that returns the same thing, it would be faster than creating a table and populating it with the string's contents. Unless you're using really, really big strings, it shouldn't make much of a difference though.
Nerdeboy Developing Reply
Anything between [ and ] in a table is the key, not the value. You're checking the key "A" of table car_table, which doesn't exist. You want to check for the value, so you'd do: [lua]if ( table.HasValue( car_table, "A" ) ) then print( "True" ) else print( "False" ) end[/lua]
Nerdeboy Developing Reply
That's cool. I'll just open up your computer and take a look at that file.
Nerdeboy Developing Reply
Where is "owner" defined?
Nerdeboy Developing Reply
So Counter Strike without the objective or weapon buying?
Nerdeboy Addons Reply
[QUOTE=Tom083;35006474]Hi, is there anyway to make the players current weapon's icon appear on his hud? By icon i mean the image displayed for the weapon on the weapon selection.[/QUOTE] That depends. Is it a SWEP or one of the default weapons?
Nerdeboy Developing Reply
This would actually be extremely easy to make.
Nerdeboy Addons Reply
Are we talking about the cool as hell 70's Doctor that knew Martian Karate or the lame ass new ones that don't use violence because they're chumps?
Nerdeboy Addons Reply
[QUOTE=Mrkrabz;34952735]question about xp[/QUOTE] The problem with your code below is that it's checking if they have the exact amount of experience needed to level up. For example, if I have 900 xp, and need 1000 to level up, and killing this NPC gives me 100, then I will...
Nerdeboy Developing Reply
[lua]local ang = player:GetAimVector():Angle() ang:RotateAroundAxis( ang:Up(), 180 ) player:SetEyeAngles( ang )[/lua] [b]ang[/b] is the opposite of the player's view. The player will be facing in the exact opposite direction.
Nerdeboy Developing Reply
[QUOTE=Darkwater124;34881702]impulse 100 (IIRC)[/QUOTE] Excuse me sir I believe you mean player.Flashlight()
Nerdeboy Addons Reply
Are the materials in the proper place?
Nerdeboy Developing Reply
How about allowing devs to modify the player's flashlight?
Nerdeboy Addons Reply
-snip i'm wrong-
Nerdeboy Developing Reply
Here we go: [lua]function mySetupMove(ply, mv) if not (( ply:KeyDown( IN_FORWARD ) ) or ( ply:KeyDown( IN_BACK ) ) or ( ply:KeyDown( IN_MOVELEFT ) ) or ( ply:KeyDown( IN_MOVERIGHT ) )) then return end if (ply:KeyDown(IN_FORWARD)) then if (ply:KeyDown(IN_MOVERIGH...
Nerdeboy Developing Reply
[lua] CreateClientConVar("xpos", "0", true, false) CreateClientConVar("ypos", "0", true, false) concommand.Add("menu", function() local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 50,50 ) DermaPanel:SetSize( 200, 250 ) DermaPanel:SetTitle( "Testing Derma Stu...
Nerdeboy Developing Reply
[QUOTE=brandonj4;34867683]local xpos = GetConVarNumber("xpos") isnt that the same thing?[/QUOTE] You're only setting xpos when the script first runs. You have to set it every time your HUD is drawn.
Nerdeboy Developing Reply
[QUOTE=Mrkrabz;34855195]Didn't explain that well but basically is there a function to set the players rotation? (So he faces the mouse all the time) and the camera can stay static facing down and not rotate.[/QUOTE] [b][url=http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod...
Nerdeboy Developing Reply
Ah. Well for one, I don't have the screen clicker enabled. That's probably why you can't rotate with the mouse. I'd remove the "gui.EnableScreenClicker(true)" line and limit the player's range some other way.
Nerdeboy Developing Reply
[QUOTE=Mrkrabz;34848701]I'm currently doing [lua]function MyCalcView(ply, pos, angles, fov) gui.EnableScreenClicker(true) local view = {} view.origin = pos+(angles:Up()*300) view.angles = Angle(90,0,0) view.fov = fov return view end[/lua] To s...
Nerdeboy Developing Reply
Try this? [lua] local pos = LocalPlayer():GetShootPos():ToScreen() -- position of the player's eyes local x = ScrW() * 0.5 local y = ScrH() * 0.5 local tr = LocalPlayer():GetEyeTrace() -- performs a trace from the player's eyes to near inifinity if( tr and tr.HitPos )...
Nerdeboy Developing Reply
I'm lost. What does server management and web design have to do with Lua?
Nerdeboy Developing Reply
[QUOTE=brandonj4;34842978]How would I lock it to start at a certain angle always? ex. When I look at the ground I see all black and that's not what I want. [lua] local lastCalcView = CurTime() local lastAngle = Angle(0,0,0) function MyCalcView(ply, pos, angles, fov) l...
Nerdeboy Developing Reply
Try changing self.Busy == false to !self.Busy
Nerdeboy Developing Reply
It looks like you're setting the weapon to busy, playing the animation, and then immediately setting it back to not be busy. You'll need to add a timer with the duration of the animation that runs self.Busy = false, rather than what you're doing. [b]Edit:[/b] This may do...
Nerdeboy Developing Reply
You accepted a job and a deposit. You should finish the job, not 60% of it. If you can't finish the job completely, you return the deposit or ask for an extension. It's like if you ask for a $1,000 loan and put down your computer as collateral. Then the bank sells your comput...
Nerdeboy Developing Reply
Because Garry's Mod makes a whole lot of sense and that immersion must be preserved. It's not worth hindering developers.
Nerdeboy Addons Reply
[QUOTE=superadamwo;34789909]There needs to be some kind of placeholder model that isnt a giant error sign to replace certain things like weapons and players. For example when people try to play TTT without CS:S, all the players and guns are giant error signs which makes it imp...
Nerdeboy Addons Reply
[QUOTE=kcaj300;34754649]Methods: I am unsure if a larger space can be created within the smaller exterior of the TARDIS. If it can, great, if it can't then we find a way to make it work, ie the door is a portal to the interior.[/QUOTE] This would probably be the only way to ...
Nerdeboy Developing Reply
Improved content management. Allow clients to download maps from the content folders rather than forcing server operators to move them around.
Nerdeboy Addons Reply
What kind of a voting system?
Nerdeboy Developing Reply