Wolvman's Scripting Questions

Post » Fri Jan 15, 2010 12:44 am

Yes, I'm making new werecreatures entirely. Replacing the WolfRun sound with a different .wav will still only allow me to have one panting noise for all of the werecreatures to use. I'm trying to give each of them a different sounding pant so I lowered the volume of the original "WolfRun" sound to 0 in the CS so that only the new panting sounds can be heard. Right now I'm trying to hook the new panting sounds to the original "WolfRun" so that it will loop as long as the silent "WolfRun" sound is playing.
User avatar
Krystina Proietti
 
Posts: 3388
Joined: Sat Dec 23, 2006 9:02 pm

Post » Thu Jan 14, 2010 2:42 pm

Yes, I'm making new werecreatures entirely. Replacing the WolfRun sound with a different .wav will still only allow me to have one panting noise for all of the werecreatures to use. I'm trying to give each of them a different sounding pant so I lowered the volume of the original "WolfRun" sound to 0 in the CS so that only the new panting sounds can be heard. Right now I'm trying to hook the new panting sounds to the original "WolfRun" so that it will loop as long as the silent "WolfRun" sound is playing.

as to the popping, i think it might be a sound editor issue. i know if i loop things without a slight fade of the "edges" of the clip, there will be popping.

so try saving versions of your sounds with a very short fadeoff on the ends.
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm

Post » Thu Jan 14, 2010 9:10 pm

I'm guessing this wouldn't work since nobody has suggested it yet.

Begin Werewolf_Running_soundsWhile ( Player->GetSoundPlaying, "WolfRun" )	Player->PlaySound3D, "WereWolfRun"EndWhileEnd


I noticed you didn't stop the "WolfRun" sound before playing the "WereWolfRun" sound in your script. Is it not necessary to stop the previous sound?
User avatar
Veronica Martinez
 
Posts: 3498
Joined: Tue Jun 20, 2006 9:43 am

Post » Thu Jan 14, 2010 4:33 pm

RAKninja: I've tried it both with and without fade-ins/fade-outs on the sound files but they all still cause the popping either way.

metalfiend00: I tried your script out but the popping still remains. And to answer your question, the "WolfRun" sound does not need to be ended through the script because it ends automatically as soon as you stop running on all fours as a werewolf. However I do still need to stop any of the new sounds that I want to add manually through the script.

I guess I'll go ahead and run this by the MCP thread and see what Hrnchamd has to say. Thanks for the help everyone.
User avatar
Bek Rideout
 
Posts: 3401
Joined: Fri Mar 02, 2007 7:00 pm

Post » Thu Jan 14, 2010 2:53 pm

I think you might have misunderstood my question, or I'm not understanding you correctly. Just to clarify things, the "WolfRun" sound is the original game sound right? And you want to replace it with "WereWolfRun" (Which I'm guessing is a custom sound?)? What I was asking is, do you need to stop the original "WolfRun" sound before you play the new "WereWolfRun" sound? I'm thinking WolfRun is playing for a split second before WereWolfRun takes over, and that is what is making the popping sound.

Begin Werewolf_Running_soundsWhile ( Player->GetSoundPlaying, "WolfRun" )	StopSound, "WolfRun"	Player->PlaySound3D, "WereWolfRun"EndWhileEnd

User avatar
Latisha Fry
 
Posts: 3399
Joined: Sat Jun 24, 2006 6:42 am

Post » Thu Jan 14, 2010 9:54 pm

Yes, you have it right. The "WolfRun" sound is the normal BM werewolf panting sound. The "WereWolfRun" sound is a new panting sound that I'm wanting to put into the mod.

And to answer your question, the "WolfRun" sound doesn't need to be stopped as I set it to play with zero volume and because it doesn't make a difference with the popping sounds whether it is stopped or not. I found this out by using this version of the script earlier:


Begin Werewolf_Running_Sounds	Short doonce	If ( DoOnce == 0 )		If ( getPCRunning == 1 )			player->playloopsound3d, "WerewolfRun"			set DoOnce to 1		endif	endif	If ( DoOnce == 1 )		If ( getPCRunning == 0 )			If ( player->getsoundplaying "WereWolfRun" == 1 )				player->stopsound, "WerewolfRun"				set DoOnce to 0			endif		endif	endifend


This script still caused the popping noise even though the "WolfRun" sound is not playing at all (I tested it in human form as well). I'm now starting to think that the culprit is the way that Morrowind processes the "3D" playsound functions specifically because it doesn't seem to cause popping sounds when using "playsound" (without the 3D part). The thing is, I can't end my new sounds immediate without using the "3D" sound functions which is something that I need it to be able to do.
User avatar
Sarah Bishop
 
Posts: 3387
Joined: Wed Oct 04, 2006 9:59 pm

Post » Thu Jan 14, 2010 6:21 pm

Quick question, is there a GMST that affects how much damage a weapon does to a shield when it strikes it?
User avatar
Lindsay Dunn
 
Posts: 3247
Joined: Sun Sep 10, 2006 9:34 am

Post » Fri Jan 15, 2010 2:37 am

Two more questions for the masses.

1. Does anyone know how to use the new MW Code Patch functions for changing GMST values in game by chance? I want to use of few of them in my scripts in order to adjust the maximum chance of blocking.

2. Does anyone know of a way to get playgroup to work on the player? I am using the extra MWCP animation support and I still can't get the function to work correctly.
User avatar
Fanny Rouyé
 
Posts: 3316
Joined: Sun Mar 25, 2007 9:47 am

Post » Fri Jan 15, 2010 3:25 am

it doesn't seem to cause popping sounds when using "playsound" (without the 3D part). The thing is, I can't end my new sounds immediate without using the "3D" sound functions which is something that I need it to be able to do.
I'd try without looping and see what happens, for instance something like this
Begin Werewolf_Running_Soundsshort stoppedif ( GetPCRunning )	if ( player->GetSoundPlaying "WerewolfRun" )		return	endif	player->PlaySound3D "WerewolfRun"	if ( stopped )		set stopped to 0	endif	returnendifif ( stopped )	returnendifplayer->StopSound "WerewolfRun"set stopped to 1end

User avatar
Liv Staff
 
Posts: 3473
Joined: Wed Oct 25, 2006 10:51 pm

Post » Fri Jan 15, 2010 2:30 am

Thanks for the suggestion. That would work except that I need it to be able to stop in the middle of the sound file at times. That way it ends immediately if the player enters water which is something that only playsound3d can accomplish.
User avatar
Kelly Tomlinson
 
Posts: 3503
Joined: Sat Jul 08, 2006 11:57 pm

Post » Thu Jan 14, 2010 9:15 pm

Another question. Is there anyway to force a keyboard button to be pressed using MWSE functions?
User avatar
Eilidh Brian
 
Posts: 3504
Joined: Mon Jun 19, 2006 10:45 am

Post » Thu Jan 14, 2010 5:25 pm

I'm also having trouble with this script causing crashes. This basically adds a spell to every NPC and Creature in the cell.


Begin AI_Attack	Short HasSpell	Float HasWeaponDrawn	Float HasHealth	Float Timer	long AIRef ;change the variables to whatever you want	long tmp	ifx ( AIRef )		setx AIRef to xNextRef AIRef ;finds the next NPC or creature in the cell	else		setx AIRef to xFirstNPC ;finds the first NPC or creature in the cell	endif	if ( AIRef == 0 )   ;end of list or empty cell		return	endif	setx tmp to AIRef->xRefType	if ( tmp != 1598246990 ) ;if not type NPC		if ( tmp != 1095062083 ) ;if not type Creature			return		endif	endif	xSetRef AIRef	set HasSpell to ( Getspell, "Ai Realistic Striking" )	If ( HasSpell != 1 )		if ( MenuMode == 0 )			AIRef->Addspell, "Ai Realistic Striking"		elseif ( MenuMode == 1 );			AIRef->Removespell, "Ai Realistic Striking"		endif	endifend


I want to be able to put more requirements in at the bottom of the script so that it will only add the spell if the NPC has his weapon drawn and is his health is above 0 however if i try to put anything like that in the script it breaks it. In its current state the script is working just fine however, but its only requirement is that the NPC/Creature must not already have the spell.
User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Previous

Return to III - Morrowind