Raised This Month: $ Target: $400
 0% 

Screen Shake


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
V0gelz
Senior Member
Join Date: Jun 2004
Old 04-08-2008 , 11:23   Screen Shake
Reply With Quote #1

Ok i'm trying to do this screen shake thing and i saw looked at the fade thing that someone made and i came on the conclusion is this is right.
I looked at http://developer.valvesoftware.com/wiki/Env_shake and i added the right values for the amplitude and the other one but i don't see any movement in my screen, i don't get any error either. I thought i did the right write byte and floats

However i don't get it to work. Can someone take a look at this and tell me whats wrong cuz i'm lost.

Thanks!

Code:
#define Start_Shake 0x0001;

public Shake(amplitude,duration,frequency)
{
	new Handle:hBf=StartMessageAll("Shake");
	if(hBf!=INVALID_HANDLE)
	{
		BfWriteByte(hBf, Start_Shake);
		BfWriteFloat(hBf,amplitude);
		BfWriteFloat(hBf,duration);
		BfWriteFloat(hBf,frequency);
		EndMessage();
	}
}
__________________
V0gelz is offline
Davethegreat
Senior Member
Join Date: Nov 2007
Old 04-08-2008 , 11:52   Re: Screen Shake
Reply With Quote #2

You could try to use a controlled earthquake, this would make everyones screen shake though, I have no idea how you can do it per person i know with a console command earthquake does the same thing, try it.
Davethegreat is offline
Send a message via AIM to Davethegreat
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 04-08-2008 , 12:18   Re: Screen Shake
Reply With Quote #3

I have this in my c++ code:
PHP Code:
             bf->WriteByte);                
            
bf->WriteFloatlocalAmplitude );            // shake magnitude/amplitude
            
bf->WriteFloatfrequency );                // shake noise frequency
            
bf->WriteFloatduration );                // shake lasts this long 
Try using 0 instead of 1 for your Start_Shake.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
V0gelz
Senior Member
Join Date: Jun 2004
Old 04-08-2008 , 12:49   Re: Screen Shake
Reply With Quote #4

Oh thanks it works now. Thanks both of you for helping. It was the start_shake thingy.
__________________
V0gelz is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode