Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Xegethra

Playing sound on button press.

Recommended Posts

I looked up ways to do this, and the KEYCONF method seems the one to go for. I am using Doom 2 in UDMF in GZDoom Builder.

So the KEYCONF works, I have some previous scripts in the WAD that display text when you run into new areas of the map and I assigned one of them to the KEYCONF and it displayed the text on the button prompt. However, it while it activates those scripts, I can't get it to activate the script that calls for a sound to play, the whole reason I made it for. The problem is in my script I think, but I don't know why. This is the first time I have used custom sounds in this manner.

script 21 (void) net   *net is there because it is a multiplayer map*
{
 PlaySound (0, "BurpFart/BNOISE");
}

It doesn't work, I had even tried it with Activator Sound and tried using various ways of writing down the sound information there but they all come up with the same results which is, no sound.

Share this post


Link to post

I suspect that a NET script doesn't technically have an activator, so that the 0 in PlaySound doesn't refer to the player who activated it. In your text-displaying scripts, you're probably using PrintBold (as per the Zandronum wiki example), which generally displays texts to all players (but the mere nature of a NET script might restrict its effect to a single player anyway), whereas Print would display text just to the script's activator. See what happens if you change PrintBold in your scripts to just Print - if the scripts no longer display anything for you, then this is the problem.

Edited by scifista42

Share this post


Link to post

Well, it appears to have HUDMessage instead.

vQSS8.png

While playing, the message only displays for the person walking over the line which is what I want as they are the ones crossing into the district. I figured I would use that script with KEYCONF as a test to see if KEYCONF works.

So, the print and print bold can be used with playing sounds too then? Or are those scripts interfering with the sound one?

I might have misunderstood net, I got the impression that CCMDs were considered cheats, and so the puke would also be thought of as that. And I thought net would get it to work. I tried it in both offline and online, if offline the text showed up, the KEYCONF worked. But in online it didn't work, with or without net.

As far as the sound script goes, I haven't gotten that to work, online, offline, net or no net.

*Edit*

Wait no....it works, the sound plays in online and offline now. All I did was tell the KEYCONF to use the text script as if I was testing again. Then I told it to use the sound script again...and now, it works?

I'm even more confused, what had changed? I have changed, no code.

vQUbe.png
vQUcs.png
vQUlp.png
*Immature I know, but GTA >_>*

Edited by Xegethra

Share this post


Link to post

^ That HudMessage is not in a NET script, so it doesn't say anything about whether NET scripts have an activator or not. Anyway, if NET scripts indeed don't consider the player to be their activator, you can't refer to the player via tag 0 in any function called within the script. That's what I meant to say, not that Print can play sounds (it can't) or that it interferes with playing sounds (it can't either) or whatever you thought I was saying.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×