• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
Getting pretty frustrated with this. I'm messing around with RenderView/RenderTarget with Orthographic projection. Has anyone with experience using this had this specific problem: [vid]http://puu.sh/dT6pt.flv[/vid] (The yellow sphere is where the camera position is) I have the RenderView's angles set to reflect mine + Angle(0, 90, 0). Depending on the ortho settings(top/bottom/left/right) it will squish the view to about half of the space I'm looking at. In the video it happens at between 106 and 107. I haven't found that reliable of a pattern related to the exact angles but man is this frustrating. Even more frustrating is the fact that not only did I not have this problem for a long time, it looked much much better. But I had forgotten that GetRenderTarget doesn't update the RenderTarget unless the name provided doesn't already exist -.- So when I exited gmod and came back some changes kicked in.
Hi. I want to make material, that based on two materials, etc. white stripes on black, but I didn't know, how working with materials. Also, how csgo developers make stickers on weapon? Please help:)
[QUOTE=Acecool;46827663]Shootpos is the center of the face.. For you to get the barrel of the world-model you'd need to use GetAttachment / LookupAttachment etc... Take a look at Robots viewer tool ( esp shows all attachpoints )[/QUOTE] Except this was taken from the toolgun code so I don't see why it shouldn't work.
How do I access an entitie's network vars through cl_init? Self:GetVar() is unrecognizable [CODE]attempt to index global 'self' (a nil value) [/CODE]
[QUOTE=RedNinja;46828048]How do I access an entitie's network vars through cl_init? Self:GetVar() is unrecognizable [CODE]attempt to index global 'self' (a nil value) [/CODE][/QUOTE] Replace self with the entity. Self is usually used within metamethod functions.
[QUOTE=ms333;46828088]Replace self with the entity. Self is usually used within metamethod functions.[/QUOTE] What do you mean by entity?
[QUOTE=RedNinja;46828100]What do you mean by entity?[/QUOTE] You just said you wanted an entity's vars. So obviously it's that entity you should use.
[QUOTE=ms333;46828107]You just said you wanted an entity's networked vars. So obviously it's that entity you should use.[/QUOTE] Yeah. Quite obvious, yet how do I access it?
Access what? The entity? You hopefully know which entity you're targeting?
[QUOTE=ms333;46828127]Access what? The entity? You hopefully know which entity you're targeting?[/QUOTE] I'll clear some things. I have this NPC entity. It's mood changes every X seconds. Which means it'll randomly choose if he's currently buying an item, selling it, or both. [LUA] if self:GetWillBuy() and self:GetWillSell() then txt:SetText("I'll buy and sell shrooms.") end if !self:GetWillBuy() and self:GetWillSell() then txt:SetText("I'll only sell shrooms now.") end if self:GetWillBuy() and !self:GetWillSell() then txt:SetText("I'll only buy shrooms. Got any?") end [/LUA] Self is unrecognizable.
[QUOTE=RedNinja;46828136]I'll clear some things. I have this NPC entity. It's mood changes every X seconds. Which means it'll randomly choose if he's currently buying an item, selling it, or both. [LUA] if self:GetWillBuy() and self:GetWillSell() then txt:SetText("I'll buy and sell shrooms.") end if !self:GetWillBuy() and self:GetWillSell() then txt:SetText("I'll only sell shrooms now.") end if self:GetWillBuy() and !self:GetWillSell() then txt:SetText("I'll only buy shrooms. Got any?") end [/LUA] Self is unrecognizable.[/QUOTE] Where the heck are you calling this.
[QUOTE=Commander11;46828143]Where the heck are you calling this.[/QUOTE] Client. Where my derma is.
Self will only be defined if you run the above code in a metamethod function like this: function ENT:DecideMood() as example. If you're running this with a timer, you could create the timer in your enrity 's init function where self is defined as the NPC itself.
[QUOTE=ms333;46828147]Self will only be defined if you run the above code in a metamethod function like this: function ENT:DecideMood() as example. If you're running this with a timer, you could create the timer in your enrity 's init function where self is defined as the NPC itself.[/QUOTE] The timer is in the init. Anyways, if I make it a metamethod, how do i call it? usermessage.Hook( "shroomies", shroomMenu ) is what i have in cl init so far and umsg.Start( "shroomies", activator ) umsg.End( ) in init.
[QUOTE=isnipeu;46827986]Except this was taken from the toolgun code so I don't see why it shouldn't work.[/QUOTE] Lookup the toolgun fire effect. Many entities/effects/ look for the muzzle in the effect code instead of it being set when it gets used. I couldn't find ToolTracer in code, but it does set self.Weapon as the entity. From there is most likely grabs the muzzle.. It may use the shootpos for a trace, or something else... Are you using the toolgun model, or a different one? [editline]31st December 2014[/editline] [QUOTE=RedNinja;46828166]The timer is in the init. Anyways, if I make it a metamethod, how do i call it? usermessage.Hook( "shroomies", shroomMenu ) is what i have in cl init so far and umsg.Start( "shroomies", activator ) umsg.End( ) in init.[/QUOTE] Set up a timer or use ENT:Think to change the mood at random intervals. When mood changes use [code]// Somewhere in server code: util.AddNetworkString( "UpdateNPCMood" ); // Inside of the Initialize for entity: function ENT:Initialize( ) // Declare the function and attach to this entity.. self.TimerDone = function( ) if ( !IsValid( self ) ) then return; end self.Mood = MoonEnumeration; net.Start( "UpdateNPCMood" ); net.WriteEntity( self ); net.WriteInt( MoonEnumeration, 8 ); -- 8 bits is enough to get up to 255 or so net.Broadcast( ); // Have the function call the timer.... unless the entity died.. timer.Simple( math.random( 60, 300 ), self.TimerDone ); end end timer.Simple( math.random( 60, 300 ), TimerDone ); [/code] Have a [code]net.Receive( "UpdateNPCMood", function( _len ) local _ent = net.ReadEntity( ) _ent.Mood = net.ReadInt( 8 ); end ); [/code] on the client and have the client read Mood...
[QUOTE=Acecool;46828412]Lookup the toolgun fire effect. Many entities/effects/ look for the muzzle in the effect code instead of it being set when it gets used. I couldn't find ToolTracer in code, but it does set self.Weapon as the entity. From there is most likely grabs the muzzle.. It may use the shootpos for a trace, or something else... Are you using the toolgun model, or a different one?[/QUOTE] self and self.Weapon are the exact same thing, I did a print to double check that. ToolTracer is an effect set in the base gamemode, and yes I'm using the default toolgun model (look at the video I posted before).
Please nobody use self.Weapon or self.Entity. They have 0 function other than to return the entity you are indexing.
I thought they were deprecated and its better just to use self
[thumb]http://puu.sh/dTTkV/b4c7c5e1d4.jpg[/thumb] I'm trying to add it so you can drag with the left mouse on the map so you can look around it via this in-game map, but I'm stumped on how this is possible. Is anyone able to help me with this? I seriously have no idea how this is done.
Does anyone know the rgb color for serverside printing? I got lucky and found out Color( 255, 255, 100 ) is the clientside color
[QUOTE=Exho;46830175]Does anyone know the rgb color for serverside printing? I got lucky and found out Color( 255, 255, 100 ) is the clientside color[/QUOTE] [B]Edit:[/B] It's the same colour as ErrorNoHalt, as seen below.
[QUOTE=Exho;46830175]Does anyone know the rgb color for serverside printing? I got lucky and found out Color( 255, 255, 100 ) is the clientside color[/QUOTE] print() just prints in white doesn't it? The only other color I'm aware of is the blue that ErrorNoHalt prints in. Color(0, 128, 255) ?
How do I get rid of this REEEED alpha stuff from the texture [t]http://i.imgur.com/lPMfx2B.png[/t] [editline]1st January 2015[/editline] [t]http://i.imgur.com/cPYQIbf.png[/t] Original Gasmask
One, nice texture... idk if you made it but it looks cool. Two, are you asking how to fix the fact that it looks red in-game? Because that just seems weird to me, and with my other textures with transparency I've never seen that happen. [editline]31st December 2014[/editline] Do you have a draw color set, or a variable to set the color of the texture, somewhere? I did a little tinting thing with one of my textures by doing that. If the color is 255, 255, 255, 255 RGBA, it would render without any tint. [sp]Then again, idr if I colored the texture, or I colored something behind the texture to do the tinting... that doesn't change anything, though. Either way, colors will change.[/sp]
[QUOTE=rebel1324;46830598]How do I get rid of this REEEED alpha stuff from the texture [t]http://i.imgur.com/lPMfx2B.png[/t] [editline]1st January 2015[/editline] [t]http://i.imgur.com/cPYQIbf.png[/t] Original Gasmask[/QUOTE] Are you resetting the color to white before drawing the mask?
[QUOTE=Robotboy655;46831117]Are you resetting the color to white before drawing the mask?[/QUOTE] Yes. The color must be white if you're gonna draw something that you don't want colored.
HOLY HELL I'M STUPID
Well anyway, a way to make a good tint is to have the overlay you want at pure white, but before you render it you render a colored box, with low alpha. I used surface. and draw. to do such a thing: [code] local LC = render.GetLightColor( self.Owner:GetShootPos() ) LCL = LerpVector( 0.005, LCL, Vector( LC.r*2.0+0.5, LC.g*2.0+0.5, LC.b*2.0+0.5 ) ) -- Just a simple way to smooth out the lighting when the player moves between areas. This does not adjust based on actual time. local ID = surface.GetTextureID( self.IronScopeName ) -- The name of your overlay surface.SetDrawColor( 128, 120, 96, 96 ) surface.DrawRect( 0, 0, ScrW(), ScrH() ) surface.SetDrawColor( 255, 255, 255, 255 ) local Scope = { texture = ID, color = Color( LCL.x*255, LCL.y*255, LCL.z*255 ), x = ScrW()*0.5-(ScrH()*0.90195), -- My texture was 4096x4096, with a lot of just pure black on the sides. I made it extend past the edges of the game window. It's a little weird that I needed such a specific decimal, but that centers it properly. y = -ScrH()*0.4, w = ScrH()*1.8, h = ScrH()*1.8 } draw.TexturedQuad( Scope )[/code]
The ViewModel can't be drawn over "Refract" Type Material Shader. How do I solve this problem? It seems this type of material draws well on "Overlay" format but I can't find any source of that Overlay. [t]http://i.imgur.com/fR62DRr.jpg[/t]
Do you guys know if it evens possible to download a gma file to your dedicated server without uploading it from your own PC because that just kills my internet...
Sorry, you need to Log In to post a reply to this thread.