• Problems That Don't Need Their Own Thread v2.0
    5,020 replies, posted
You can answer this question by testing FastDL in other Source Engine games.
I'm having an issue with creating effects I'm just trying to modify the ejection speed and angles of the brass ejection for the EjectBrass_9mm effect, I've tried SetMagnitude, SetStart, SetRadius. but nothing really works.
[QUOTE=ROFLBURGER;46801874]I'm having an issue with creating effects I'm just trying to modify the ejection speed and angles of the brass ejection for the EjectBrass_9mm effect, I've tried SetMagnitude, SetStart, SetRadius. but nothing really works.[/QUOTE] That's because those effects are not meant to be modified like that, means you just can't.
[QUOTE=Robotboy655;46801945]That's because those effects are not meant to be modified like that, means you just can't.[/QUOTE] well that sucks, weird that they work for viewmodels
[QUOTE=ROFLBURGER;46801948]well that sucks, weird that they work for viewmodels[/QUOTE] I can't get EjectBrass_9mm to work, but according to code, they use SetFlags() for magnitude. Edit: [code] local effectdata = EffectData() effectdata:SetOrigin( pos + angle:Forward() * 50 ) effectdata:SetAngles( angle ) effectdata:SetFlags( math.sin(CurTime() ) * 500 ) util.Effect( "EjectBrass_9mm", effectdata, true )[/code] It works.
Beat to the punch because I started messing with it... With most EjectBrass_ effects, EffectData:SetFlags( int ) sets the initial velocity of the brass. Simple test weapon: [code]AddCSLuaFile( ) SWEP.ViewModel = "models/weapons/c_pistol.mdl" local function EffectArgs( str ) local a, b, c = str:match( "([%w_]*) (%d*) (%d*)" ) return a, tonumber( b ), tonumber( c ) end function SWEP:FireAnimationEvent( pos, ang, ae, eff ) local vm = self.Owner:GetViewModel( ) if ae == 6001 then return true end if ae == 21 then local _, att, arg = EffectArgs( eff ) local _, att = eff:match( "(%S+) (%S+)" ) att = vm:GetAttachment( vm:LookupAttachment( att ) ) att.Ang:RotateAroundAxis( att.Ang:Right( ), 90 ) local e = EffectData( ) e:SetOrigin( att.Pos ) e:SetAngles( att.Ang ) e:SetRadius( 1 ) e:SetMagnitude( 1 ) e:SetFlags( 50 ) e:SetEntity( self ) util.Effect( "EjectBrass_9mm", e ) return true end end[/code]
[QUOTE=Kogitsune;46801997]Beat to the punch because I started messing with it... With most EjectBrass_ effects, EffectData:SetFlags( int ) sets the initial velocity of the brass. Simple test weapon: [code]AddCSLuaFile( ) SWEP.ViewModel = "models/weapons/c_pistol.mdl" local function EffectArgs( str ) local a, b, c = str:match( "([%w_]*) (%d*) (%d*)" ) return a, tonumber( b ), tonumber( c ) end function SWEP:FireAnimationEvent( pos, ang, ae, eff ) local vm = self.Owner:GetViewModel( ) if ae == 6001 then return true end if ae == 21 then local _, att, arg = EffectArgs( eff ) local _, att = eff:match( "(%S+) (%S+)" ) att = vm:GetAttachment( vm:LookupAttachment( att ) ) att.Ang:RotateAroundAxis( att.Ang:Right( ), 90 ) local e = EffectData( ) e:SetOrigin( att.Pos ) e:SetAngles( att.Ang ) e:SetRadius( 1 ) e:SetMagnitude( 1 ) e:SetFlags( 50 ) e:SetEntity( self ) util.Effect( "EjectBrass_9mm", e ) return true end end[/code][/QUOTE] Only CS:S ones do. HL2 ones don't.
[QUOTE=Jvs;46798534]First off, link to the [URL="http://wiki.garrysmod.com/page/Player/SetEyeAngles"]wiki page[/URL], secondly the function takes an angle, not a vector ( guess what vector_origin is? ). If you want to help people like that at least do it properly.[/QUOTE] Whoops, you're right. I made a mistake... angle_zero should've been what I used instead. [editline]27th December 2014[/editline] [QUOTE=Robotboy655;46799323]*SORRY FOR LONG POST* Your lesson for today: ALWAYS INDENT/STRUCTURE YOUR CODE PROPERLY. Here's your code with proper tabulation: [/QUOTE] Also, instead of running 2 checks each elseif just reverse the order... [code]if x > 8000 then elseif x > 7000 then elseif x > 6000 then end [/code] Instead of checking >= 0 && <= 100, etc.... It simplifies logic to reverse the order and check for highest first ( depending on the structure ).
Quick SWEP related question, I had some problems with prediction (on a listen server as a local client) and I fixed them by not running the primary and secondary attack functions unless they were predicted for the first time. What kind of issues could this cause? Sometimes a 2nd or 3rd prediction could occur and suddenly a boolean on my client would be flipped the wrong way around.
I need to bind a few keys and change some client settings when a client types the command setkeybinds, and revert when you type restorekeybinds. Everything that I've tried doesn't seem to work. Bind is blocked from being ran by the server and vice versa. **EDIT** Or hell, from the client via a command. Is there any way to bind/set client stuff from the server? an example is bind mouse2 "+attack;simple_thirdperson_shoulder_toggle";bind n something;nameofarandomvariabletochange 1.
Quick question, can I set a NWInt for a single player in serverside lua?
[QUOTE=Scarface3353;46805917]Quick question, can I set a NWInt for a single player in serverside lua?[/QUOTE] Yeah, IIRC you can only set networked vars on the server
--snip im stupid af
impulse 200 Doesn't seem to like the word 'Game Server'. :suicide:
[vid]http://ss.infd.us/2014/12/2014-12-28_16-32-26.mp4[/vid] Why doesn't the DTextEntry work when it's parented to a DPanel which is unparented, but it works inside a DFrame under the same circumstances? (I can't type in the DTextEntry when it's just in the DPanel but can use cut/copy/paste functions, but in the DFrame it works fine)
DTextEntries need to be parented to an EditablePanel, which DFrame uses but DPanel doesn't
The only way around this would be to either use a DFrame or write my own panel?
you can just use an EditablePanel directly, it's pretty much a DPanel without any extra functions
Thanks, all working now!
Okay, I need some help with RealFrameTime() and all that. I'm trying to have a ball (making Pong) move across the screen at a constant rate across all frame rates so that the game should be playable both when I am not recording (150fps) and recording (30fps). I originally used Lerp for moving it but that isn't going to work anymore because I need to accurately predict where the ball will go for a Bot opponenent. Anways, I need this ball movement code to take frame time into account so it will work right. [code] --local newX = Lerp(difficultySpeed * RealFrameTime(), ballX, ballX + ball.VelocityX) --local newY = Lerp(difficultySpeed * RealFrameTime(), ballY, ballY + ball.VelocityY) local newX = ballX + ball.VelocityX local newY = ballY + ball.VelocityY ball:SetPos( newX, newY ) [/code]
Use OBS ( Open Broadcaster Software ) to record. You don't lose fps, at least I don't... High quality, free, can stream or make local avi... With RealFrameTime or any DeltaTime you don't use Lerp unless you're running multiple calls per frame or something... Basically you define the max speed per second.. max = 50; Then, you use FrameTime( ) * max; or RealFrameTime( ) * max; for the amount of movement that it does for that frame. Simply update the position and done. The RealFrameTime and FrameTime functions return the time it takes from last frame to current frame ( IE Delta Time or Change in Time ) which is a very small number and directly relates to seconds, so the max var is movement per second. After multiplying them together you can change it if you want... If you want to convert from 50 units of space per second to 50 feet you'd multiply by the foot-unit conversion ratio. Hopefully that helps.
How can I make sure the angles are consistent when parenting to the player model? I am trying to parent a custom SENT to the player but depending on how the player is looking the angles get thrown off. Also on a side note does anyone know if jiggle bones will bone-merge to the normal player-model without it spewing out of site? Code: [lua] self:SetMoveType( MOVETYPE_NONE ) local tempvec = caller:GetPos() self:SetPos(tempvec + Vector(0,0,40)) local ang = caller:GetAngles() --local ang = caller:GetManipulateBoneAngles( 3 ) ang:RotateAroundAxis(ang:Right(), 90) ang:RotateAroundAxis(ang:Forward(), -180) ang:RotateAroundAxis(ang:Up(), 180) self:SetAngles( ang ) --self:SetAngles( Angle(120,0,0) ) --self:SetMoveType( MOVETYPE_NONE ) self:SetParent( caller, 3 ) [/lua]
How do i allow mods to physgun world entties with falcos prop protection? Currently i can only select admin and superadmin checkboxes
[QUOTE=SorteSvin;46811298]How do i allow mods to physgun world entties with falcos prop protection? Currently i can only select admin and superadmin checkboxes[/QUOTE] is mod inherited to admin in your admin mod?
The problem is that falcos PP does not and will not pick up ranks from admin mods.
Jump height is higher then normal, gravity is set to default (600) and I don't know what is causing it... I have no idea what's causing it or how to find it, unless I take out each addon 1 by 1, which isn't in my interest... I am running darkRP, are there any idea on what could be causing it?
[QUOTE=Acecool;46810898]Use OBS ( Open Broadcaster Software ) to record. You don't lose fps, at least I don't... High quality, free, can stream or make local avi... With RealFrameTime or any DeltaTime you don't use Lerp unless you're running multiple calls per frame or something... Basically you define the max speed per second.. max = 50; Then, you use FrameTime( ) * max; or RealFrameTime( ) * max; for the amount of movement that it does for that frame. Simply update the position and done. The RealFrameTime and FrameTime functions return the time it takes from last frame to current frame ( IE Delta Time or Change in Time ) which is a very small number and directly relates to seconds, so the max var is movement per second. After multiplying them together you can change it if you want... If you want to convert from 50 units of space per second to 50 feet you'd multiply by the foot-unit conversion ratio. Hopefully that helps.[/QUOTE] My velocity is always either -2 or 2 for the ball, I guess I'll have to increase the number to multiply it. My issue is that if I increase it, the ball won't travel 2 pixels at a time any more and then that would look weird.
[QUOTE=Exho;46811431]My velocity is always either -2 or 2 for the ball, I guess I'll have to increase the number to multiply it. My issue is that if I increase it, the ball won't travel 2 pixels at a time any more and then that would look weird.[/QUOTE] use math.ceil( Velocity * FrameTime( ) ); The lower the number Velocity ( per second ) the slower the calculated value will be. math.ceil will use the current whole-number or step to the next highest whole-number if a fraction of a whole number. Another trick you can use instead of math.ceil is an accumulator variable... Basically your logic should use something like: self.__moveX = self.__moveX + VelocityX * FrameTime( ); self.__moveY = self.__moveY + VelocityY * FrameTime( ); Then, if the value is >= 1 use math.floor on them ( truncate all decimals ) and move that amount, then subtract the amount moved from the accumulator. Then the movement will accumulate until it can move at least 1 pixel and always move using whole-numbers and will never drop a pixel because of decimals which will give a more reliable move-speed. [editline]28th December 2014[/editline] [QUOTE=Bazoogle;46811425]Jump height is higher then normal, gravity is set to default (600) and I don't know what is causing it... I have no idea what's causing it or how to find it, unless I take out each addon 1 by 1, which isn't in my interest... I am running darkRP, are there any idea on what could be causing it?[/QUOTE] All GMA files store Lua in plain text. Do a search for the following using Notepad++ or other file-content searching tool... JumpPower, SetupMove, CreateMove, Move, etc... SetJumpPower is likely to be found. Otherwise it may be altered in one of the other hooks. There may be other things to search for too..
How do I make this HTML Text feel more less jiggly? [t]http://i.imgur.com/r62Wl18.png[/t]
Does anyone know how to change the SWEP values for an individual weapon in realtime in ttt? For instance, I want to be able to switch the IsAutomatic value from true to false and increase the headshot multiplier for a persons weapon they run a bound console command. In order to simulate a selective fire weapon. I don't know where to start though.
Sorry, you need to Log In to post a reply to this thread.