• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Sounds

Status
Not open for further replies.
Level 9
Joined
Jul 24, 2007
Messages
308
How can i play a sound for only some players.. not all (E.G. allies of player 1)... not just to all or in a point.. is it can be made only in JASS or what?

How can i play a sound for only some players.. not all (E.G. allies of player 1)... not just to all or in a point... help please
 
Last edited by a moderator:
Level 13
Joined
Nov 22, 2006
Messages
1,260
Maybe this will help you a bit.

You can do it by using GetLocalPlayer, maybe something like this:

JASS:
if GetLocalPlayer() == desiredPlayer
    call StartSound....whatever
endif[code=jass]

Though there is a procedure how to get a sound working. First time it doesn't play, it is [B]loaded[/B], next time it plays, I think.

EDIT: Omg don't do that criminal....
 
Level 5
Joined
Sep 13, 2007
Messages
33
For the record, you should note that Jass' numbers start from zero usually. So:

Player(0) = Player 1 (Red)
Player(1) = Player 2 (Blue)
Player(2) = Player 3 (Teal)

And so on. So if you work with HappyTauren's trigger you should do:

  • Custom script: If GetLocalPlayer() == PlayerEx(Player's number - 1) then
    • Sound - Play Sound
  • Custom script :endif
If you want to check if it is triggering players then:

  • Custom script: If GetLocalPlayer() == PlayerEx(GetTriggerPlayer()) then
    • Sound - Play Sound
  • Custom script :endif
If you want to check if it is a global variable then:

  • Custom script: If GetLocalPlayer() == PlayerEx(udg_GlobalName) then
    • Sound - Play Sound
  • Custom script :endif
Etc...
 
Level 9
Joined
Jul 24, 2007
Messages
308
hmmm... i want it for allies of a player.. not just a player. as i said. alliest of [owner of casting unit] so whats code..? and i cant use jass because the trigger uses over 150 lines.. there will be a high chance of mistakes.
if necessary and no code i'll do the long work like playing for specifec players each takes 3 lines

EDIT : hmmmm ishould try to change PlayerEx(GetTriggerPlayer()) to ..?
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
JASS:
function PlayerEx takes integer slot returns player
    return Player(slot-1)
endfunction

JASS:
function ConvertedPlayer takes integer convertedPlayerId returns player
    return Player(convertedPlayerId - 1)
endfunction
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
This is weird...... It's not in the blizzard.j.

It smelled of caster system*, but it seems like there's no PlayerEx there....... and I also checked the JC native list, but there is still no PlayerEx! So why is my JC screwing around with me??


*I know we shouldn't say that out loud, so sorry Pooty, should I call it the-system-which-must-not-be-named?

EDIT: I though it was CS, because both me and HappyTauren are using that. Well, I don't anymore, because of a certain enlightenment, but I don't know about HT......
 

Attachments

  • Untitled-1.jpg
    Untitled-1.jpg
    12 KB · Views: 68
Level 40
Joined
Dec 14, 2005
Messages
10,532
:p, Silvenon, go ahead and call it what you like, I just hate it. (for previously explained reasons...)

Anyways, JC automatically holds CS functions and I'm not getting a PlayerEx... maybe check your extra implemented scripts?

Anyways, let's spare this poor guy from getting his thread hijacked (if it even matters at this point)
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
:p, Silvenon, go ahead and call it what you like, I just hate it. (for previously explained reasons...)

I was kidding :)

Anyways, JC automatically holds CS functions and I'm not getting a PlayerEx... maybe check your extra implemented scripts?

That's what I did in the first place (I put all the functions in that CasterSystem.j which I got with JC. I had to do that because of some stupid bug)

Anyways, let's spare this poor guy from getting his thread hijacked (if it even matters at this point)

I think he got all the answers he needed.....If he didn't, he would've asked already
 
Status
Not open for further replies.
Top