Raised This Month: $ Target: $400
 0% 

How to emit sound without entity?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-24-2010 , 20:33   How to emit sound without entity?
Reply With Quote #1

Tried to find out about svc_sound, but i failed.

I want to emit a sound at position xyz, but without spawning an entity there. Help pls
__________________
Voi is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-24-2010 , 20:51   Re: How to emit sound without entity?
Reply With Quote #2

emit_sound
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-24-2010 , 20:55   Re: How to emit sound without entity?
Reply With Quote #3

Oh really ?

emit_sound will not work for me cause I would need an entity there to emit it. As I said, i've got an origin and I wanted to play a sound from there without spawning additional entity to use it for emiting_sound.

To your information I would be playing sound only once in given origin.
__________________
Voi is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-24-2010 , 21:00   Re: How to emit sound without entity?
Reply With Quote #4

Why can't you use an entity?
__________________
fysiks is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-24-2010 , 21:17   Re: How to emit sound without entity?
Reply With Quote #5

Because the function itseft is already cpu intensive and I wanted to avoid spawning additional entities, cause it *may* lead to a server crash.
If thats impossible, I would just have to leave it as it is - spawning entity, emiting sound and instantly removing it.
__________________
Voi is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-24-2010 , 23:02   Re: How to emit sound without entity?
Reply With Quote #6

The counter-strike engine can handle a ridiculous amount of function calls and operations at one time. Don't let people's whining about optimization and cpu intensity affect your opinion on the engine's capabilities.

Servers have thousands of lines of code being executed every frame on things like PreThink and constant function calls. Things like LJ stats and BlockMaker do virtually all of their (virtual) physical calculations and checks on PreThink and PostThink.

Don't worry about optimization and cpu intensity when you're creating something. Optimizations should come after you reach your objective.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-25-2010 , 01:04   Re: How to emit sound without entity?
Reply With Quote #7

Use EngFunc_EmitAmbientSound with entity = 0

Code:
EngFunc_EmitAmbientSound, // void ) (edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-25-2010 , 01:04   Re: How to emit sound without entity?
Reply With Quote #8

Ok, thanks.
__________________
Voi is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-25-2010 , 01:31   Re: How to emit sound without entity?
Reply With Quote #9

Oh damn. I didnt saw there was position param there.

Im trying it now
__________________
Voi 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 05:22.


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