Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: sounds for all players
sounds for all players
Oct 7 2010, 9:24 pm
By: DrZygote214  

Oct 7 2010, 9:24 pm DrZygote214 Post #1



my triggers r for force 1, but i've been testing and sometimes the sounds and text dont show for all players. Acoding to staredit help file, under triggers -> guidlines, all text and sounds go to the trigger's owners. yes i also have text always display checked. R there glitches with sound? I have hyper-triggers too btw.



None.

Oct 7 2010, 9:49 pm Vrael Post #2



A number of things could be happening. The most likely, as my guess, is that the trigger you have running only runs once. Go to the wiki and search "triggers", it explains trigger order and how force triggers work. What could be happening, is that the trigger runs for the first player in the force, then one of the actions of that trigger invalidates the conditions, then when the next player goes to run the trigger it doesn't run, since the conditions are now invalid.
edit: http://www.staredit.net/starcraft/Triggers
http://www.staredit.net/starcraft/Triggers#Why_does_my_map_spawn_one_Terran_Marine_instead_of_multiple.3F



None.

Oct 7 2010, 10:12 pm Azrael Post #3



If all else fails, you can just post the map and we'll tell you why it isn't working.




Oct 7 2010, 10:12 pm rockz Post #4

ᴄʜᴇᴇsᴇ ɪᴛ!

Your grammar hurts my brain. Please spell out your words and capitalize properly.

As Vrael said, the triggers aren't running due to an action invalidating the condition. This is common with "set switch", since switches are global. If the trigger is running for player 1, but nobody else, that's probably the reason. Consider using death counts (and current player) to control text, or just don't set the switch at the end of the trigger. If the trigger only has to be displayed once, don't preserve it.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Oct 7 2010, 10:12 pm DrZygote214 Post #5



That actually makes sense, despite what a pain it is. Here's what I'm thinking to fix it. I have a switch for each sound (there's only 3 or 4 sounds in my map), and force 1 has the trigger:

if switch snd_1 is set
{
play snd_1
wait 2000 ms
clear switch snd_1
preserve trigger
}

that way, it will be played for each player, because 2000 ms is nuff time for each player to call this trigger. Or am I wrong? Does it wait 2000 ms b4 checking or executing the next trigger? In that case I'm still screwed, cuz as it said, triggers owned by force 1 r executed 1x for each player, so it would be sequential and not parallel........

i used to think staredit was the bomb when it came out, but man, how i wish for some straight c++ these days...



None.

Oct 7 2010, 10:17 pm Vrael Post #6



If you use that trigger, all players will hear the sound like you think. However, each player can only execute 1 Wait() action at any given time, so its advisable to avoid using that.

Instead, you might try using Death Counts.

Players:
Force 1
Conditions:
Current Player has suffered exactly 1 deaths of "W/e Unit"
Actions:
Play snd_1
Set deaths for Current Player to 0 for "W/e Unit"
preserve trigger

This way, if each player has 1 death of "W/e Unit" when they run the trigger they will only affect their own deaths (Current Player = whichever player is currently executing his triggers), so the trigger will still execute for the next player.

Read the Triggers article I linked you to, it explains the trigger process thoroughly.

And as rockz asked, please type things out properly, at least here in UMS assistance where you're asking for help.



None.

Oct 7 2010, 10:36 pm DrZygote214 Post #7



Yea, I read that wiki article, it was helpful. I didn't realize you can set and reset death counts for any unit and for each player individually. Yea that's a much better way.

You can also do that with gas right? This would probably be better because you can have almost infinite gas, whereas there are a limited number of units to use as death counters. I still find it a pain though because this will have to be done for every sound and every text message. If there are any easier or at least similar alternatives, let me know.



None.

Oct 8 2010, 12:06 am Aristocrat Post #8



Quote from Vrael
If you use that trigger, all players will hear the sound like you think. However, each player can only execute 1 Wait() action at any given time, so its advisable to avoid using that.
No, they won't hear the sound, and the trigger not working is not due to waits. If you clear the switch when player 1 first runs the trigger, then when player 2 runs the trigger's conditional check, the condition "Switch is set" will no longer be true, making the sound only work for player 1. Your death count solution does get around that problem, however.

Quote from DrZygote214
You can also do that with gas right? This would probably be better because you can have almost infinite gas, whereas there are a limited number of units to use as death counters. I still find it a pain though because this will have to be done for every sound and every text message. If there are any easier or at least similar alternatives, let me know.
I'm not quite sure why a single value can store more information than a bunch of values. Also what do you mean by "this will have to be done for every sound and every text message"? What exactly are you making for a map? Why is this more complicated than you would have liked? Please elaborate. Some of the questions here make no sense to me.



None.

Oct 8 2010, 12:34 am FoxWolf1 Post #9



Quote from DrZygote214
That actually makes sense, despite what a pain it is. Here's what I'm thinking to fix it. I have a switch for each sound (there's only 3 or 4 sounds in my map), and force 1 has the trigger:

if switch snd_1 is set
{
play snd_1
wait 2000 ms
clear switch snd_1
preserve trigger
}

that way, it will be played for each player, because 2000 ms is nuff time for each player to call this trigger. Or am I wrong? Does it wait 2000 ms b4 checking or executing the next trigger? In that case I'm still screwed, cuz as it said, triggers owned by force 1 r executed 1x for each player, so it would be sequential and not parallel........

i used to think staredit was the bomb when it came out, but man, how i wish for some straight c++ these days...

Despite what some have said, the wait method will work...but you don't need it to be 2000ms. In fact, you can (and should, if using this method)) use a Wait 0 here...you just need the cycling effect of the wait (like with hyper triggers) so that other players have a chance to have their triggers fire before the switch-clearing action in the initial trigger goes down.

I can verify functionality of the following trigger through testing (not that I had any doubt, but others might):

Trigger("Force 1"){
Conditions:
Switch("Switch1", set);

Actions:
Play WAV(YOUR WAV HERE);
Wait(0);
Set Switch("Switch1", clear);
Preserve Trigger();
}


The death-count method is nice too, though. If you are afraid of running out of death-counts and don't expect to have multiple shared sounds playing at the exact same instance, you can do what I usually do and have a single death-count labeled "Message" connected to all the different shared sounds and text messages (so the first sound would use a value of 1, the second a value of 2, and so on).



None.

Oct 8 2010, 12:37 am samsizzle Post #10



what I usually do for sounds that you want everyone to hear is have a DC called _sound and whenever you want a certain sound to be played for example sound 1 you would set the _sound dc to 1 and leave it set until the beginning of the current players cycle. so the two triggers you would have so far are
Conditions:
Always

Actions:
Set deaths for currentplayer to 0 for _sound
Preserve Trigger


Conditions:
Blah Blah Blah something happens that causes a sound...

Actions:
Set deaths for currentplayer to 1 for _sound
Preserve Trigger


So after those triggers you have a trigger that checks if ANYONES dc is set to 1 and play sound 1. It wont repeat because the _sound DC is cleared every cycle. Like this:

Conditions:
All players has suffered Exactly 1 death of _sound

Actions:
Play Wav "sound1"
Preserve Trigger




None.

Oct 8 2010, 12:50 am FoxWolf1 Post #11



Quote from samsizzle
what I usually do for sounds that you want everyone to hear is have a DC called _sound and whenever you want a certain sound to be played for example sound 1 you would set the _sound dc to 1 and leave it set until the beginning of the current players cycle. so the two triggers you would have so far are
Conditions:
Always

Actions:
Set deaths for currentplayer to 0 for _sound
Preserve Trigger


Conditions:
Blah Blah Blah something happens that causes a sound...

Actions:
Set deaths for currentplayer to 1 for _sound
Preserve Trigger


So after those triggers you have a trigger that checks if ANYONES dc is set to 1 and play sound 1. It wont repeat because the _sound DC is cleared every cycle. Like this:

Conditions:
All players has suffered Exactly 1 death of _sound

Actions:
Play Wav "sound1"
Preserve Trigger

If you put the set deaths to 0 action into the same trigger as the "Play wav" action, you'll reduce your constant trigger firings and your total triggers by one each. Just use a "current player" condition instead of an all players in the sound-playing trigger, and an all-players instead of a current player in the deaths-set-to-1 trigger.



None.

Oct 8 2010, 12:59 am Azrael Post #12



Quote from FoxWolf1
If you put the set deaths to 0 action into the same trigger as the "Play wav" action, you'll reduce your constant trigger firings and your total triggers by one each.

This is how I do it.




Oct 8 2010, 1:11 am Vrael Post #13



Quote from Aristocrat
Quote from Vrael
If you use that trigger, all players will hear the sound like you think. However, each player can only execute 1 Wait() action at any given time, so its advisable to avoid using that.
No, they won't hear the sound, and the trigger not working is not due to waits. If you clear the switch when player 1 first runs the trigger, then when player 2 runs the trigger's conditional check, the condition "Switch is set" will no longer be true, making the sound only work for player 1.
Just to clarify the actual explanation of this, it will work. Since the Wait(2000) is inbetween the "play wav" and "set switch" actions, the starcraft engine will execute the "play wav" for Player 1, skip the "set switch", finish executing the remainder of Player 1's triggers, then move on to the next player and repeat the process. Since the "set switch" action is never executed for any player, the condition will remain true and all players in the force will hear the sound, just as FoxWolf1 validated for us with his Wait(0) testing. After 2000 ms of elapsed time, the "set switch" action will be executed. The only difference between the Wait(0) and Wait(2000) methods is that with the Wait(0) the "set switch" action will occur in the next trigger cycle, and with the Wait(2000) there will be multiple trigger cycles inbetween the "play wav" and the "set switch" actions.

Quote from DrZygote214
You can also do that with gas right? This would probably be better because you can have almost infinite gas, whereas there are a limited number of units to use as death counters.
You can do it with gas yes, but I think you misunderstand deathcounters. For each death counter there are 8 players, and they can hold 2^31 values. Switches can only be "set" or "clear", but death counters can hold any number between 0 - 2^31. For each DC you essentially have 8 variables, and the usefulness comes from the fact that "Current Player" used in conjunction with DC's will refer to whichever player's triggers is currently under execution.



None.

Oct 8 2010, 4:24 am rockz Post #14

ᴄʜᴇᴇsᴇ ɪᴛ!

Quote from DrZygote214
I still find it a pain though because this will have to be done for every sound and every text message. If there are any easier or at least similar alternatives, let me know.
Use find/replace with text triggers. Replace "switch1" with "deaths of cantina" or whatever.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:05 am]
Moose -- ya
[05:23 am]
zsnakezz -- yes
[2024-5-12. : 8:51 pm]
l)ark_ssj9kevin -- Are you excited for Homeworld 3?
[2024-5-12. : 8:44 pm]
l)ark_ssj9kevin -- Hi Brusilov
[2024-5-12. : 4:35 pm]
O)FaRTy1billion[MM] -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
my server that was hosting it died
[2024-5-10. : 8:46 pm]
NudeRaider -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
https://armoha.github.io/eud-book/
[2024-5-10. : 8:36 am]
Brusilov -- Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
[2024-5-09. : 11:31 pm]
Vrael -- :wob:
[2024-5-09. : 8:42 pm]
Ultraviolet -- :wob:
[2024-5-08. : 10:09 pm]
Ultraviolet -- let's fucking go on a madmen rage bruh
Please log in to shout.


Members Online: Ultraviolet