Jump to content

Weapon Sound Script


AIgnatiousS

Recommended Posts

Is it possible to make a sound occur while attacking with a specific weapon using a script.

 

Say, I attack with a 'cannon' I would want it to sound like a cannon and not a bow. If I attack with 'canon', play 'sound'?

 

I'm not making a cannon that is just an example, I need to know if it's possible because the last thing I want to do is change vanilla sound files for a mod.

This would need to be done if NPC's are using the weapon as well..

 

Ultimately I just need a new sound for a new custom weapon. It's a spear type, and I need it to be a custom sound.

Edited by AIgnatiousS
Link to comment
Share on other sites

That got me 100 times closer, actually. Thank you Dragon32.

 

Now my problem seems to be that I can't get the script to work right under my new weapon. First off, this is a blunt weapon, second off, do I need to state something other than begin, like make it a global script or something?

 

Begin WeaponSoundNew
If ( Player -> HasItemEquipped "NewWeapon" )
If ( GetSoundPlaying "Weapon Swish" == 1 )
Player -> stopsound "Weapon Swish"
if ( getsoundplaying "NewSound == 0 )
Playsound "NewSound"
endif
endif
endif
End WeaponSoundNew
Link to comment
Share on other sites

Lol, I had to attach it to the weapon is all, and it worked, now I just have to figure out how to make it work for NPC's as well.

 

Thanks a ton man.

 

Edit: I have 4 of these weapons. And I THOUGHT I heard the NPC's make them and I realized what happened.

Both the NPC's and I were using NewWeapon 1 and sounds worked across the board.

I equipped Weapon 2 (I redid the same script 4 times for NewWeapon-NewWeapon4) and then it only worked for me.

 

Hmm.... is there a variable that isn't player-> but triggeringunit?

Edited by AIgnatiousS
Link to comment
Share on other sites

Look at this, my guardian angel I swear.

 

Edit: Aah man, I don't know, I've made it this far into my mod, almost a year now, actually https://forum.niftools.org/topic/4511-what-to-do-with-this-mesh/#comment-30121. And, I have made it a point not to require any other mods.

 

I'm going to do some serious research tonight, I'll let you know what I come up with.

Edited by AIgnatiousS
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...