Ping map when selecting unit

D

dArKzEr0

Guest
Hi, I'm trying to make a trigger where when a unit is selected, it will ping the map where all enemy units are located once every 45 seconds, but the trigger isn't working. Here it is:

Code:
GPSPing
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
        Player - Player 7 (Green) Selects a unit
        Player - Player 8 (Pink) Selects a unit
        Player - Player 9 (Gray) Selects a unit
        Player - Player 10 (Light Blue) Selects a unit
        Player - Player 11 (Dark Green) Selects a unit
        Player - Player 12 (Brown) Selects a unit
    Conditions
        (Unit-type of (First unit of group (Units currently selected by (Triggering player)))) Equal to Anti-Camp
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Remaining time for Satellite_Timer[(Player number of (Triggering player))]) Less than or equal to 0.01
            Then - Actions
                Player Group - Pick every player in (All enemies of (Triggering player)) and do (Actions)
                    Loop - Actions
                        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Unit-type of (Picked unit)) Equal to Elite Sniper
                                    Then - Actions
                                        Set Satellite_Timer[(Player number of (Triggering player))] = (Create a periodic One-shot timer lasting 45.00)
                                        Cinematic - Ping minimap for (All allies of (Triggering player)) at (Position of (Picked unit)) for 1.00 seconds, using a Simple ping of color (100.00%, 10.00%, 10.00%)
                                    Else - Actions
                                        Do nothing
            Else - Actions
                Game - Display to (Triggering player), at offset (0.00, 0.00) the text: Satellite Tracking ...

Anybody see the problem?

I'm assuming it has something to do with my event, condition, or the "if" in my if/then, because absolutely nothing happens when I select the unit "Anti-camp".

dArKz
 
Stationary unit, as a matter of fact, it doesn't even have a model file... It's a hero selectable by clicking a "hero icon" button toward the top-left of the screen. The hero name is "Anti-camp" as it appears in the trigger.

dArKz
 
so it is ONE unit, and it never moves, and you want it to ping were this stationary unit is evry 45 secs?
 
No, the purpose of it is that when the owning unit clicks the hero icon for the "stationary unit" (as you call it) it will ping the minimap w/ the location of all enemy units. The timer is so that you can only use this ping once every XX seconds.

dArKz
 
I think your problem has to do with your conditions. Try making a boolean variable for Anti_Camp_Usable and then checking against that in the if/then/else block.

Code:
Events:...

Conditions:...

If- Anit_Camp_Usable equal to True
Then-...[ping stuff]
          Set Anti_Camp_Usable to False
          Trigger - Run Helper Trigger (Checking Conditions)
Else-....

Code:
Helper Trigger

Events: n/a

Conditions: n/a

Actions:
custom script: call PolledWait (45)
set Anti_Camp_Usable equal to True

The extra trigger was just to remove a 45 second wait from the other trigger feel free to include it all in one trigger.

I feel the main problem was just checking again the time of a countdown-timer that didn't exist.

Good luck.
 
Well, the countdown timer did exist though. I set in my map initialization "Set 'Timer' = 2 seconds" or however the action goes, and that still didn't work. I guess I'll try your way though.

dArKz

//Edit:

Ok, I changed it to what you said but it still doesn't work. Here's my new trigger:

Code:
GPSPing Copy
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
        Player - Player 7 (Green) Selects a unit
        Player - Player 8 (Pink) Selects a unit
        Player - Player 9 (Gray) Selects a unit
        Player - Player 10 (Light Blue) Selects a unit
        Player - Player 11 (Dark Green) Selects a unit
        Player - Player 12 (Brown) Selects a unit
    Conditions
        (Unit-type of (First unit of group (Units currently selected by (Triggering player)))) Equal to Anti-Camp
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Satellite_Boolean[(Player number of (Triggering player))] Equal to True
            Then - Actions
                Player Group - Pick every player in (All enemies of (Triggering player)) and do (Actions)
                    Loop - Actions
                        Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Unit-type of (Picked unit)) Equal to Elite Sniper
                                    Then - Actions
                                        Set Satellite_Boolean[(Player number of (Triggering player))] = False
                                        Cinematic - Ping minimap for (All allies of (Triggering player)) at (Position of (Picked unit)) for 1.00 seconds, using a Simple ping of color (100.00%, 10.00%, 10.00%)
                                        Custom script: call PolledWait (45)
                                        Set Satellite_Boolean[(Player number of (Triggering player))] = True
                                    Else - Actions
                                        Do nothing
            Else - Actions
                Game - Display to (Triggering player), at offset (0.00, 0.00) the text: Satellite Tracking ...
 
Your right the problem is the do with the events.
Code:
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
        Player - Player 7 (Green) Selects a unit
        Player - Player 8 (Pink) Selects a unit
        Player - Player 9 (Gray) Selects a unit
        Player - Player 10 (Light Blue) Selects a unit
        Player - Player 11 (Dark Green) Selects a unit
        Player - Player 12 (Brown) Selects a unit
This will only happen if every player selects a unit at the exact same time. Which I believe is impossible considering the warcraft engine.

I'm not sure you can use 'or' in events(I'm at school so I can't check) so you'll just have to have a trigger for each player. Or use a different event and rewrite your trigger.

It may have other problems but that the most obvious one.
 
Nah, I'm pretty sure that's not the problem, as I've used events like that before and they have worked worked fine. Anything else? :confused:

dArKz
 
Ok, first off those Events are fine. Events in a trigger are just a list of events in the WC3 engine that will call that function (trigger) so only 1 Event in the list must occur for a trigger to 'happen'.

Heres a suggestion, make a trigger with the same events and conditions (disable the original trigger) and have 1 action:

Game - Display Message to (All Players): (Name of Triggering Player) + ( has selected the Anti_Camp)

And see if that works. If not, your condition is wrong, otherwise, you have a problem with your actions. (Those seem alright to me)
 
Events ar OR'ed, the same way Conditions are AND'ed.
A trigger, to be triggered, needs that occurs ONE of its events and ALL of the conditions.

dArKzEr0 said:
Code:
If - Conditions
    (Unit-type of (Picked unit)) Equal to Elite Sniper
This means you only want to Ping the enemy units of Elite Sniper type.
Is that right?

dArKzEr0 said:
Code:
Set Satellite_Boolean[(Player number of (Triggering player))] = False
Cinematic - Ping minimap for (All allies of (Triggering player)) at (Position of (Picked unit)) for 1.00 seconds, using a Simple ping of color (100.00%, 10.00%, 10.00%)
Custom script: call PolledWait (45)
Set Satellite_Boolean[(Player number of (Triggering player))] = True
Move the boolean var setting and the polled wait outside the loops.
Code:
If variable equals TRUE
    Set variable to FALSE
    Do all the pings
    Call a polled wait
    Set variable to TRUE
Else
    ...
Also be sure all Satellite_Boolean values are set to TRUE at map initialization
 
Wow really? Guess I'll just have to sort through your code then.

What is it that your code doesn't do? Does it ping all this random stuff or does it ping at all?
 
I followed Laika's advice and made this trigger:

Code:
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
        Player - Player 7 (Green) Selects a unit
        Player - Player 8 (Pink) Selects a unit
        Player - Player 9 (Gray) Selects a unit
        Player - Player 10 (Light Blue) Selects a unit
        Player - Player 11 (Dark Green) Selects a unit
        Player - Player 12 (Brown) Selects a unit
    Conditions
        (Unit-type of (First unit of group (Units currently selected by (Triggering player)))) Equal to Anti-Camp
    Actions
        Game - Display to (Triggering player), at offset (0.00, 0.00) the text: Testing!

And, as it turns out, that didn't work either. Apparently my condition is incorrect, but I'm not sure what I could possibly change it to.

xPheRe: What you're saying makes sense, its pointless to loop the wait, but unfortunately, thats not my problem :( .

Jazradel: It pings nothing at all, it doesn't DO anything at all.


dArKz
 
oh... it says in the editor you shouldn't use the 'units selected' option in an trigger condition.

i would suggest you just make an ability and give it to the anti camp hero.
 
That defeats the entire point of this entire thread :( .

(Looks toward the sky)
Is there no other way?

I guess I'll have to do it the easy way after-all.

dArKz
 
Try:

Code:
first trigger:
E - Player 1-12 selects a unit
C - Unit Type select is the Stationery Unit
     BooleanFoo is FALSE
A - Pick every enemy unit and Ping it
   - set BooleanFoo to TRUE
   - Run second trigger


Second trigger:
E - none
C - BooleanFoo is TRUE
A - (Poll) Wait 45 seconds
     BooeanFoo to FALSE
 
E - Player 1-12 selects a unit
C - Unit Type select is the Stationery Unit

That's exactly what we've determined does NOT work... :(

dArKz
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    Today I had to scramble, I didn't work most of dinner service and no one told me shit. They had a rough few hours lol
  • Varine Varine:
    I have two salmon, Sockeye and Atlantic. Atlantic is used for the kids salmon and the salmon and beet salad, and can also be added onto any dish or just as a side. Atlantic salmon will almost exclusively ever be FARMED, as it is endangered in the wild, and we ALWAYS cut them to 4 ounces.
  • Varine Varine:
    SOCKEYE salmon, very different and this IS wild caught. We have an ENTREE version, and an add on version. The entree is 7 ounces, the add on is 4. Why? Because that is how someone that wasn't me set up the computer.
  • Varine Varine:
    I had to have this conversation like ten fucking times tonight
  • Varine Varine:
    The issue being, I came into work and had none of this whatsoever
  • Varine Varine:
    No one told me shit
  • Varine Varine:
    So, taking into consideration that what I typed out up there is kind of some fucking nonsense that under normal circumstances no one really needs to fucking be able to explain in any rational way
  • Varine Varine:
    Let alone trying to figure it out from a wildly stressed out me that is also on a phone call trying to get something to show up from Seattle tomorrow while trying to explain this salmon situation, that also is barely solved in maybe a few hours and and but I am bulking it with a few steelhead filets I have and that is a WHOLE fucking different thing to the 19 year old server that got put on day shift C crew that doesn't know who I am.
  • Varine Varine:
    I did however really want days. I like getting off at 4 half the time, and that makes it worth it!
  • Varine Varine:
    Also I hate my job right now but I think that was the hard part. Now it's just work
  • Varine Varine:
    @jonas I'm sorry? I don't know what you're referring to.
  • Varine Varine:
    Once we hit winter I feel like I get to back to having a pretty cool job. Like I bitch about it all the time, but it's work. I'm still gonna bitch
  • Varine Varine:
    All in all though I think this summer is going really well. Some complicated things, but at the end of the day it isn't THAT big of a deal. Not all of our servers have quite realized they are technically sales
  • Varine Varine:
    Like yeah it is a substitute, but FOMO. Chef isn't getting this again this year, he has to figure it out, so it's slightly off on the menu, but that is more or less the LOWEST quality and price. Right now, steelhead is a real stealhear, right?
  • Varine Varine:
    Like fuck off even I can do it
  • Varine Varine:
    I am going to get one of my servers to do that in her server voice and you'll see my point
  • Varine Varine:
    Maybe the bartender. Idk, it's one of my favorite things to hear them go from calm to customer service voice. They will translate it to like "The chef is trying to change that a bit right now so he does have a Alaskan river steelhead. Yeah like the one you might fish probably!" And then the girls can bat their eyes and do pretty girl server shit
  • Varine Varine:
    At least that's how imagine some of them. Did you know mayonnaise is dairy free? A suprisingly amount of people don't\
  • The Helper The Helper:
    mayo is eggs right?
  • The Helper The Helper:
    Seems I never watched the Witcher - looks like i have a lot of content
  • The Helper The Helper:
    Season 1 Episode 8 the marathon continues...
  • jonas jonas:
    mayo is eggs & oil
    +1
  • The Helper The Helper:
    I got halfway season 2 on The Witcher and it lost me. I am going to have to pick this one up again later.
  • jonas jonas:
    season 2 is with the new actor right? it's so far below the first one
  • The Helper The Helper:
    first season was good the 2nd season is bleh I hope I can make it through it for 3

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials
      Top