HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

player group display and ping

04-03-2004, 10:52 PM#1
xtacb
ok i want to add a trigger that when a certain spell is cast, all players besides the ones who have a unit in the radius will get a message and a ping that they "heard a loud explosion"
A separate trigger is
spelltarget
Events
Unit - A unit Begins casting an ability
Actions
Set spelltarget = (Position of (Casting unit))

(there are 3 separate actions in this)
Ping and display
Unit - A unit Finishes casting an ability
Actions
first main action - Unit Group - Pick every unit in (Units within 2512.00 of spelltarget) and do (Actions)
Loop - Actions
Player Group - Add (Owner of (Picked unit)) to spellradius

second main action - Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
Player Group - Add (Owner of (Picked unit)) to spellgroup

third main action - Player Group - Pick every player in spellradius and do (Actions)
Loop - Actions
Player Group - Remove (Picked player) from spellgroup
Game - Display to spellgroup for 1.00 seconds the text: Loud Explosion heard!
Cinematic - Ping minimap for spellgroup at spelltarget for 1.00 seconds, using a Simple ping of color (20.00%, 20.00%, 100.00%)

The thing is, it will ping and display the message more than once for every spell, it will ping and display the message the same number as the number of players in the spellgroup
if there were 5 players added and that needed to get the ping and message, all 5 would get it 5 times
if there were 7 then all 7 players would get pinged and the message 7 times each

how do i fix it so it will only ping and message once to each player in the playergroup?
04-04-2004, 03:15 AM#2
ThyFlame
Post the trigger inside [ code][/code] tags

I can't tell what is where, exactly.
04-04-2004, 09:07 PM#3
xtacb
im not sure how to do the code/code tag thing so i just edited my 1st post, should be easier to understand

Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
Player Group - Add (Owner of (Picked unit)) to spellgroup

how would i check to see if a player is in the group already if adding duplicates or the same player in the player group is the problem?
04-06-2004, 04:53 AM#4
xtacb
ok this is what i have now ,spellgroup and spellarea are player group variables

Code:
spellfire
    Events
        Unit - A unit Finishes casting an ability
    Conditions
    Actions
        Unit Group - Pick every unit in (Units within 2512.00 of spelllocation) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Owner of (Picked unit)) is in spellarea) Equal to False
                    Then - Actions
                        Player Group - Add (Owner of (Picked unit)) to spellarea
                    Else - Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Owner of (Picked unit)) is in spellgroup) Equal to False
                    Then - Actions
                        Player Group - Add (Owner of (Picked unit)) to spellgroup
                    Else - Actions
        Player Group - Pick every player in spellarea and do (Actions)
            Loop - Actions
                Player Group - Remove (Picked player) from spellgroup
                Game - Display to spellgroup for 1.00 seconds the text: Spell heard!
                Cinematic - Ping minimap for spellgroup at spelllocation for 1.00 seconds, using a Simple ping of color (20.00%, 20.00%, 100.00%)

when i tried it by myself with computers it seems to work fine, but when i played it on bnet when a spell was cast, it showed the message and pinged twice instead of just once

any idea why it does this?