Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Eric the Sandvich

Another quick and simple DECORATE help

Recommended Posts

So I made some more things into my WAD and now I make a computer monitor. My way is that the monitor is always "alert" (When a monster growls when it's not attacking) and plays a computer sound.

 

Thing is I don't want you to walk into a room full of computers and get blasted by noise, realistically you would hear the computer room before you go in it.

 

I looked at the zDoom wiki and I don't see a flag that makes the actor always alert (before the actor even notices the player, alert at the start of the map)

 

Can you help me?

Share this post


Link to post

If you are mapping for ZDoom, maybe an Ambient Sound will be a better choice.

 

Otherwise, you could use a sound tunnel or the joined-sector trick that people use to wake monsters for teleport traps.

Share this post


Link to post

It seems redundant to have your actor rely on monster-AI-specific behavior just to play a sound. I suggest to simply play the sound in the actor's (looped) spawn state.

Share this post


Link to post

Using A_PlaySound in the idle state of the actor should do it. It won't be "active" but the sound will play as long as the idle state loops (same goes for the attacking states).

Share this post


Link to post

Thanks for the tips (Don't know how I'm this stupid), but the soundfile for the computer idle is atleast 3 seconds, it gets cut off by it's own sound in idle and when it dies (I gave it a death sequence) the sound keeps playing until it ends, not being cutoff by it's deathsound.

 

Do i have to play these sounds over specific channels or should I shorten the file to be a few tics long?

 

(Thank you scifista42, you've been helpful to me over some posts :))

Share this post


Link to post

Simply increase the number of tics of the idle frames, such as from 5 to 110

COMP ABABABABAB 110 A_PlaySound("idle",7)

Death:
COMP A 20 A_StopSound(7)
COMP B 20 A_PlaySound("death")
COMP C 20 


3 seconds is roughly 3x35 tics.

I set "idle" to play on channel 7. In Death, I call A_StopSound to stop all sounds playing on channel 7, which means "idle" stop playing.

Edited by Voros

Share this post


Link to post

Before going into detail, let's just recap what I understood from your post:

 

-You want the sound to repeat with a lesser period than the sound's length without cutting itself off.

-You want the sound to be cut off when the actor dies.

 

Do I get it right? Are these the requirements that must be met to achieve your goal, or are the requirements / the goal different, even if just slightly so?

Share this post


Link to post

The sound must repeat in anyway, shape, or form without cutting itself off while also cutting itself off when the actor dies. Just to let you know that this actor also has a custom XDeath (gibbed death) that uses A_Playsound (a_playsound ("thing") <- just like that), so that as well).

 

It's 4:14 AM here, been up all day and my mind is hazy so if you do this for me I'll reward you with a little story.

Share this post


Link to post

The sound must repeat in anyway, shape, or form without cutting itself off while also cutting itself off when the actor dies


Then what I posted is what you want to achieve.

Share this post


Link to post

It didn't work.

 

But you know what? I'm fucking tired, I've spent way too long on something that should be coded in with just a few characters.

 

I settle with a 60hz fluorescent hum. 

Share this post


Link to post
9 minutes ago, Eric the Sandvich said:

It didn't work.

How did it not work?

 

No sound played? The words "idle" and "death" in Voros's script are placeholder names that need to be replaced by your sound's logical names as defined in your SNDINFO.

 

Sound didn't loop? The first line in Voros's script should be preceded by "Spawn:" label and followed by "Goto Spawn" or "Loop" command.

 

The sound still cut itself off? Make the delays between calling A_PlaySound even longer.

Share this post


Link to post

Apparently I made that comment when Voros didn't edit his post to correct himself, I used his original post and it didn't work.

 

Luckily I have chrome notifying me of everything about Doomworld else you would not have heard a response from me.

 

THE ENTIRE FUCKING THING WORKS NOW

 

 

 

Too tired to tell a story though

Share this post


Link to post

The code I posted assumed that you are familiar enough with DECORATE to figure out what parts the code meant :P glad it worked out for you in the end.

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
×