ZScript allow casting of Name to Sound

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

RaveYard
Posts: 186
Joined: Fri Apr 12, 2013 10:51 am

ZScript allow casting of Name to Sound

Post by RaveYard »

I know it's a minor thing, but it took me a while to figure out.

This:

Code: Select all

Name soundName = 'keen/pain'
String str = soundName;
A_PlaySound(Sound(str));
Would be better like this:

Code: Select all

Name soundName = 'keen/pain'
A_PlaySound(soundName);
(Yes, in this case I can write the name directly, but in my specific case I have a static function called from ACS which plays a sound)
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: ZScript allow casting of Name to Sound

Post by Blue Shadow »

RaveYard wrote:in my specific case I have a static function called from ACS which plays a sound
Why not just call [wiki=PlaySound]the ACS version[/wiki]?
Post Reply

Return to “Feature Suggestions [GZDoom]”