• Problems That Don't Need Their Own Thread v3.0
    5,003 replies, posted
I'm messing around with trying to make a gamemode, and I've created a small bug trying to slap the player for punting a prop, I put a function in init that should do 1 damage every time you punt, and it does but if you punt while holding the prop it does 2 damage per punt Here's the init.lua I have [code] include("cl_init.lua"); include("resources.lua"); DeriveGamemode( "sandbox"); print("init test"); function GM:GravGunPunt(client,entity) DropEntityIfHeld(entity); client:TakeDamage (1,client,client); client:PrintMessage ( HUD_PRINTCENTER , "stop throwing me"); return false; end; [/code]
Does anyone here know if Pointshop 2 uses the same wallet functions as Pointshop 1? And yes Im trying to get hold of Kamshak.
Is it possible to mute the ambient background noise in a map using a script (versus editing the map)
Is Gmod a [I]game-engine[/I] or a [I]game-mod?[/I] At this point, I don't think there is a real answer, but it still bugs me. I'm anxious to hear a response. Forgive me for not asking a lua question. This seemed appropriate because it was a developer question.
[QUOTE=EthanTheGreat;48986848]Is Gmod a [I]game-engine[/I] or a [I]game-mod?[/I] At this point, I don't think there is a real answer, but it still bugs me. I'm anxious to hear a response. Forgive me for not asking a lua question. This seemed appropriate because it was a developer question.[/QUOTE] Garry's mod is a modification of the source ENGINE. It uses the LUA code language to accomplish this. In the past, (think HL1) these were called MODS because it was very rare that a single engine ran more than one game. These times there are game engines that are found in many games, like Unreal 4 or Unity. Your question does interest me...at what point does a modification of a game, (like garry's mode to TTT) become it's own independent game?
Is it possible to cache sounds played by 'sound.PlayURL'? Feels inefficient to continuously fetch the sound instead of caching it somehow, but I'm not sure how to do that.
[QUOTE=Z0mb1n3;48987402]Is it possible to cache sounds played by 'sound.PlayURL'? Feels inefficient to continuously fetch the sound instead of caching it somehow, but I'm not sure how to do that.[/QUOTE] http fetch them, save in data/, load them via playurl [img]http://rp.braxnet.org/scr/1445888277110.png[/img]
[QUOTE=Giraffen93;48987466]http fetch them, save in data/, load them via playurl [img]http://rp.braxnet.org/scr/1445888277110.png[/img][/QUOTE] Well in particular I meant the actual audio channel itself, but I don't suppose I can do that. I just meant that playing the same url over and over with playurl (chat sounds) might just be inefficient. Sure I could make clients download like 200 sounds but I'm not entirely interested in doing that. Unless by playurl you meant playfile, in which case I'm not sure I follow.
[QUOTE=Z0mb1n3;48987550]Well in particular I meant the actual audio channel itself, but I don't suppose I can do that. I just meant that playing the same url over and over with playurl (chat sounds) might just be inefficient. Sure I could make clients download like 200 sounds but I'm not entirely interested in doing that. Unless by playurl you meant playfile, in which case I'm not sure I follow.[/QUOTE] user plays a sound, alerting the server server broadcasts the net message with url client checks if file exists in data/sounds/* if not, download the file and save it in there, then play it if it is, play the file directly from disk i'm using this method for chat sounds
[QUOTE=Giraffen93;48987570]user plays a sound, alerting the server server broadcasts the net message with url client checks if file exists in data/sounds/* if not, download the file and save it in there, then play it if it is, play the file directly from disk i'm using this method for chat sounds[/QUOTE] oh, neat. I didn't know you could play the files even if they had a .txt extension. Thanks!
[QUOTE=Z0mb1n3;48987609]oh, neat. I didn't know you could play the files even if they had a .txt extension. Thanks![/QUOTE] you can name them .dat for better consistency :class:
Ok, is the '3d' option for PlayFile and PlayURL broken? I'm setting volume and position, as well as fade distance, but nothing happens.
[QUOTE=CoreWaffle;48986831]Does anyone here know if Pointshop 2 uses the same wallet functions as Pointshop 1? And yes Im trying to get hold of Kamshak.[/QUOTE] Open a support Ticket or have a look in the documentation.
[QUOTE=Z0mb1n3;48987874]Ok, is the '3d' option for PlayFile and PlayURL broken? I'm setting volume and position, as well as fade distance, but nothing happens.[/QUOTE] check the error argument, 3d should work
[QUOTE=Giraffen93;48988025]check the error argument, 3d should work[/QUOTE] It's giving me BASS_ERROR_UNKNOWN (-1) for every error.
I have no idea what is wrong here but on my DarkRP server ULX is acting wonky. First off this random group appeared with the main groups called "noaccess" [url]http://imgur.com/b8MMakW[/url] Then whenever I try to make a group inherit another it always goes back to "user" instantly [url]http://imgur.com/g6jzFHk[/url] This is with ALL NON MAIN GROUPS. Aka my custom vip groups. Any ideas?
Does anyone know if there's a way of stopping the screen from shaking when you hit the ground hard?
[QUOTE=Rutabaga;48988890]I have no idea what is wrong here but on my DarkRP server ULX is acting wonky. First off this random group appeared with the main groups called "noaccess" [url]http://imgur.com/b8MMakW[/url] Then whenever I try to make a group inherit another it always goes back to "user" instantly [url]http://imgur.com/g6jzFHk[/url] This is with ALL NON MAIN GROUPS. Aka my custom vip groups. Any ideas?[/QUOTE] I think that could be an exploit. Check if anyone is in that usergroup?
[QUOTE=BillyOnWiiU;48989681]Does anyone know if there's a way of stopping the screen from shaking when you hit the ground hard?[/QUOTE] Return true in GM:OnPlayerHitGround
[QUOTE=Kogitsune;48990088]Return true in GM:OnPlayerHitGround[/QUOTE] Thanks (can't rate)
[QUOTE=Kogitsune;48984993][code] value = math.max( 0, value - RealFrameTime( ) / seconds_to_take ) if value == 0 then value = max end [/code] Something like that would be the simplest way.[/QUOTE] What if I wanted to add 1 to the number instead? I tried [CODE] value = math.min( max, value + RealFrameTime() / 1 ) -- I want it to take a second if value == max then value = 0 end [/CODE] But it went really slow and took more than a second. [editline]27th October 2015[/editline] Also, here's another question- Say I have two Lua files. One file has a couple of functions in it (preferably local functions) and the other file needs to use these functions. Would it be possible to do this without using global variables? I thought about creating a module, but I'd rather not have a global module for other scripts to use as this seems to me to be as bad as using global variables. Is there a way to do this? I just don't want to have big functions in one file since I like code being spaced out.
Hey guys, I'm new to GMod modding ! What I need my script to do is spawn a prop then watch when a player "uses" it (press the use button when looking at it). Right now I'm spawning an entity with the class gmod_button and a model then use the PlayerUse hook to check if the entity used by the player is my prop. Am I doing this right ? I'd also like to be able to freeze the prop so that nobody can move it, but couldn't find a way to do that (is there a way to set the ownership to the map? Will that help?) Those are probably stupid questions so I think it's best to post them here, I couldn't find an answer on the web (probably not using proper keywords). Thanks !
[QUOTE=Niverton;48992801]Hey guys, I'm new to GMod modding ! What I need my script to do is spawn a prop then watch when a player "uses" it (press the use button when looking at it). Right now I'm spawning an entity with the class gmod_button and a model then use the PlayerUse hook to check if the entity used by the player is my prop. Am I doing this right ? I'd also like to be able to freeze the prop so that nobody can move it, but couldn't find a way to do that (is there a way to set the ownership to the map? Will that help?) Those are probably stupid questions so I think it's best to post them here, I couldn't find an answer on the web (probably not using proper keywords). Thanks ![/QUOTE] You should use [URL="http://wiki.garrysmod.com/page/ENTITY/Use"]ENTITY:Use[/URL] and you can try using [URL="http://wiki.garrysmod.com/page/constraint/Weld"]constraint.Weld[/URL] to weld the entity to the world with a forcelimit of 0.
Thanks for your help ! To use the ENTITY:Use() method, I just have to do this, right ? [CODE]local entity = ents.Create(<class>) entity:Use = function(activator, caller, useType, value) --Use end[/CODE]
:snip: I'm an idiot
[QUOTE=Rutabaga;48988890]I have no idea what is wrong here but on my DarkRP server ULX is acting wonky. First off this random group appeared with the main groups called "noaccess" [url]http://imgur.com/b8MMakW[/url] Then whenever I try to make a group inherit another it always goes back to "user" instantly [url]http://imgur.com/g6jzFHk[/url] This is with ALL NON MAIN GROUPS. Aka my custom vip groups. Any ideas?[/QUOTE] The noaccess group comes from FAdmin and is now shared to ULX via CAMI. Im not sure about your second problem but it also sounds like it could be caused by CAMI.
[del]So is there actually a way to remove the scrollbars from DHTML panels, and maybe size them to their contents? I've tried using the 'overflow' property, but to no avail.[/del] Ok, is there a way to retrieve the width and height of the contents of an HTML panel?
What can cause a file like "lua/autorun/something_example.lua" to run fine in single player but not run in a multiplayer/online server? I used "AddCSLuaFile()" in a combination of ways but non seem to be fixing it. Is there anything else I can check?
Is there a reason this does not work? Inside the init of an html panel, I have [code] self:AddFunction("prop", "realwidth", function(str) self:SetRealWidth(tonumber(str)) print(self:GetRealWidth()) end) [/code] and when I run the javascript function, it works fine, but if I try to print that value any other time, it doesn't exist, example: I run the javascript, and the callback prints the value. I use the accessor function I created and try printing the value of RealWidth and it returns nil. Is it asynchronous and I'm being dumb? [editline]28th October 2015[/editline] Yes I guess it is asynchronous, sorry.
Is there a hook that is called, when C4 gets disarmed?
Sorry, you need to Log In to post a reply to this thread.