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

Stop the music in the middle of the playing

Question

Hey there, I have a lil big problem. I need help. I'm making an experiment, but I don't know if I'm very noob, or stoopid.

 

I want to make a Hokuto Hyaretsu Ken (Omae wa mou Shindeiru) Weapon. I stole it for Russian Ov- I mean, I made it and works roughly, it's just a testing. But I want it to play the ATATATATA sound, which does, but stopping or pausind the actual music. I'm trying to do a Script, that I don't know if it's even working, I'll leave all my tries here:

 

script 10000 (void)
{
    //CONSOLECOMMAND ("STOPMUS");
	//SetResultValue(SetCVarstring ("snd_musicvolume", 0));
	//SetCVarstring ("snd_musicvolume", 0);
	//SetCVar ("stopmus", True);
	SetMusic ("");
}

 

The Script is in the File of the first map. And this is the actor's Decorate:

 

ACTOR HKEN : WEAPON 17000
  {
  +WEAPON.CHEATNOTWEAPON
  Inventory.Pickupmessage "Omae wa mou shindeiru."
  Weapon.SelectionOrder 50
  Weapon.AmmoUse 0
  Weapon.AmmoGIVE 0
  Weapon.AmmoTYPE "Clip"
  Weapon.slotnumber 0
     States
     {
     Ready: // This state is entered when you have this weapon selected.
        FIST A 0 A_PlaySound ("WEAPONS/MARTYSWING", CHAN_WEAPON, 1)
		FIST A 1 A_WeaponReady
        Loop 
     Deselect: // This state is entered when you deselect the current selected weapon.
        FIST A 1 A_Lower
        Loop 
     Select: // This state is entered when you select this weapon.
        FIST A 1 A_Raise
        Loop 

	FIRE: //AHTATATATATATATA
		MFST B 0 ACS_Execute  (10000, 1,0,0,0)
		MFST B 0 A_PlaySound ("WEAPONS/AHTATATA", CHAN_AUTO | CHAN_NOSTOP, 10)
		MFST B 0 A_Recoil (-15)
		MFST BCDEFGHI 1 A_FireBullets (13.4, 9.2, 50, 10, "BulletPuff")
		MFST B 0 A_Refire
		Goto AHTAHH
	AHTAHH:
		MFST B 0 A_StopSound(CHAN_AUTO)
		Goto READY
		
}
}

Then what I'm doing wrong? Need some hulp.

Share this post


Link to post

10 answers to this question

Recommended Posts

  • 1
2 hours ago, noigs2015 said:

Good, I will, and how do I call the script in the Decorate? I think that's my problem.

Just like this for example:

 

Active:
    PEAS A 0 A_FaceTarget
    PEAS A 0 A_UnSetShootable
    PEAS A 5 ACS_NamedExecuteAlways("Civiliansave",0)
    PEAS A 5 ACS_NamedExecuteAlways("Duolingohizoesto",0)
    TNT1 A 0 A_Jump(256,"Escape")

https://zdoom.org/wiki/ACS_NamedExecuteAlways

Share this post


Link to post
  • 1

It will sound crazy but I think it is easier and probably simpler, make the weapon reproducing the sound like a music instead of reproducing the sound in a a_playsound, make sure you can play the level music again after the weapon finish

Share this post


Link to post
  • 1
2 hours ago, noigs2015 said:

No, actually, it have more sense. The problem is that I don't know which is the command or the correct channel, I just lost myself in the zdoom wiki and i'm confused with it now.

 

Besides, I think the best way is turn down the music volume with a script, but I don't know how to do it properly.

Then, use this :
https://zdoom.org/wiki/SetMusic
It does not matter if the sound is not music, the engine can reproduce it as music

 

 

Share this post


Link to post
  • 0
11 hours ago, Gaia74 said:

It will sound crazy but I think it is easier and probably simpler, make the weapon reproducing the sound like a music instead of reproducing the sound in a a_playsound, make sure you can play the level music again after the weapon finish

No, actually, it have more sense. The problem is that I don't know which is the command or the correct channel, I just lost myself in the zdoom wiki and i'm confused with it now.

 

Besides, I think the best way is turn down the music volume with a script, but I don't know how to do it properly.

Share this post


Link to post
  • 0

Ok, Don't know with what black magic I mess, but some how, It worked. I just putted the Wad in the GZ Doom Builder putted the scripts in some lines (And worked the SetMusic). Then I found this command "SetMusicVolume" which is like that and exactly what I was looking for, and also worked. Then I played the Wad and suddenly, the script (called from the decorate) worked. Don't know wtf happened. Anyways, Thanks you all guys.

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
×