SpawnShot DeathSound doesn't override original DeathSound

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Death Egg
Posts: 198
Joined: Tue Aug 14, 2012 10:16 pm

SpawnShot DeathSound doesn't override original DeathSound

Post by Death Egg »

So I've got a special version of the SpawnShot for the project I'm working on. Right now the code looks like this:

Code: Select all

actor MySpawnShot : SpawnShot replaces SpawnShot
{
	SeeSound "new/sight"
	DeathSound "new/death"
	DropItem "SpecializedDropActor"
	States
	{
	Spawn:
		BOSF A 3
		BOSF BCD 3 A_SpawnFly
		Loop
	}
}
I wanted to replace both the sound when it's spawned and the sound when it hits the ground (DeathSound, I presume) However, while the sight sound gets replaced in-game, the death sound doesn't. SpawnShot seems already like a very specialized actor for what it does, so I don't know if there's a better way of handling this.
User avatar
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: SpawnShot DeathSound doesn't override original DeathSoun

Post by Dan_The_Noob »

maybe check your SNDINFO is correct, because this code seems ok.
User avatar
Death Egg
Posts: 198
Joined: Tue Aug 14, 2012 10:16 pm

Re: SpawnShot DeathSound doesn't override original DeathSoun

Post by Death Egg »

Dan_The_Noob wrote:maybe check your SNDINFO is correct, because this code seems ok.
The SNDINFO is as follows: (roughly)

Code: Select all

new/death           dssound // assume it's a sound that definitely exists in the files
User avatar
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: SpawnShot DeathSound doesn't override original DeathSoun

Post by Dan_The_Noob »

maybe jus create a dummy death state to see if that fixes it?
User avatar
Death Egg
Posts: 198
Joined: Tue Aug 14, 2012 10:16 pm

Re: SpawnShot DeathSound doesn't override original DeathSoun

Post by Death Egg »

Dan_The_Noob wrote:maybe jus create a dummy death state to see if that fixes it?
No dice. Still plays the teleportation sound effect. I've also tried before to add animations or things to the SpawnShot's death, and it ignores anything I put in it anyway.
User avatar
Dan_The_Noob
Posts: 880
Joined: Tue May 07, 2019 12:24 pm
Graphics Processor: nVidia with Vulkan support
Contact:

Re: SpawnShot DeathSound doesn't override original DeathSoun

Post by Dan_The_Noob »

Death Egg wrote:
Dan_The_Noob wrote:maybe jus create a dummy death state to see if that fixes it?
No dice. Still plays the teleportation sound effect. I've also tried before to add animations or things to the SpawnShot's death, and it ignores anything I put in it anyway.
the teleport effect is likely from the A_SpawnFly thing in SpawnShot.

probably easier to make your own spawn function in the death state OR make a custom FogActor for it to use instead of the teleport one.
User avatar
Death Egg
Posts: 198
Joined: Tue Aug 14, 2012 10:16 pm

Re: SpawnShot DeathSound doesn't override original DeathSoun

Post by Death Egg »

Dan_The_Noob wrote:
Death Egg wrote:
Dan_The_Noob wrote:maybe jus create a dummy death state to see if that fixes it?
No dice. Still plays the teleportation sound effect. I've also tried before to add animations or things to the SpawnShot's death, and it ignores anything I put in it anyway.
the teleport effect is likely from the A_SpawnFly thing in SpawnShot.

probably easier to make your own spawn function in the death state OR make a custom FogActor for it to use instead of the teleport one.
This solved all but one issue: A_SpawnFly automatically could detect and destroy the SpawnShot when it reached the target object, but since I've rewritten it it'll overshoot and hit whatever is solid. This is fine sometimes, but when the thing it hits is a wall or a floor at the wrong angle, the monster won't spawn because it would spawn directly in level geometry. How would I detect when it's reached the target, or failing that, at least ensure the monster gets spawned correctly?

Also tangentially related, how can I can enemies spawned with A_SpawnItemEx to spawn in an active state and try to chase the player down?
Post Reply

Return to “Scripting”