• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
[QUOTE=CoreBase;45961607]So how come does this still allows players to change the convar. [CODE]CreateConVar("vat_procentage", 0, {FCVAR_SERVER_CAN_EXECUTE, FCVAR_NOTIFY}, "Sets vat" )[/CODE] This thing should've stopped it from allowing that [CODE]FCVAR_SERVER_CAN_EXECUTE[/CODE] [editline]12th September 2014[/editline] Anyone?[/QUOTE] why not use a variable?
I'm gonna make my own thread for my problem, I guess...
Can you concatenate binary data like you can a string or will it break? I know you cannot print binary data like a string, but I didn't want to have to append a file more than once unless I have to. Edit: Nevermind, I read the Lua Pil. You can store it in a string so why not be able to concatenate.
[QUOTE=DanielHershey;45962443]why not use a variable?[/QUOTE]I'm using a dnumslider just plain out easier for what I want. But I solved it by putting it serverside instead of having it in shared.
I was looking at a World of Tanks stream the other night and I was wondering if I could possibly somehow grab the velocity of the player's aim speed (ie how fast is the player turning) with a command or something else. [QUOTE=syl0r;45958607]@ROFLBURGER: Just use [URL="http://wiki.garrysmod.com/page/math/rad"]math.rad[/URL][/QUOTE] Yeah I was basically doing that. I was just confused to where the rad conversion goes I solved it.
What's the difference between something like mesh.Begin/mesh.Quad, and using an IMesh?
Turns out my problem isn't as bad as I thought. Thank god...
[QUOTE=Revenge282;45963295]What's the difference between something like mesh.Begin/mesh.Quad, and using an IMesh?[/QUOTE] imeshes are static and cheaper
[QUOTE=PortalGod;45966644]imeshes are static and cheaper[/QUOTE] How can I color an IMesh the same way I could with mesh.Begin/mesh.Quad? Am I missing something obvious?
[QUOTE=zeaga;45967155]How can I color an IMesh the same way I could with mesh.Begin/mesh.Quad? Am I missing something obvious?[/QUOTE] [url]http://wiki.garrysmod.com/page/Structures/MeshVertex[/url] color each vertex, or I think [url]http://wiki.garrysmod.com/page/render/SetColorModulation[/url] before you draw it, and reset it after
[QUOTE=PortalGod;45967168][url]http://wiki.garrysmod.com/page/Structures/MeshVertex[/url] color each vertex, or I think [url]http://wiki.garrysmod.com/page/render/SetColorModulation[/url] before you draw it, and reset it after[/QUOTE] How about lighting? Is that just dependent on a VertexLitGeneric material and normals? And what is the best/easiest way for figuring out normals in a MeshVertex?
[QUOTE=Revenge282;45967254]How about lighting? Is that just dependent on a VertexLitGeneric material and normals? And what is the best/easiest way for figuring out normals in a MeshVertex?[/QUOTE] yeah, if you use vertexlitgeneric textures the mesh will be lit (although I've had problems on gm_construct with it for some reason), but vertexlitgeneric doesn't have support for $vertexcolor I've tried asking for a new shader based off of vertexlitgeneric that has it, but I don't think I ever heard anything back as for normals, I've only ever had to deal with cube-shaped meshes where normals are easy to get, but I know cross products are what you'd use (although I have no idea how to use them :v:)
[QUOTE=PortalGod;45967477]yeah, if you use vertexlitgeneric textures the mesh will be lit (although I've had problems on gm_construct with it for some reason), but vertexlitgeneric doesn't have support for $vertexcolor I've tried asking for a new shader based off of vertexlitgeneric that has it, but I don't think I ever heard anything back as for normals, I've only ever had to deal with cube-shaped meshes where normals are easy to get, but I know cross products are what you'd use (although I have no idea how to use them :v:)[/QUOTE] I just started playing with them for the first time today, and I have my material on a IMesh, just a simple one-sided rectangle. Translucents like to render in front of it (doing this in ENT:Draw), but it has gone much better than I expected so far. The way I understand normals are perpendicular from the face of the object. But if this Mesh is going to be parented to something, how would that work. Or since it is moving, should it be done with the mesh library instead of an IMesh?
[QUOTE=PortalGod;45967168][url]http://wiki.garrysmod.com/page/Structures/MeshVertex[/url] color each vertex, or I think [url]http://wiki.garrysmod.com/page/render/SetColorModulation[/url] before you draw it, and reset it after[/QUOTE] [url=http://wiki.garrysmod.com/page/render/SetColorModulation]render.SetColorModulation[/url] only works with Entity:DrawModel IIRC. But it makes a call equivalent to IMaterial:SetVector ("$color", ...) internally, which you can do manually.
Does anyone by chance have a copy of the gmsv_furryfinder_linux.dll for the current version of Garry's Mod? I can't find copy as most links for it seem to be dead which is a shame.
I wanted to ask, how would I go about replacing a entity that exists within a gamemode? I've tried the way TTT does it and this does not seem to work. Edit: So it appears that it doesn't work cause the system first spawns a prop_weapon then changes it's class to the entity then spawns it. I do not know how to replace a entity like that
-snip, posting to darkrp help thread instead-
Which gamemode hooks need to be manually called when overriding GM:PlayerSpawn?
If I have a trigger_multiple on my map how would I detect StartTouch and EndTouch from an outside lua file. Preferably WITHOUT using lua_run entity because from my experience with that entity it corrupts the .vmf.
There's no straightforward way to do it as far as I am aware. Put this in lua/entities/info_output_hook.lua [code]DEFINE_BASECLASS( "base_point" ) ENT.Hooks = { } local this, meta, hooks, fmt hooks = { } meta = FindMetaTable( "Entity" ) fmt = "%s __this,%s" function meta:HookOutput( name, uid, func ) if not IsValid( this ) then this = ents.Create( "info_output_hook" ) this:SetName( "__this" ) this:Spawn( ) end hooks[ self ] = hooks[ ent ] or { } hooks[ self ][ name ] = hooks[ self ][ name ] or { } hooks[ self ][ name ][ uid ] = func self:Fire( "AddOutput", fmt:format( name, name ), 0 ) end function meta:UnhookOutput( name, uid ) if not IsValid( this ) then this = ents.Create( "info_output_hook" ) this:SetName( "__this" ) this:Spawn( ) end hooks[ self ] = hooks[ ent ] or { } hooks[ self ][ name ] = hooks[ self ][ name ] or { } hooks[ self ][ name ][ uid ] = nil end function ENT:Initialize( ) hook.Add( "EntityRemoved", self, self.EntityRemoved ) end function ENT:AcceptInput( name, activator, caller, data ) local k, v, ok, err if hooks[ caller ] then if hooks[ caller ][ name ] then for k, v in pairs( hooks[ caller ][ name ] ) do if IsValid( k ) then ok, err = pcall( v, k, caller, activator, data ) else ok, err = pcall( v, caller, activator, data ) end if not ok then ErrorNoHalt( "Moonhook failed: " .. name .. "::" .. k .. " - " .. err .. "\n" ) end end end end return true end function ENT:EntityRemoved( e ) if not IsValid( self ) then this = ents.Create( "info_output_hook" ) this:SetName( "__this" ) this:Spawn( ) hook.Add( "EntityRemoved", this, this.EntityRemoved ) end end[/code] And then do this after entities have spawned: [code] local e = ents.FindByName( "your brush name" )[ 1 ] e:HookOutput( "StartTouch", "blah", function( ent, caller, activator, data ) end ) e:HookOutput( "EndTouch", "blah2", function( ... ) end ) [/code] I'd hope there's a better way, but this is how I do it.
Uh... heh, how do I calculate a perfect bounce using normal vectors? Example: Rubber ball hits a flat wall, how do I figure out the direction it travels after the bounce (I can't do what the SENT Ball does)
having an issue with sound.PlayFile(). I created an entity to play a sound using it, tested and it worked. The I copied the entity, renamed (changed the name in shared.lua, too), and changed the sound. i did this to expand 1 entity to 4 different entities with the same code, different sound. For some reason, only the first entity works and plays the sound, the others spit out an error saying that the IGModAudioChannel argument in the callback is a nil value. What do I do?
Any reason why the minimap code is causing a grey screen? [url]http://prntscr.com/4ml6ia[/url] [lua] local CamData = {} CamData.angles = Angle(90,LocalPlayer():EyeAngles().yaw,0) CamData.origin = LocalPlayer():GetPos()+Vector(0,0,1000) CamData.x = 0 CamData.y = 0 CamData.w = 200 CamData.h = 200 CamData.drawhud = false CamData.drawviewmodel = false CamData.dopostprocess = false render.RenderView( CamData ) [/lua]
Is there an easy way to look up viewmodel enumerations?
[QUOTE=ROFLBURGER;45974483]Is there an easy way to look up viewmodel enumerations?[/QUOTE] If you mean the list of activities they have, then something like [code]function GetActivities( ent ) local k, v, t t = { } for k, v in ipairs( ent:GetSequenceList( ) ) do table.insert( t, { id = k, act = ent:GetSequenceActivity( k ), actname = ent:GetSequenceActivityName( k ) } ) end return t end[/code] If that's not what you meant, you'll need to clarify.
[QUOTE=PortalGod;45967477]yeah, if you use vertexlitgeneric textures the mesh will be lit (although I've had problems on gm_construct with it for some reason), but vertexlitgeneric doesn't have support for $vertexcolor I've tried asking for a new shader based off of vertexlitgeneric that has it, but I don't think I ever heard anything back as for normals, I've only ever had to deal with cube-shaped meshes where normals are easy to get, but I know cross products are what you'd use (although I have no idea how to use them :v:)[/QUOTE] So I fixed the mesh material being drawn behind translucent materials by adding alphatest to the material (also vertexlitgeneric). I am still trying to play around and see if I can get lighting on it, but the only thing I am ending up with is a just a fullbright material. Is there any way to get proper lighting on just a simple rectangular mesh (mesh.QuadEasy)? [t]http://puu.sh/byly3/0982b4a89e.png[/t]
[QUOTE=WalkingZombie;45973137]Uh... heh, how do I calculate a perfect bounce using normal vectors? Example: Rubber ball hits a flat wall, how do I figure out the direction it travels after the bounce (I can't do what the SENT Ball does)[/QUOTE] Get the surface's normal and reflect the ball's velocity where the velocity vector has to be mirrored on the surface's normal.
[QUOTE=HumbleTH;45969714]Which gamemode hooks need to be manually called when overriding GM:PlayerSpawn?[/QUOTE] Anyone?
[QUOTE=HumbleTH;45976912]Anyone?[/QUOTE] What does your question mean?
[QUOTE=Willox;45976919]What does your question mean?[/QUOTE] When overriding PlayerSpawn, some hooks you need to call manually for them to work. I know one of the is PlayerSetModel, not sure about the other ones though.
Sorry, you need to Log In to post a reply to this thread.