• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
I want to make a map view for my main menu script, but I've got no idea how to start. (A large version of a minimap in a DFrame, help pl0x!) I was told it's something to do with CalcView, but what with it?
How do I [B]get[/B] and [B]set[/B] the players amount of DarkRP cash in LUA? I am rather new to LUA but am getting it really well!
[img]http://xav.pw/i/2JYqPRe[/img] Is there a way to disable/override that monstrosity that is the player disconnected message? I know I can hide it by overriding chat.AddText but I am looking for a better approach to this. [editline]penis[/editline] And yes I just noticed my kick message is wrong.
[QUOTE=xaviergmail;46719584][img]http://xav.pw/i/2JYqPRe[/img] Is there a way to disable/override that monstrosity that is the player disconnected message? I know I can hide it by overriding chat.AddText but I am looking for a better approach to this. [editline]penis[/editline] And yes I just noticed my kick message is wrong.[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/gameevent/Listen]gameevent.Listen[/url]
[QUOTE=ConnorMcF;46719568]How do I [B]get[/B] and [B]set[/B] the players amount of DarkRP cash in LUA? I am rather new to LUA but am getting it really well![/QUOTE] take a look at the wiki [url]http://wiki.darkrp.com/index.php/Main_Page[/url] but here is the direct link [url]http://wiki.darkrp.com/index.php/Functions/player/server/addmoney[/url]
[QUOTE=ConnorMcF;46719568]How do I [B]get[/B] and [B]set[/B] the players amount of DarkRP cash in LUA? I am rather new to LUA but am getting it really well![/QUOTE] ply:getDarkRPVar("money") ply:addMoney(amount)
[QUOTE=NiandraLades;46718895]So I was putting together a little help menu The idea is to have buttons over that white DPanel on the left, which when pressed change that help text to something else, i.e update page/a list of challenges/etc stuff like that I know I could easily do text:SetText("new text here") when you click the DButton, which was my original intention, but is that really the method people use for doing these sort of menus or is there another way I could go about this?[/QUOTE] You could use tabs.
Trying to go about creating my own "cursor" rather than using the generic mouse or any of its variants. Original plan was to simply draw over it in one of the HUD hooks or with a VGUI panel, but I can't get anything to actually sit over top of it. Second plan was to find a way to stop it from drawing, but I can't get that to work using SetCursor("none") - I was hoping I could put it on the world panel or the parent HUD panel but it doesn't seem to do anything. Anyone pulled this off?
[QUOTE=Smt;46717591]im sure i tried that but it just didn't work, maybe i'm just more retarded than i though but ill try it again edit: i think the part im having trouble with is networking (assuming thats what i'm meant to do) from the client's menu to the server to spawn the ent, is there like a nice tutorial somewhere for making a simple shop system or something?[/QUOTE] bump again
[QUOTE=Smt;46722476]bump again[/QUOTE] [url]http://wiki.garrysmod.com/page/Net_Library_Usage[/url] That is as close as you are going to get. You can just use derma to run functions between client and server. For example, a client-sided derma button sends a create this ent message to the server. While this isn't what you are looking for, it may help. P.s. this may not be the most efficient way of doing it. I created an entity with a derma menu that could edit its information. Here is the derma: [url]https://github.com/pandaman09/DogFight/blob/master/entities/entities/spawnpoint_vis/cl_init.lua#L209[/url] Then on the server, I used the information to edit the entity. Here is the code: [url]https://github.com/pandaman09/DogFight/blob/master/gamemode/spawneditor/server/server_core.lua#L115[/url] In case you still don't get how to spawn the entity [url]http://wiki.garrysmod.com/page/ents/Create[/url] and here is how I used it. [url]https://github.com/pandaman09/DogFight/blob/master/gamemode/spawneditor/server/server_core.lua#L29[/url]
[QUOTE=TheBigS;46722332]Trying to go about creating my own "cursor" rather than using the generic mouse or any of its variants. Original plan was to simply draw over it in one of the HUD hooks or with a VGUI panel, but I can't get anything to actually sit over top of it. Second plan was to find a way to stop it from drawing, but I can't get that to work using SetCursor("none") - I was hoping I could put it on the world panel or the parent HUD panel but it doesn't seem to do anything. Anyone pulled this off?[/QUOTE] Is this for the default cursor or like a custom one for something like 3D2D?
[QUOTE=LUModder;46723456]Is this for the default cursor or like a custom one for something like 3D2D?[/QUOTE] Just the plain old, ugly, white cursor. :P
[QUOTE=Courier-1101;46719174]I'm a non-developer trying to make a gamemode with developers who don't do anything; where can I find resources to help me with scraping together working code for Gmod?[/QUOTE] Hey, welcome to FacePunch. I have written over 400 tutorials and completed "systems" in Lua for Garry's Mod. I tutor and answer questions for free; feel free to add me on Steam if you need some guidance. This forum is for devs that need help working on things. Here are some resources to help you get started: ------------------------------------------------------------- Generalized Lua Help ( Links to Wikis, Answers the question of "Where do I post a simple question or DarkRP Specific question", links to other resources compiled by forum members ) [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_general_lua_learning.lua.html[/url] Useful Programs ( SteamCMD, Autosizer, Desktops, Process Explorer ) and Notepad++ Upgrades [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_useful_programs_and_notepadpp_upgrades.lua.html[/url] Acecool Dev Base Skeletonized Base Game-Mode ( Never worry about Include or AddCSLuaFile ever again; comes with New Hooks, Console Commands, Meta-Table Objects, Helper Functions, Extended Functionality, and more! ) [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_acecooldev_base_gamemode_info.lua.html[/url] acecooldev_base Addon - All of the features above, but packaged as an addon. [ COMING SOON ] [editline]16th December 2014[/editline] [QUOTE=MadkillerMax;46719474]I have a quick question, does anyone have a clue when http requests are queued, sent, and received? A quick example is with MySQLOO uses the Think hook to process requests, requiring players to be available.[/QUOTE] They're delayed calls so you'd need to use a callback, just like with MySQL modules. They can take up to x seconds until they may expire or succeed... [editline]16th December 2014[/editline] [QUOTE=_Entity;46718801]What functions should i use to attach prop models to a bone? (Never done this before)[/QUOTE] You can BoneMerge, or you can LookupBone, GetBoneMatrix, GetTranslation, RotateAroundAxis the entity to the bone every frame on a post-draw hook. [editline]16th December 2014[/editline] [QUOTE=NuKeRGG;46718164]can someone help me in here? :( sorry if its not allowed to post another thread in here but.. yeah.. i'm so tired of searching and searching and trying etc, and can't get it to work etc.. i really need help :( [url]http://facepunch.com/showthread.php?t=1441911[/url][/QUOTE] You seem to have all of the code you need but SoundDuration may not work on mp3s, only wav files...
Idk why, I'm keep getting that BaseClass things when I register new weapon [url]http://pastebin.com/ygKwX1Lx[/url]
[QUOTE=Lizart;46717788]how would I go about creating a circle that expands outwards? im trying to create an EMP grande effect of som sort[/QUOTE] How do you want to draw it? You can calculate points like this: [code]// // Calculate points on a circles edge - Josh 'Acecool' Moser // // Center, 2r = w, smoothness, rotate points , spread distance between first and last function math.CalculateCirclePoints( _origin, _radius, _pointsCount, _rotationOffset, _splitSpread ) // _pointsCount = _pointsCount || 4; // SplitSpread is the points of distance between the first, and the last point ( Useful for speedometers ) _splitSpread = _splitSpread || 0; // RotationOffset is how far around the first point should swing ( Useful for speedometers as by default, the first unit is at 3 o'clock ) _rotationOffset = _rotationOffset || 0; // pi = 1 half, we need to go full circle, then compensate for the number of points we are doing. local _slices = ( 2 * math.pi ) / _pointsCount; local _points = { }; for i = 0, ( _pointsCount + _splitSpread ) - 1 do if ( _splitSpread > 0 && i > _pointsCount -1 -_splitSpread ) then continue; end local _angle = ( _slices * ( i + _rotationOffset ) ) % _pointsCount; local _x = _origin.x + _radius * math.cos( _angle ); local _y = _origin.y + _radius * math.sin( _angle ); _points[ i ] = Vector( _x, _y, 0 ); end return _points; end [/code] Or, poly circle: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/poly/simplified_circles_with_poly.lua.html[/url] [editline]16th December 2014[/editline] [QUOTE=rebel1324;46724157]Idk why, I'm keep getting that BaseClass things when I register new weapon [url]http://pastebin.com/ygKwX1Lx[/url][/QUOTE] Are you using the default function to print tables or a custom? If custom, make sure you store tables you already printed out to avoid duplicates. If default, show us the swep code...
idk if this is a problem with my lua or a problem with my texture but how do I make it so the sprites override the farthest one and not the other way around? [t]http://i.imgur.com/JLHHJmS.jpg[/t] Top left is the closest one, Bottom right is the farthest
[QUOTE=ROFLBURGER;46724176]idk if this is a problem with my lua or a problem with my texture but how do I make it so the sprites override the farthest one and not the other way around? [t]http://i.imgur.com/JLHHJmS.jpg[/t] Top left is the closest one, Bottom right is the farthest[/QUOTE] Draw the one on the bottom last.
[QUOTE=Acecool;46724207]Draw the one on the bottom last.[/QUOTE] I don't know how I would do that, that's what I'm asking. They're actual physical objects that one can spawn and move around [t]http://i.imgur.com/DCQw7sQ.jpg[/t] this is what I'm using [code]local mat = Material("sprites/mario64coin") function ENT:Draw() local pos = self:GetPos() render.SetMaterial( mat ) render.DrawSprite( pos, self.CoinSize, self.CoinSize, self:GetColor() ) end [/code]
[QUOTE=rebel1324;46724157]Idk why, I'm keep getting that BaseClass things when I register new weapon [url]http://pastebin.com/ygKwX1Lx[/url][/QUOTE] Set SWEP.Base to "weapon_base" in your base. The game spits errors and does other odd things when a base isn't defined. [editline]16th December 2014[/editline] [QUOTE=ROFLBURGER;46724221]I don't know how I would do that, that's what I'm asking. They're actual physical objects that one can spawn and move around this is what I'm using [code]local mat = Material("sprites/mario64coin") function ENT:Draw() local pos = self:GetPos() render.SetMaterial( mat ) render.DrawSprite( pos, self.CoinSize, self.CoinSize, self:GetColor() ) end [/code][/QUOTE] Interesting.. What does the texture file look like? You want the one on the bottom to be drawn on top, or what exactly?
[QUOTE=Acecool;46724138]acecooldev_base Addon - All of the features above, but packaged as an addon. [ COMING SOON ][/QUOTE] Stop. It's not like you're going to go back through your [url=http://lab.facepunch.com/search/?q=acecooldev_base]116[/url] posts to edit them when you finally do release it. [editline]15th December 2014[/editline] [QUOTE=Courier-1101;46719174]I'm a non-developer trying to make a gamemode with developers who don't do anything; where can I find resources to help me with scraping together working code for Gmod?[/QUOTE] I learn by example. Take a look at some cool looking SEnts' code. Edit the bouncy ball to add new things. Perhaps make it knock people away. You're not going to start working on your gamemode this year, that's for sure.
[QUOTE=Acecool;46724223]Interesting.. What does the texture file look like? You want the one on the bottom to be drawn on top, or what exactly?[/QUOTE] [t]http://i.imgur.com/Y0gTQxc.jpg[/t] The texture is an animated spinning coin texture [code]"UnlitGeneric" { "$basetexture" "sprites/mario64coin" "$translucent" "1" "$ignorez" "0" "$vertexcolor" "1" "$vertexalpha" "1" "Proxies" { "AnimatedTexture" { "animatedTextureVar" "$basetexture" "animatedTextureFrameNumVar" "$frame" "animatedTextureFrameRate" "15" } } } [/code] [t]http://fc07.deviantart.net/fs37/f/2008/264/f/8/Super_Mario_64_Yellow_Coin_by_master_mind777.gif[/t] It looks like this but instead of gold, it's white so I can use multiple colors. The problem is that for some reason the coins are drawing from farthest to nearest, meaning that the farthest coin is overrides the nearest coin. I don't want it to do that, I want it so it's like reality.
It may be because of the translucent flag. Transparency should be covered with the alpha, translucent means light can pass through... That is my guess... You can try it out by calling CreateMaterial with the same flags, just leave translucent out...
[QUOTE=Acecool;46724323]It may be because of the translucent flag. Transparency should be covered with the alpha, translucent means light can pass through... That is my guess... You can try it out by calling CreateMaterial with the same flags, just leave translucent out...[/QUOTE] Materials auto-update. I already tried setting it to 0 and the problem still occured
How do you make it so the player is registered as the killer when your entity is punted with the grav gun (and it kills something)? SetOwner doesn't appear to do it.
I need a big help with rotating things So far I made a clientside entity follow the bone of something, and I want to rotate the clientside entity relative to the clientside entity itself. I forgot how to do this, I was doing other things for a week. I really want to get this project finally done.
[QUOTE=ROFLBURGER;46724693]I need a big help with rotating things So far I made a clientside entity follow the bone of something, and I want to rotate the clientside entity relative to the clientside entity itself. I forgot how to do this, I was doing other things for a week. I really want to get this project finally done.[/QUOTE] ent:SetAngles(Angle(p,y,r))
[QUOTE=ROFLBURGER;46724693]I need a big help with rotating things So far I made a clientside entity follow the bone of something, and I want to rotate the clientside entity relative to the clientside entity itself. I forgot how to do this, I was doing other things for a week. I really want to get this project finally done.[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/LocalToWorldAngles]Entity:LocalToWorldAngles[/url]
[QUOTE=Acecool;46724138][editline]16th December 2014[/editline] They're delayed calls so you'd need to use a callback, just like with MySQL modules. They can take up to x seconds until they may expire or succeed...[/QUOTE] I understand the calls are asynchronous however, I do not know if they require players online to run.
[QUOTE=Ott;46726275][img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/LocalToWorldAngles]Entity:LocalToWorldAngles[/url][/QUOTE] Unfortunately this doesn't work in this case because it isn't spawned yet. I am literally pulling my hair out because of this issue. I'm trying to make it so that there are weapons on people's backs and legs but this fucking rotation thing is driving me insane. [lua] local PBonePos, PBoneAng = ply:GetBonePosition(PBoneIndex) --later in the code ply.PrimaryObj = ClientsideModel( PModel ) local bonusangle = Angle(0,0,0) local bonusvector = Vector(0,0,0) ply.PrimaryObj:SetAngles(PBoneAng) -- go fuck yourself ply.PrimaryObj:SetPos(ply:GetPos() + bonusvector) -- works ply.PrimaryObj:FollowBone( ply, PBoneIndex ) -- works only in position [/lua] this is only called once. it doesn't even have the same fucking angles throughout. sometimes the model is one angle one time, and another angle the other time and I don't know how to fix it. I don't know how to properly rotate the fucking thing either and it's really pissing me off because literally everything else is perfect except for the actual cosmetic effect
Pretty sure adam burton made this, it might be helpful? [url]https://dl.dropboxusercontent.com/u/55311295/ShareX/2014/12/weaponholster.lua[/url]
Sorry, you need to Log In to post a reply to this thread.