Page 1 of 1

No Sound playing in actual Multiplayer help!

Posted: Sun Aug 11, 2013 10:20 am
by rico345
As you saw title, only in Multiplayer, some sounds are not playing.
But Singleplayer plays well.

This is code.

Code: Select all

actor "OG7V_Flying_Realistic" : "RPG7_Flying_Realistic"
{
	obituary "%k [OG-7V] %o"
	Speed 40
	
	States
	{
		Explosion :
			TNT1 A 0
			TNT1 A 0 A_PlaySound("EFT/GRNEXP")
			TNT1 A 0 A_Explode(250,300)
			TNT1 AA 0 A_SpawnItemEx("Grenade_MainExplosion_Demolition",0,0,0,0,0,0,0,0,0)
			TNT1 AAAA 0 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			TNT1 AAAA 0 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-200, 200), 0.01 * Random(-200, 200), 0.01 * Random(25, 245), 0, 128, 0)
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Grenade_Frag", 0, 0, 24, 0.01 * Random(-300, 300), 0.01 * Random(-300, 300), 0.01 * Random(0, 800), 0, 128, 0)
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Grenade_Frag", 0, 0, 16, 0.01 * Random(-300, 300), 0.01 * Random(-300, 300), 0.01 * Random(0, 700), 0, 128, 0)
			TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("Grenade_Frag", 0, 0, 8, 0.01 * Random(-300, 300), 0.01 * Random(-300, 300), 0.01 * Random(0, 600), 0, 128, 0)
			TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile("ExploShrapnel",0,0,random(-180,180),2,random(180,-180))
			TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile("ExploShrapnel",0,0,random(-180,180),2,random(180,-180))
			TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile("ExploShrapnel",0,0,random(-180,180),2,random(180,-180))
			TNT1 A 25 Radius_Quake(9, 30, 0, 15, 0)
			TNT1 A 25 Radius_Quake(4, 30, 0, 15, 0)
			TNT1 A 25 Radius_Quake(2, 30, 0, 15, 0)
			TNT1 A 25 Radius_Quake(1, 30, 0, 15, 0)
			Stop
	}
}
Not just that, others not playing either.
(And they're has similar Death states, using same Explosion sound)

What is the problem? How should fix it?

RE: No Sound playing in actual Multiplayer help!

Posted: Sun Aug 11, 2013 3:22 pm
by Ænima
Use A_PlaySoundEx instead, and give the explosions their own channel.

RE: No Sound playing in actual Multiplayer help!

Posted: Mon Aug 12, 2013 9:27 am
by rico345
Ænima wrote: Use A_PlaySoundEx instead, and give the explosions their own channel.
Thanks for answer, but still not work.

First, I was used A_PlaySoundEx. But It wans' work, so I changed to
normal A_PlaySound, not work either.

One thing, I can't understand is 5 more actors using same A_PlaySoundEx, but only one is working fine, others not work.

This is first code :

Code: Select all

A_PlaySoundEx("EFT/GRNEXP","CHAN_WEAPON")
And all actors that using same A_PlaySoundEx :

Code: Select all

//Hand Grenade Code. It's working well.
actor Fly_M61Grenade
{
	obituary "%k [M-61 GRENADE] %o"
	DamageType "Explosives"
	radius 5
	height 5
	speed 35
	damage 0
	seesound "EFT/GRNBOUNCE"
	Projectile
	-NOGRAVITY
	+RANDOMIZE
	+DOOMBOUNCE
	+FORCERADIUSDMG
	+CANBOUNCEWATER
	+SOLID
	+REFLECTIVE 
	+FORCEXYBILLBOARD
	Scale 0.04
	gravity 0.6
	bouncefactor 0.4
	
	States
	{
		Spawn:
			FRGX HFEDC 7
			FRGX BA 25
		Death:
			TNT1 A 0 A_PlaySoundEx("EFT/GRNEXP","CHAN_WEAPON")
			TNT1 A 0 A_Explode(500,400)
			TNT1 A 0 A_SpawnItemEx("Grenade_MainExplosion",0,0,0,0,0,0,0,0,0)
			stop
	}
}

//Rockets and 40mm Grenade codes -> These are not working
actor RPG7_Flying_Realistic
{
	Projectile
	obituary "%k [RPG-7] %o"
	//-NOGRAVITY
	//Gravity 0.1
	Scale 0.1
	Speed 20
	Height 5
	Radius 5
	Damage (200)
	DamageType "Explosives"
	//DamageType "ProjectileDirective"
	decal Scorch
	
	States
	{
		Spawn :
			RPGR ZZZZZZZZZ 1
		Armed :
			TNT1 A 0 A_GiveInventory("VAR_GrenadeArmed", 1)
			TNT1 A 0 A_Recoil(-60)
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
			RPGR Z 1 A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			RPGR Z 1 A_SpawnItem("ExplosionSmall")
    		TNT1 A 0 ThrustThing((angle*256/360)+(random(-5,5)), 5, 0, 0)
			//TNT1 A 0 ThrustThingZ(0,random(0,5),random(0,1),1)
			goto Armed
		Death :
			TNT1 A 0 
			TNT1 A 0 A_JumpIfInventory("VAR_GrenadeArmed", 1, "Explosion")
			TNT1 A 0 A_SpawnItemEx("RPG7_Fall",0,0,0,0,0,0,0,0,0)
			Stop
		Explosion :
			TNT1 A 0 
			TNT1 A 0 A_PlaySoundEx("EFT/GRNEXP","CHAN_WEAPON")
			TNT1 A 0 A_Explode(500,300)
			TNT1 AA 0 A_SpawnItemEx("Grenade_MainExplosion_Demolition",0,0,0,0,0,0,0,0,0)
			Stop
	}
}

actor 40mm_Flying
{
	Projectile
	obituary "%k [M16A3 M203] %o"
	-NOGRAVITY
	Gravity 0.4
	Scale 0.03
	Speed 60
	Height 5
	Radius 5
	Damage (40)
	DamageType "Explosives"
	decal Scorch
	
	States
	{
		Spawn :
			2031 A 1 //A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			2031 A 1 //A_SpawnItemEx("Grenade_Smoke", 0, 0, 0, 0.01 * Random(-125, 125), 0.01 * Random(-125, 125), 0.01 * Random(25, 245), 0, 128, 0)
			2031 A 0 A_GiveInventory("VAR_GrenadeArmed", 1)
			Loop
		Death :
			TNT1 A 0 
			TNT1 A 0 A_JumpIfInventory("VAR_GrenadeArmed", 1, "Explosion")
			TNT1 A 0 A_SpawnItemEx("40mm_Fall",0,0,0,0,0,0,0,0,0)
			Stop
		Explosion :
			TNT1 A 0
			TNT1 A 0 A_PlaySoundEx("EFT/GRNEXP","CHAN_WEAPON")
			TNT1 A 0 A_Explode(70,400)
			TNT1 AA 0 A_SpawnItemEx("Grenade_MainExplosion",0,0,0,0,0,0,0,0,0)
			Stop
	}
}

RE: No Sound playing in actual Multiplayer help!

Posted: Mon Aug 12, 2013 12:43 pm
by Ænima
Why are you using the weapon channel?

If you don't want sounds to interrupt each other, they have to all go on different channels. Putting everything on CHAN_WEAPON defeats the purpose of using A_PlaySoundEx.

RE: No Sound playing in actual Multiplayer help!

Posted: Mon Aug 12, 2013 1:05 pm
by rico345
Ænima wrote: Why are you using the weapon channel?

If you don't want sounds to interrupt each other, they have to all go on different channels. Putting everything on CHAN_WEAPON defeats the purpose of using A_PlaySoundEx.
I used another way to solve this problem.
Thanks to help !!

RE: No Sound playing in actual Multiplayer help!

Posted: Mon Aug 12, 2013 1:12 pm
by Ænima
You're welcome. @_@

RE: No Sound playing in actual Multiplayer help!

Posted: Mon Aug 12, 2013 1:57 pm
by Lollipop
And when someone finds a way they should post it, instead of just sticking it to themselfes, as others who then read this might no thave to ask the very same question to find the way rico found -.-

RE: No Sound playing in actual Multiplayer help!

Posted: Thu Dec 25, 2014 10:29 pm
by false_chicken
I ran into this same problem and was sad to see no solution posted here. Sorry to bring this back from the dead but I found a solution that worked for me. I created a new actor that played a sound when it spawned and did nothing else (Stopped) and spawned said actor on the death of the target actor like so:

Sound "Actor":

Code: Select all

actor TargetShotSound
{
 radius 1
 height 1
 +noclip
 States
 {
 Spawn:
  TNT1 A 0
  TNT1 A 1 A_PlaySound("generic/headshot2")
  stop
 }
}
Target Actor: (One you want to play the sound.)

Code: Select all

actor Target_Nazi 14698
{
  Health 1
  Radius 16
  Height 48
  Speed 9
  PainChance 200
  Monster
  +FLOORCLIP
 States
  {
  Spawn:
    WW2A A 5
    Loop
  Pain:
	Goto Death
  Death:
    WW2A A 0 A_SpawnItemEx("TargetShotSound",0,0,0,0,0,0,0,0,0) //<- Sound played like this.
    Stop
  }
}
Hopefully someone else will see this and it will be of use. I do not know why the death sounds are not played properly in multiplayer but this work around works for me.