How To Put Custom Sounds In Units

Arkidas

New Member
1. E-Unit is selected
C-Unit equal to (insert unit type here)
A- Play sound.

If you wanted more sounds then set a variable, Lets say SOUND, also set it as an array at map initialization.
E-Map Initialization
C-
A-Set Variable-- Set (name of sound) to SOUND[integer]
(Do this as many times as you want, As long as you have enough sounds)

Then you set the previous trigger
E-Unit is selected
C-Unit equal to (insert unit type here)
A-Set variable-- Set (name of variable) to (random integer from [first interger - you last integer])
IF, THEN, ELSE-- If SOUND equals [interger], then play this sound.
(copy this as many times as you want, as long as you have enoguh sounds)
tell me if this is confusin
 
Werbung:

james1654

New Member
So, you are saying, basically, that i could get a whole sound set for my unit by doing that? hmmm, thats pretty damn cool. Very confusing, though, so im ganna wait for your example map so i can look at it in world editor.

p.s: on my escape ,ondon map, i might want voice acting. If u have a Strong london acent, private message me
 
What about when you MOVE the unit and also, won't the original sound of the unit still play?

Well I redid the trigger in WE as Arkidas said.
Code:
Trigger
????Events
????????Player - Player 1 (Red) Selects a unit
????????Player - Player 2 (Blue) Selects a unit
????????????????????????????????\\\ ect...
????Conditions
????????(Unit-type of (Triggering unit)) Equal to (unittype)
????Actions
????????Sound - Play (YourSound)

Code:
TriggerAdvanced
????Events
????????Player - Player 1 (Red) Selects a unit
????????Player - Player 2 (Blue) Selects a unit
????Conditions
????????(Unit-type of (Triggering unit)) Equal to (Unittype)
????Actions
????????Set SOUND = (Random integer number between 1 and 2)
????????If (All Conditions are True) then do (Then Actions) else do (Else Actions)
????????????If - Conditions
????????????????SOUND Equal to 1
????????????Then - Actions
????????????????Sound - Play (Sound1)
????????????Else - Actions
????????If (All Conditions are True) then do (Then Actions) else do (Else Actions)
????????????If - Conditions
????????????????SOUND Equal to 2
????????????Then - Actions
????????????????Sound - Play (Sound2)
????????????Else - Actions
 

Laosh'Ra

New Member
for those who dont want to spam if-then-elses (note: read the array tutorial if u dont understand this)

declare the sounds at map initialization...

Set NUMBEROFUNITSOUNDS = 12
Set UNITTYPE = hero_of_the_day
Set unitsounds[1] = salute1
Set unitsounds[2] = salute2
etc. etc.
Set unitsounds[12] = salute3

...and use this trigger

Code:
????Events
????????Player - Player 1 (Red) Selects a unit
????????Player - Player 2 (Blue) Selects a unit
????Conditions
????????(Unit-type of (Triggering unit)) Equal to UNITTYPE
????Actions
????????Sound - Play unitsounds[(Random integer number between 1 and NUMBEROFUNITSOUNDS)]

didnt test this myself, should work though. performance should be better than with many ifs since this trigger will be executed a lot.
@arkidas very nice idea ;)
 
for those who dont want to spam if-then-elses (note: read the array tutorial if u dont understand this)

declare the sounds at map initialization...

Set NUMBEROFUNITSOUNDS = 12
Set UNITTYPE = hero_of_the_day
Set unitsounds[1] = salute1
Set unitsounds[2] = salute2
etc. etc.
Set unitsounds[12] = salute3

...and use this trigger

Code:
????Events
????????Player - Player 1 (Red) Selects a unit
????????Player - Player 2 (Blue) Selects a unit
????Conditions
????????(Unit-type of (Triggering unit)) Equal to UNITTYPE
????Actions
????????Sound - Play unitsounds[(Random integer number between 1 and NUMBEROFUNITSOUNDS)]

didnt test this myself, should work though. performance should be better than with many ifs since this trigger will be executed a lot.
@arkidas very nice idea ;)
[/b]
Yeah yeah, outsmart desty will you? I'm no pro at triggers...good job =D
 

Morrowind1357

New Member
Well if you've imported the sound already , go to the sound editor and find a unit with the suitable amount of speeches, say ogrewhat1 and ogredeath1. The change the path of the sound you imported to the path of that units previous sound set so it should look like 'Units\Creeps\Ogrewhat1\Ogrewhat1.wav' then when units sound is set to ogre his ogrewhat1 will be your recording
 

Werewulf

New Member
or just go sond editor, right click a units sound liek a gnolls one, and click replace interanal or what ever sound and it overides and imports the file.
 

Almost_There

New Member
1. E-Unit is selected
C-Unit equal to (insert unit type here)
A- Play sound.

If you wanted more sounds then set a variable, Lets say SOUND, also set it as an array at map initialization.
E-Map Initialization
C-
A-Set Variable-- Set (name of sound) to SOUND[integer]
(Do this as many times as you want, As long as you have enough sounds)

Then you set the previous trigger
E-Unit is selected
C-Unit equal to (insert unit type here)
A-Set variable-- Set (name of variable) to (random integer from [first interger - you last integer])
IF, THEN, ELSE-- If SOUND equals [interger], then play this sound.
(copy this as many times as you want, as long as you have enoguh sounds)
tell me if this is confusin
[/b]


or just go sond editor, right click a units sound liek a gnolls one, and click replace interanal or what ever sound and it overides and imports the file.
[/b]

... lol? ty whole lots ^_^ been trying to figure this out for a year...
I think im stupid.
 
Werbung:
Top