PDA

View Full Version : Random Attack Grunts.



ShadowTiger
03-03-2009, 01:34 PM
This isn't so much as a request, per se, as it is a "Can it even be requested?"

All it is, is, whenever Link presses A to use his sword, it would choose between one to five random Sounds to play, instead of only using that one Sword Slash noise.

The issue is, can it really check what item Link has in his hand? Because if this goes to an Item Script, and I'll bet it will, wouldn't the item script also have to include not only the random SFX part, but the entire sword as well?

Joe123
03-03-2009, 01:43 PM
wouldn't the item script also have to include not only the random SFX part, but the entire sword as well?
What do you mean by this?

An item script usually works ok, but I'm not quite sure what you're getting at here.

lucas92
03-03-2009, 01:59 PM
Joe123 has done it:
http://www.purezc.com/forums/index.php?s=&showtopic=38391&view=findpost&p=545830

You would only have to change Rand(3) to Rand(5), and add two more if conditions.

ShadowTiger
03-03-2009, 06:02 PM
What do you mean by this?

An item script usually works ok, but I'm not quite sure what you're getting at here.
This is very much most likely my own personal confusion being added to the mixture here, but if you have an item script, can you attach the script onto a premade item, like the wooden sword? Or if you have an item script, does the script have to account for the entire performance (On button press.) of the weapon?

I'm going to assume the former, as it is the somewhat more likely and most desirable case.
(If only life was that convenient. :rolleyes: )

Majora
03-03-2009, 06:44 PM
I have the ASM version of that script. When a script is attatched to an item (the sword, any sword) it will kick in/activate when the sword is swung.

Joe123
03-04-2009, 03:44 AM
Oh right yeah, you can indeed attach a script to a normal item.


item script SwordSFX{
void run(int sfx1){
Game->PlaySound(sfx1+Rand(5));
}
}

Put all of your 5 sound effects in a row, and put the ID number of the first one as D0 for the item.

ShadowTiger
03-04-2009, 09:02 AM
Thank you! Will do! :ooh: