[QUOTE=LUModder;47132354]Need exact font name that Windows provides, but you are not showing the full font view window so I cannot personally tell you.[/QUOTE]
The actual font name was "Architects Daughter", I changes it and it worked thanks.
When set serverside, should [img]http://wiki.garrysmod.com/favicon.ico[/img][url=http://wiki.garrysmod.com/page/Weapon/SetNextPrimaryFire]Weapon:SetNextPrimaryFire[/url] affect the clientside part as well? I am getting some mixed results in my testing.
What's wrong with LocalToWorld? The vectors it returns are just slightly off enough for it to be noticeable:
[code]local examplepos1, _ = LocalToWorld(Vector(-2000, 500, 200), Angle(0,0,0), Vector(100,0,0), Angle(0,-180,0))
MsgN(examplepos1)
Returns:
2100.000000 -500.000183 200.000000
local examplepos2, _ = LocalToWorld(Vector(-200, 500, 200), Angle(0,0,0), Vector(100,0,0), Angle(0,-180,0))
MsgN(examplepos2)
Returns:
299.999939 -500.000031 200.000000[/code]
Does anyone know why this happens, and if there are any good alternatives I can use?
Lets say i have a cute notification system, and i notify everyone on the server, and id like to notify again, how can i make the 1st notify go down so it has room for the other one?
anyone got any examples?
Well shit let me put the entire picture out here (pun not intended), this kinda explains why I can't use poster. You're taking the picture with a camera, but overlays would be applied to the image to give it a kinda old, weathered look. The HUD and any other regular screen overlays can't be in the shot, which is only important because there will be a screen overlay while you're aiming the camera. The picture isn't intended for personal download, at first it's only a server stored image. However, it has a [B]gameplay element[/B].
I just wanted to give the players the ability to download and save the photo if they want to. One of the biggest reasons why I don't want to save it to the client automatically is because, for as little as it does, it takes disk space for something they might not want. When the photo is taken for gameplay purposes, I think it should just be an option given to the player to save it.
[editline]13th February 2015[/editline]
So I guess the questions posed are: Can I take a HUGE oversized photo like this, and if so, how? How do I temporarily store it on the server? How can it be saved on the client if they ask for it?
[QUOTE=TwoYearLurker;47132995]What's wrong with LocalToWorld? The vectors it returns are just slightly off enough for it to be noticeable:
[code]local examplepos1, _ = LocalToWorld(Vector(-2000, 500, 200), Angle(0,0,0), Vector(100,0,0), Angle(0,-180,0))
MsgN(examplepos1)
Returns:
2100.000000 -500.000183 200.000000
local examplepos2, _ = LocalToWorld(Vector(-200, 500, 200), Angle(0,0,0), Vector(100,0,0), Angle(0,-180,0))
MsgN(examplepos2)
Returns:
299.999939 -500.000031 200.000000[/code]
Does anyone know why this happens, and if there are any good alternatives I can use?[/QUOTE]
Crazy complicated maths are why. I would just round the result to the nearest .001
[QUOTE=Adzter;47127025]What's the most efficient way of using Entity:WaterLevel() to check if a player is underwater, there's got to be a better way than throwing it in a timer and checking it for every player every few seconds.[/QUOTE]
Simply use this: [url]https://github.com/Facepunch/garrysmod-issues/issues/631[/url]
It seemed quick enough when I tested it on the client-side. I'll run more tests later, but for now this works well.
I recently set up a collection for my TTT server. I put in the collection ID, like the image below shows.
[img]http://i.imgur.com/HPPd3za.png[/img]
Do I need to have the workshop ID's of the addons in the resource.lua file as well? Or can I just run the collection ID?
[QUOTE=MagicalKiwi;47135314]I recently set up a collection for my TTT server. I put in the collection ID, like the image below shows.
[img]http://i.imgur.com/HPPd3za.png[/img]
Do I need to have the workshop ID's of the addons in the resource.lua file as well? Or can I just run the collection ID?[/QUOTE]
Content won't be send to clients unless each workshop id that has content to send to clients resource.Add*-s it. If they don't, you have to. It's be easier to do it for all of them yourself I suppose.
[QUOTE=MagicalKiwi;47135314]I recently set up a collection for my TTT server. I put in the collection ID, like the image below shows.
[img]http://i.imgur.com/HPPd3za.png[/img]
Do I need to have the workshop ID's of the addons in the resource.lua file as well? Or can I just run the collection ID?[/QUOTE]
[QUOTE=Willox;47135345]Content won't be send to clients unless each workshop id that has content to send to clients resource.Add*-s it. If they don't, you have to. It's be easier to do it for all of them yourself I suppose.[/QUOTE]
The easy / lazy way of doing it is this:
[code]
for _, addon in pairs(engine.GetAddons()) do
resource.AddWorkshop(tostring(addon.wsid))
end
[/code]
Trying to get another entities position (from a different / seperate addon).
I'm not sure how.
[QUOTE=MagicalKiwi;47135314]I recently set up a collection for my TTT server. I put in the collection ID, like the image below shows.
[img]http://i.imgur.com/HPPd3za.png[/img]
Do I need to have the workshop ID's of the addons in the resource.lua file as well? Or can I just run the collection ID?[/QUOTE]
As others have said, this will only download the content to your server... engine.GetAddons( ) has been broken SERVERside for a while, so using that to add the resource.AddWorkshop content won't work. Use my recursive system, this will explain how to install it and what it'll do: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_downloads_using_recursive_resource_system.lua.html[/url] ( This will also allow you to resource.AddWorkshop to gma files you've extracted by creating a blank file named xxxxx.gma where the x's represent the number / workshop id [ note, you can add text and it'll strip non digits but don't include any digits in the name unless it's part of the workshop id ] )
Next version will be packaged with my newest autoloader and will also use my fileio as a dependency so it'll check each .gma file to see what the contents are ( so it won't add a gma file if it contains a map and the map isn't the map which is currently playing ).
Does anyone either have a function or know of a way to get ManipulateBoneAngles to take world angles instead of whatever it normally takes?
[QUOTE=unrezt;47136550]Does anyone either have a function or know of a way to get ManipulateBoneAngles to take world angles instead of whatever it normally takes?[/QUOTE]
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/WorldToLocal]Global.WorldToLocal[/url]
[QUOTE=Acecool;47135964]engine.GetAddons( ) has been broken SERVERside for a while, so using that to add the resource.AddWorkshop content won't work.[/QUOTE]
Works fine for me.
[code] --[[
Based on math from
https://github.com/garrynewman/garrysmod/blob/4eb9bb19dcfac06007691376ecaf2dbc56efa6b2/garrysmod/lua/includes/extensions/util.lua#L36-L48
]]--
function SWEP:Initialize()
--[[
optimizations -
TraceResult SWEP.out | output of trace
Trace SWEP.trace | table of trace information
]]--
self.out = {};
self.trace = {
output = self.out;
mask = MASK_SHOT;
filter = {self};
};
end
function SWEP:Think()
--[[ localized for speed ]]--
local out = self.out;
local trace = self.trace;
local owner = self:GetOwner();
if(IsValid(owner)) then
-- being held
local direction = owner:GetAimVector();
local shoot_pos = owner:GetShootPos();
trace.start = shoot_pos;
trace.endpos = shoot_pos + direction * 4096 * 8;
--[[ we already added the weapon to the filter table ]]--
trace.filter[2] = owner;
util.TraceLine(trace);
if(IsValid(out.Entity) and out.Entity:IsPlayer()) then
self:PrimaryAttack();
end
end
end [/code]
Hey there, I need some help with getting the following code above to automatically target players. I'm working on an AI system but my main problem is that I can't get this code to make the user autotarget others.
[QUOTE=TwoYearLurker;47132995]What's wrong with LocalToWorld? The vectors it returns are just slightly off enough for it to be noticeable:
[code]local examplepos1, _ = LocalToWorld(Vector(-2000, 500, 200), Angle(0,0,0), Vector(100,0,0), Angle(0,-180,0))
MsgN(examplepos1)
Returns:
2100.000000 -500.000183 200.000000
local examplepos2, _ = LocalToWorld(Vector(-200, 500, 200), Angle(0,0,0), Vector(100,0,0), Angle(0,-180,0))
MsgN(examplepos2)
Returns:
299.999939 -500.000031 200.000000[/code]
Does anyone know why this happens, and if there are any good alternatives I can use?[/QUOTE]
Floating point precision. You can write your own lua function and it'll be a little more accurate since lua is double precision, but it'll be slower.
[editline]13th February 2015[/editline]
[QUOTE=Neat-Nit;47132744]When set serverside, should [img]http://wiki.garrysmod.com/favicon.ico[/img][url=http://wiki.garrysmod.com/page/Weapon/SetNextPrimaryFire]Weapon:SetNextPrimaryFire[/url] affect the clientside part as well? I am getting some mixed results in my testing.[/QUOTE]
No, you have to do it in shared lua so it sets the next fire on both server and client.
[QUOTE=_FR_Starfox64;47136988]Works fine for me.[/QUOTE]
I'm on dev-version, are you? It's broken in the dev-version and has been for a while.
I'm kind of a noob at Derma and stuff, So I was wondering how do you make so when a user presses a set key it will pull up the panel/menu I created?
[QUOTE=insanezanes;47137627]I'm kind of a noob at Derma and stuff, So I was wondering how do you make so when a user presses a set key it will pull up the panel/menu I created?[/QUOTE]
You could use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/KeyPress]GM/KeyPress[/url] for certain common keys.
You could also make the player bind a key to your console command and make the console command open the menu.
KeyPress isn't very reliable when it comes to pressing multiple keys at once to the point where it simply doesn't fire. I'd recommend either specific key hooks or PlayerBindPress for detection. I'm working on something related to controls / binds I think will benefit the community which I'll be releasing soon. It'll unify all / most of the hooks to properly work on press / release.
Here are some examples: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/open_vgui_based_on_keypress.lua.html[/url]
For scoreboard ( tap tab to open, tap tab to shut OR hold tab longer than 0.25 seconds for the key to close menu on release too... )
[url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/open_menu_key_tap_open_and_key_hold_release_close.lua.html[/url]
I've just started messing with C++, is there a way to manipulate the engine with it, if so, how?
[editline]14th February 2015[/editline]
I also have no idea how to compile a gmod module.
[QUOTE=Acecool;47137208]I'm on dev-version, are you? It's broken in the dev-version and has been for a while.[/QUOTE]
Nah I'm on the regular branch.
Another pretty noobish question. What is the best way to test things you are working on? Like have a test server that's hosted, host your own, or single player
[QUOTE=insanezanes;47139299]Another pretty noobish question. What is the best way to test things you are working on? Like have a test server that's hosted, host your own, or single player[/QUOTE]
The best but not so convenient way is to run a dedicated server (it can be on your computer) this way you can make sure that the networking works fine and that clientside files are properly being sent. Running a listen server works fine too.
[QUOTE=insanezanes;47139299]Another pretty noobish question. What is the best way to test things you are working on? Like have a test server that's hosted, host your own, or single player[/QUOTE]
Setting up a "dedicated server" (srcds) on your own computer is easy and makes sure that your mod works 100% in multiplayer. There's plenty of guides on how to do that online.
Don't use a listen server or singleplayer because what works in those doesn't necessarily work in a dedicated server.
I have a table with position vectors for values. How do I find, for each vector in the table, the closest other vector in the same table?
[QUOTE=VIoxtar;47139807]I have a table with position vectors for values. How do I find, for each vector in the table, the closest other vector in the same table?[/QUOTE]
For loop and Vec1:Distance(Vec2).
[QUOTE=insanezanes;47139299]Another pretty noobish question. What is the best way to test things you are working on? Like have a test server that's hosted, host your own, or single player[/QUOTE]
As Neat says; use a local SRCDS and make sure maxplayers is set to more than 1 ( otherwise it'll start in singleplayer mode ). You can run multiple gmod clients if you set sv_lan 1 in server, and set launch options for gmod ( via .bat file ) -multirun -steam
Here's the how-to on setting up the server: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_a_server_with_steamcmd.lua.html[/url]
[editline]14th February 2015[/editline]
[QUOTE=_FR_Starfox64;47139363]The best but not so convenient way is to run a dedicated server (it can be on your computer) this way you can make sure that the networking works fine and that clientside files are properly being sent. Running a listen server works fine too.[/QUOTE]
It's actually a lot more convenient to have a local srcds because if the client crashes you don't need to restart the server and it helps isolate the realm where the issue occurred. You can use a Listen-Server if you're familiar with realms and how code executes but if you're not then there will be issues with variables crossing realms, etc...
[editline]14th February 2015[/editline]
[QUOTE=_FR_Starfox64;47138881]Nah I'm on the regular branch.[/QUOTE]
I'm pretty sure the non-dev built isn't affected yet; this has been an issue on dev build for quite some time now unfortunately.
[editline]14th February 2015[/editline]
[QUOTE=meharryp;47138807]I've just started messing with C++, is there a way to manipulate the engine with it, if so, how?
[editline]14th February 2015[/editline]
I also have no idea how to compile a gmod module.[/QUOTE]
Hopefully this helps: [url]http://wiki.garrysmod.com/page/Creating_Binary_Modules[/url]
What function is it to make an NPC perform an action? I'm wanting to make them stay in a crouch pose (I found ACT_COVER_LOW)
Sorry, you need to Log In to post a reply to this thread.