• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to make the game play a sound for a local player only

Status
Not open for further replies.
Level 6
Joined
Dec 23, 2008
Messages
82
HOW TO MAKE THE GAME PLAY A SOUND FOR A LOCAL PLAYER ONLY?? ill be on later tonight. but an answer would be nice. i use GUI and i think i have to use Custom Script or JASS. can someone help me with this.
well, it's basically


JASS:
 if GetLocalPlayer () == InsertJASSPlayerHere then

<GUI or JASS action that doesn't desync (more on this later)>

JASS:
endif
I need to know what the custom script is if it uses that. And how do i set the player number.. do i put it inbetween the brackets?

but mostly, how do i get it to play the sound, only for that player..
 
Last edited:
Level 8
Joined
Aug 13, 2009
Messages
466
well, it's basically

JASS:
if GetLocalPlayer() == InsertJASSPlayerHere then
<GUI or JASS action that doesn't desync (more on this later)>
JASS:
endif

The non-desyncing actions include:
-Vertex Shading
-Animations
-Sounds
-Fade Filters
-Text Displays
-Text Tag Creation
-Text Tag Visibility/Text Display
-Multiboard Display/Values
(there might be more)
(Ty to Taur of my clan for this :p)

full tut link: http://www.clancbs.com/board/showthread.php?t=1344
 
Level 10
Joined
Sep 21, 2007
Messages
517
Dont do it, its risky and causes desync, i tired to make music system out of it, it only made desync and disc players. Its risky. there is way by changing volume of music, but mine bugged by the music not playing after its played once, maybe it wont bug for you, suggestion of chagnging volume was originally by deuterium as he told me my first option might cause sound desync, and it caused even more than that... a disc!
 
Level 1
Joined
Mar 29, 2009
Messages
4
Very green to the hive and map making, but I got local sounds by replacing sounds used by the quest log updates. Limit though.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
You can play a sound locally.
You can not make a sound locally.

A sound is a type of handle object, thus has a handle reference. If you make it locally it messes up the sync in the handle system of WC3 and can cause out of sync stuff to occur and thus a split.
You can however play a sound locally for one player as long as the sound being played was made for all players.
 
Status
Not open for further replies.
Top