Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Come and join our gamer community by
registering for free here
Other Gaming Forum
PC games
Warcraft Tools and Tutorials
How To Put Custom Sounds In Units
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Laosh&#039;Ra" data-source="post: 105864" data-attributes="member: 5870"><p>for those who dont want to spam if-then-elses (note: read the array tutorial if u dont understand this)</p><p></p><p>declare the sounds at map initialization...</p><p></p><p>Set NUMBEROFUNITSOUNDS = 12</p><p>Set UNITTYPE = hero_of_the_day</p><p>Set unitsounds[1] = salute1</p><p>Set unitsounds[2] = salute2</p><p>etc. etc.</p><p>Set unitsounds[12] = salute3</p><p></p><p>...and use this trigger</p><p></p><p>[code]</p><p>????Events</p><p>????????Player - Player 1 (Red) Selects a unit</p><p>????????Player - Player 2 (Blue) Selects a unit</p><p>????Conditions</p><p>????????(Unit-type of (Triggering unit)) Equal to UNITTYPE</p><p>????Actions</p><p>????????Sound - Play unitsounds[(Random integer number between 1 and NUMBEROFUNITSOUNDS)]</p><p>[/code]</p><p></p><p>didnt test this myself, should work though. performance should be better than with many ifs since this trigger will be executed a lot.</p><p>@arkidas very nice idea <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /></p></blockquote><p></p>
[QUOTE="Laosh'Ra, post: 105864, member: 5870"] 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)] [/code] 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 ;) [/QUOTE]
Verification
Post reply
Other Gaming Forum
PC games
Warcraft Tools and Tutorials
How To Put Custom Sounds In Units
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top