Jump to content
Sign in to follow this  
bigpickle

1st Person & 3rd person Idea Help Needed

Recommended Posts

Hi, I'm currently building a sound mod, I would like to have a script to distinguish between 1st & 3rd person camera as I would like to have a different sound specifically for each view.

Is any one able to write a basic script for me? or advise me on how to do this?

Share this post


Link to post
Share on other sites
Hi, I'm currently building a sound mod, I would like to have a script to distinguish between 1st & 3rd person camera as I would like to have a different sound specifically for each view.

Is any one able to write a basic script for me? or advise me on how to do this?

cameraView

Share this post


Link to post
Share on other sites

Hey Sarge46, thanks for the pointer, I'm not sure how to proceed with the info. I've tried inserting it straight into my cfg patches but it didn't work.

class EBR_base_F : Rifle_Long_Base_F  
{
	drySound[] = {"\SpeedOfSoundAlpha_ebr\Dry",1,1,20};
	reloadMagazineSound[] = {"\SpeedOfSoundAlpha_ebr\Reload",1,1,20};

	class Single: Mode_SemiAuto
	{			
                       if (cameraOn == _player && cameraView == "INTERNAL") then
                { 
		begin1[] = {"SpeedOfSoundAlpha_ebr\ebr",1,1,600};
		soundBegin[] = {"begin1",1};
                       };

		if (cameraOn == _player && cameraView == "EXTERNAL") then
                { 
		begin1[] = {"SpeedOfSoundAlpha_ebr\test1",1,1,600};
		soundBegin[] = {"begin1",1};	
                       };			
         };
};

Can you explain how I implement it, i don't have the scripting knowledge to realize my idea.

Share this post


Link to post
Share on other sites

class EBR_base_F : Rifle_Long_Base_F  
{
	drySound[] = {"\SpeedOfSoundAlpha_ebr\Dry",1,1,20};
	reloadMagazineSound[] = {"\SpeedOfSoundAlpha_ebr\Reload",1,1,20};

	class Single: Mode_SemiAuto
	{			
                       if (cameraOn == player && cameraView == "INTERNAL") then
                { 
		begin1[] = {"SpeedOfSoundAlpha_ebr\ebr",1,1,600};
		soundBegin[] ={begin1,1};
                       };

		if (cameraOn == player && cameraView == "EXTERNAL") then
                { 
		begin1[] = {"SpeedOfSoundAlpha_ebr\test1",1,1,600};
		soundBegin[] = {begin1,1};	
                       };			
         };
};

Try that?

Share this post


Link to post
Share on other sites

are configs updatable in real time like this? i thought they are loaded as static data when the game starts. i'm not a programmer but experience tells me that this won't work. i would be very happy if someone would prove me wrong on this though because it would open a whole new world of possibilities for myself too.;)

Share this post


Link to post
Share on other sites
class EBR_base_F : Rifle_Long_Base_F  
{
	drySound[] = {"\SpeedOfSoundAlpha_ebr\Dry",1,1,20};
	reloadMagazineSound[] = {"\SpeedOfSoundAlpha_ebr\Reload",1,1,20};

	class Single: Mode_SemiAuto
	{			
                       if (cameraOn == player && cameraView == "INTERNAL") then
                { 
		begin1[] = {"SpeedOfSoundAlpha_ebr\ebr",1,1,600};
		soundBegin[] ={begin1,1};
                       };

		if (cameraOn == player && cameraView == "EXTERNAL") then
                { 
		begin1[] = {"SpeedOfSoundAlpha_ebr\test1",1,1,600};
		soundBegin[] = {begin1,1};	
                       };			
         };
};

Try that?

Nah it don't work i get an error when it try to binarize it because of using the word "if" anyway.

Share this post


Link to post
Share on other sites

Any update on this? I would like to know as well whether it is possible to distinquish between 3rd person and 1st person.

Share this post


Link to post
Share on other sites

you cannot insert scripting like that into configs - not doable in the engine

Share this post


Link to post
Share on other sites

I dont know if this works for gun sounds, but for vehicles it is standard practice to have 2 sounds defined.

	class NoiseInt{sound[]={"A3\sounds_f\vehicles\armor\noises\noise_tank_int_1",0.56234133,1};
	frequency="1";
	volume="(1-camPos)*(angVelocity max 0.04)*(speed factor[4, 25])";
	};
	class NoiseExt{sound[]={"A3\sounds_f\vehicles\armor\noises\noise_tank_ext_1",0.79432821,1,150};
	frequency="1";
	volume="camPos*(angVelocity max 0.04)*(speed factor[4, 25])";
	};

because of the camPos multiplier the Interior sound has 0 volume when in exterior view, and vice versa.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×