This GitHub issue has a good explanation of the velocity functions and their actual Lua mappings (they're incorrect to the engine versions).
So basically SetAbsVelocity is useless and I should be using SetVelocity or SetLocalVelocity instead. :suicide:
Yeah, unfortunately, there isn't a binding for CBaseEntity::SetAbsVelocity set.
Appreciate the help.
You can use an GM/EntityEmitSound hook and change that specific sound.
Are you calling cam.End3D2D as well?
Also, if you want to get a table of a specific class without using ents.FindByClass, create a table and check GM/OnEntityCreated and GM/EntityRemoved for entities of the right class to insert/remove.
Not sure if this is the right place to ask, but a bit ago I noticed the lack of a tau cannon on the buggy's, and a lack of gun on the airboat. Even in the HL2 level where you get the gun placed on the airboat I don't think it works. Why is this? Can they be made to exist/work again?
You can attach guns with these
https://steamcommunity.com/workshop/filedetails/?id=104607712
and it should work on the level, since I imagine it changes the entity on a deeper level or something, I don't know though
Anyone have an idea why this randomly broke? All it does is show banners from gametracker, it worked fine for like 2 years, then randomly broke. I believe it was broken before last update. I've tried different ways to link the the img, but they seem to do the same thing. You can browse to the image fine.
https://files.facepunch.com/forum/upload/109942/c0a75763-811f-4484-ac54-b37c426d51f7/why.png
local s = vgui.Create("DFrame")
s:SetPos(50,50)
s:SetSize(800,500)
s:SetTitle("sG | Servers")
s:SetDraggable(true)
s:ShowCloseButton(false)
s:SetBackgroundBlur(false)
s.Paint = function()
draw.RoundedBox( 8, 0, 0, s:GetWide(), s:GetTall(), Color( 0, 0, 0, 225 ) )
end
local html = vgui.Create( "HTML", s)
html:SetHTML( [[<img src='https://cache.gametracker.com/server_info/162.251.165.27:27025/b_560_95_1.png' border='0' width='560' height='95' alt=''>]] )
html:SetSize( 600, 400 )
html:SetPos(60, 60)
Hello there. I want to learn how can I do some kind of data exchange using http.Fetch () or http.Post ().
Like
my gmod server -> my website request
"hello"
my website -> my gmod server
"world"
That should be pretty basic, but I really have no idea where to start, except that I need to use PHP and http.Something for each of sides.
Thanks in advance.
You will need to set up HTTP Polling.
There's no easy way to have your web server talk to your game server directly, so the next best thing is for the game server to use http.Fetch in a timer and have the web server store messages in a database and send them each time the game server connects.
Thank you. That worked! It still perplexes me why the guns were even removed in the first place!
Maybe in sandbox it happened too often that noobs shot down innocent bystanders? It'd be nice if there was atleast a setting for it, or a menu that spawns them with weapons. (maybe there is as an addon, idk)
Gametracker probably changed their API.
I was thinking it was probably a gametracker change, but all i'm doing is linking to an image from gametrackers predefined banners. When I create a basic html page with the same code it works fine, so i'm a little confused.
Could you try testing it on the chromium beta branch?
Just tried it, works fine in the chromium branch, doesn't work with the main release.
You'll just have to wait for Chromium to be in the main branch then - Awesomium is losing browser compatibility by the day.
Where should I learn how to correctly make my animations .qc file without missing texture errors in crowbar? It seems like so many people know how to get their animations working into gmod but the only tutorial i know about is lazily made and low quality, surely these 1000's + of people who make SWEPS did not all learn from one bad tutorial, right?
ents.FindByClass( "npc_citizen" )
If there are no citizens on the map does this return nil or an empty table? I want to know when this happens, when the last citizen (or other npc of some sort) dies. Also, is there a better way than checking if ents.FindByClass returns nil or {} ???
It returns an empty table. As for checking if the last citizen died, what you could do but is probably a dumb idea: make an empty table, and when an entity is created, use it's class as the key and set to 1 (first time) if the key does not exist yet, add 1 to the value if it does exist already, and subtract 1 on entity removal. That should keep track of how many entites of that class you have, and just check the table.
Hey guys. I'm working with a friend and we're both a bit frustrated and tired. So we've decided to come to the forums where we know we'll get awesome help. Basically we want to test our gamemode, I am hosting the server and we got the ports all figured out. We want to change the gamemode from sandbox to skeleton (our gamemode name), but the console gives this error:
gamemode skeleton
Couldn't change active gamemode - 'skeleton' not found
We don't know why this is happening. This is the location of our skeleton gamemode in the Gmod server file.
Gmod Server\garrysmod\gamemodes\skeleton
Any thoughts?
If I wanted to add certain information to my gamemode to be accessible from any file in the code, would the following work? I haven't messed with the gamemode table before...
GM.Title = "My Gamemode Title"
GM.Color1 = Color(40, 40, 40)
GM.Color2 = Color(180, 180, 40)
GM.Type = GetGlobalString("GameType", "Defense")
GM.Rounds = 0 // Number of rounds completed
Any obvious reasons a DermaMenu doesn't show up at the position of the mouse? (it shows up at 0,0)
Probably because the position of the panel is never set. It seems to rely on setting the parent panel to set the position.
I tried setting the positions of both the parent and the menu and neither appeared to do much.
How are you supposed to implement the same kind of impact sounds from the prop_physics entities in your own scripted entity?
GM.Foo = 5
function GM:Func()
print( self.Foo )
end
function otherFunc()
print( GAMEMODE.Foo )
end
So I'm trying to create these clientside props to bonemerge to my player, but when I call it in a hook it crashed the game. What causes this?
hook.Add( "PrePlayerDraw", "DrawPlayerParts", function ( ply )
local prop = ents.CreateClientProp()
prop:SetModel( "models/thespireroleplay/humans/gear/backpack_m.mdl" )
prop:SetPos( ply:GetPos() )
prop:SetParent( ply )
prop:AddEffects( EF_BONEMERGE )
prop:Spawn()
end)
GM/PrePlayerDraw is going to be called at least once a frame so you're creating hundreds of client side props a second for each player. Either do it in a different hook or check to see if you've already create it for said player.
trying to make the thrown entity of my weapon give the player who either touches it or pushes e on it that weapon. trying this code
if stick:Touch( ply ) then
local ent = ents.Create( "stick" )
end
"stick" is the weapon name, and this is in the weapons shared.lua
Sorry, you need to Log In to post a reply to this thread.