• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
[QUOTE=bobbleheadbob;47221204]Why is that?[/QUOTE] Because FreeImage is stupid.
Is there another external tool that you can use instead of 'nav_generate', I've never successfully generated a navmesh without it completely crashing, tried using both SRCDS and Garry's Mod, left both running for a day until it eventually just completely crashed and Windows gave the 'not responding' message.
If the map is huge, it will take a lot of time. ( And possibly crash if it is too big? ) I don't think there are any external tools for this.
[QUOTE=Robotboy655;47223489]If the map is huge, it will take a lot of time. ( And possibly crash if it is too big? ) I don't think there are any external tools for this.[/QUOTE] Yeah both maps I've tried are rp_pripyat_fixed and gm_fork, both which I think use the full size of the Hammer grid.
They also have a shitton of geometry to be processed, I think you are just running out of memory for an automatic generation. You may need to do it manually or somehow limit the generation area.
Quick question. Is there a way to get the current map's image for a loading screen with Javascript or PHP?
Is it possible to use steamworks.* clientside or serverside?
[QUOTE=arcaneex;47224325]Is it possible to use steamworks.* clientside or serverside?[/QUOTE] Pretty sure you can't, they're mostly menu state functions.
I know they are but is there any workaround?
[QUOTE=UnderYouFive;47224058]Quick question. Is there a way to get the current map's image for a loading screen with Javascript or PHP?[/QUOTE] Yes, curl. did wrote something simmilar for Exho's eMapVote and for some extend for my Server Hopping Bunny.
[QUOTE=arcaneex;47224350]I know they are but is there any workaround?[/QUOTE] Not without binary modules. The functions are menu state for a reason. You shouldn't mess with them.
Anyone know how to disable npc's dropped stuff? This script doesn't work. [lua] hook.Add("OnNPCKilled","NoDroppedWeapons",function(npc) local wep = npc:GetActiveWeapon() if IsValid(wep) then wep:Remove() end end) [/lua] It wouldn't remove the combine balls that sometimes get dropped anyway.
[QUOTE=thegrb93;47227823]Anyone know how to disable npc's dropped stuff? This script doesn't work. [lua] hook.Add("OnNPCKilled","NoDroppedWeapons",function(npc) local wep = npc:GetActiveWeapon() if IsValid(wep) then wep:Remove() end end) [/lua] It wouldn't remove the combine balls that sometimes get dropped anyway.[/QUOTE] That makes sense, since the NPC's weapon has nothing to do with the ammo dropped, if I'm not mistaken. Problem is, I can't think of a non-hacky way to prevent the ammo drop. Only thing I can think of is to use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/OnEntityCreated]GM/OnEntityCreated[/url], detect whether it was dropped by an NPC's death using some annoyingly convoluted method, and remove it immediately. It's pretty ugly. There's probably a better way.
[lua] hook.Add("OnNPCKilled","NoDroppedWeapons",function(npc) timer.Simple(0, function() for k,v in pairs(ents.GetAll()) do if v:IsWeapon() then if not IsValid(v.Owner) then v:Remove() end elseif v:GetClass()=="item_ammo_ar2_altfire" then v:Remove() end end end) end) [/lua] I guess this works.
How would you string.find an equals sign? I've tried "=", "%=" and "[=]" to no avail
[QUOTE=Exho;47228233]How would you string.find an equals sign? I've tried "=", "%=" and "[=]" to no avail[/QUOTE] Escape with a slash?
[QUOTE=Exho;47228233]How would you string.find an equals sign? I've tried "=", "%=" and "[=]" to no avail[/QUOTE] [lua]print(string.find("gmod = gmod", "="))[/lua] [quote]6 6[/quote] Am I missing something?
[QUOTE=man with hat;47228594][lua]print(string.find("gmod = gmod", "="))[/lua] Am I missing something?[/QUOTE] Works for me too.
Trying to make an entity that does different things depending on math.random when you using it. Got it to work somewhat but when you use it the math.random does it multiple times. [code]function ENT:Use( activator, caller ) local work = math.random(1,10) if work == 1 then print("The result is 1") elseif work == 2 then print("the result is 2") else print("its neither 1 or 2") end return end[/code] It can print everything in the same single use Anyone know what i do wrong?
I could be very wrong, but IIRC, Use gets called as long as the use button is pressed, and since you hold the button for a few ms, it gets ran a few times. I am probably very wrong, though. [editline]n[/editline] Just found this, could be something regarding what I said above. [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetUseType]Entity:SetUseType[/url]
[QUOTE=Author.;47230500]I could be very wrong, but IIRC, Use gets called as long as the use button is pressed, and since you hold the button for a few ms, it gets ran a few times. I am probably very wrong, though. [editline]n[/editline] Just found this, could be something regarding what I said above. [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Entity/SetUseType]Entity:SetUseType[/url][/QUOTE] That worked, thank you so much :)
[img] http://i.imgur.com/nfoiVFj.gif[/img] Trying to make a 3D HUD thing :tinfoil: [lua]hook.Add("PostDrawOpaqueRenderables", "", function() cam.Start3D2D(EyePos() + EyeAngles():Forward() * 10, EyeAngles() + Angle(90,90,90), 0.02) surface.SetDrawColor(255,255,255) surface.DrawRect(0, 0, 100, 200) cam.End3D2D() end )[/lua]
What is the best method of getting an icon onto a hud? Also would I contain the icons in the folder with the code or some where else?
Put the png picture somewhere in materials folder, and do something like this; [lua] local Mat = Material("path_to_image.png") -- want to cache OUTSIDE of loop -- inside HUDPaint hook or whatever surface.SetMaterial( Mat ) -- set the material to what we cached previously surface.SetDrawColor( 255, 255, 255 ) -- white means all colors are the colors in the picture surface.DrawTexturedRect( x, y, w, h ) -- same as surface.DrawRect draw.NoTexture() -- just in case you have anything else in here that can draw a material, very big chance you dont[/lua]
I'm writing a main menu, but I have no idea how to get the loading screen to show up. My panel stays over everything.
How would i go about disabling the gravity on a ragdoll?
Okay, I feel really stupid, but I can't figure out how to use resource.AddFile or resource.AddSingleFile. I've tried it in init.lua as well as in shared, both forward and backward slashes, and I keep getting the same error. My code: [lua]resource.AddSingleFile( "gamemodes\\warbox\\materials\\entities\\wrbx_theft_station.png" ) -- also tried with gamemodes/warbox/etc resource.AddSingleFile( "gamemodes\\warbox\\materials\\entities\\wrbx_spawn_beacon.png" ) resource.AddSingleFile( "gamemodes\\warbox\\materials\\entities\\wrbx_deconstructor.png" )[/lua] The result (ignore any typos): "Downloading file 'gamemodes/warbox/materials/entities/wrbx_theft_station.png' from client NeatNit failed." [url]http://i.gyazo.com/624c9dd41bf5f8ad2106d5ea903009e9.png[/url] Yeah, thanks for the descriptive error... Anyway, what's happening? Is it trying to download a file FROM the client?! The lua files for the entities are in send.txt and they work fine, but from what I could gather pngs don't like being in send.txt. tl;dr: how to send pngs to the client?
[QUOTE=Neat-Nit;47231336] tl;dr: how to send pngs to the client?[/QUOTE] gamemode/warbox/[B]content[/B]/materials is mounted and handled as materials/
-snip-
[QUOTE=Robotboy655;47223489]If the map is huge, it will take a lot of time. ( And possibly crash if it is too big? ) I don't think there are any external tools for this.[/QUOTE] [QUOTE=Adzter;47223477]Is there another external tool that you can use instead of 'nav_generate', I've never successfully generated a navmesh without it completely crashing, tried using both SRCDS and Garry's Mod, left both running for a day until it eventually just completely crashed and Windows gave the 'not responding' message.[/QUOTE] It won't crash.. It may say "Not Responding", do you want to close... but don't confuse this with a crash. The way Windows handles checking if a program is responding or not is by getting a response at the end of every main loop or so. If there is a blocking call, ie the program is working but using 1 thread or doesn't take a break to notify windows then Windows assumes the program is no longer doing anything. This is a poor design choice by both Windows and by how nav-meshes are generated. It took an unknown number of hours to generate rp_evocity_v33x; I let it go and went to bed. Hours later, it was done... [editline]28th February 2015[/editline] [QUOTE=Neat-Nit;47231336]Okay, I feel really stupid, but I can't figure out how to use resource.AddFile or resource.AddSingleFile. tl;dr: how to send pngs to the client?[/QUOTE] FastDL setup and trouble-shooting.. It is possible to have the file download in the entirely wrong directory by using resource.Add[Single]?File incorrectly: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/fastdl_setup_instructions.lua.html[/url] My recursive resource.AddSingleFile Lua file - add it and forget it.. simply add your data to your gamemodes/<gmname>/content/ folder: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_downloads_using_recursive_resource_system.lua.html[/url]
Sorry, you need to Log In to post a reply to this thread.