1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  4. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[General] Minimap UI Button Detection

Discussion in 'World Editor Help Zone' started by HappyTauren, Sep 6, 2012.

  1. HappyTauren

    HappyTauren

    Joined:
    Nov 3, 2006
    Messages:
    8,408
    Resources:
    87
    Models:
    61
    Icons:
    23
    Packs:
    1
    Tutorials:
    2
    Resources:
    87
    Is it possible to detect any of the minimap button (ping, creep camps etc) click events? If not directly, then, indirectly, by checking some values?
     
  2. Elfansoer

    Elfansoer

    Joined:
    Aug 26, 2012
    Messages:
    122
    Resources:
    0
    Resources:
    0
    How about using Camera Events?
    (He means that when you clicked the minimap, the camera will go there, won't it?)
     
  3. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Never heard of that, going to check it out right now (don't pings change the spacebar location? Maybe like that... although there are many things that change the spacebar location :p).

    I already found something like
    Code (vJASS):
    GetAllyColorFilterState( )

    I'll go check it out when combined with local players to see if it works. Going to keep you updated :D

    Edit:
    Code (vJASS):
    function getFilters takes nothing returns nothing
        local integer i = 0
        local integer colorFilter
        local boolean creepFilter
       
        loop
            exitwhen i == 16
           
            if GetLocalPlayer() == Player(i) then
                // 0 = no filter
                // 1 = minimap colors filtered
                // 2 = all colors filtered
                set colorFilter = GetAllyColorFilterState( )
                // true = creep camps on
                // false = creep camps off
                set creepFilter = GetCreepCampFilterState( )
            endif
           
            set i = i+1
        endloop
    endfunction

    This works as intended. You can loop through this and see when something has changed.
    I couldn't find anything for the formations, terrain toggle and ping (aside from the spacebar location).
     
  4. HappyTauren

    HappyTauren

    Joined:
    Nov 3, 2006
    Messages:
    8,408
    Resources:
    87
    Models:
    61
    Icons:
    23
    Packs:
    1
    Tutorials:
    2
    Resources:
    87
    Thanks, it works extremely well :D However, I've been wondering, is it at all possible to detect those three you haven't?
     
  5. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    I thought I had an idea for the formation, but it probably won't work because triggers don't pay attention to the formation :p

    (I thought of creating a melee and ranged unit and let them do a very short race to a region - the thing is that the ranged unit would have a head-start. If formation is on, the ranged unit would be last because he would wait for the melee unit to pass first, if formation is on he would be first).
    Didn't test it, but you need to select those units at the same time and order them to move, otherwise the formation won't activate.

    I've looked at many functions, but couldn't find anything relevant There are some of which I have no clue what they do :p (such as SetUnitTypeSlots takes unit, integer).
    Maybe the answer lies within those unknown functions, but I certainly couldn't find it.


    The ping is still plausible though. What can change spacebar locations? As far as I know it's always with a unit (or structure) at the center. So if the spacebar location is different from the previous one and does not have a unit at its center (you can check within a reasonable range), then it must be a ping.
    The main problem is that you can ping at units as well, which would completely ruin the idea :p

    Besides that, I can't be of any more help. I hope others will still look at this thread.
     
  6. HappyTauren

    HappyTauren

    Joined:
    Nov 3, 2006
    Messages:
    8,408
    Resources:
    87
    Models:
    61
    Icons:
    23
    Packs:
    1
    Tutorials:
    2
    Resources:
    87
    Hmm, as far as the ping goes - is there a function that returns the spacebar point? I have no issues with other things setting it, so I am good :D
     
  7. ap0calypse

    ap0calypse

    Joined:
    Jan 26, 2007
    Messages:
    4,777
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Brilliant question, seems like I've failed quite a bit :p
    There is something called
    SetCameraQuickPosition( ... )
    , which sets the spacebar location, but there is no
    GetCameraQuickPosition( ... )
    .
    Seems like I misread that at first, which is pretty stupid of me. Why didn't Blizzard add that? D:
    (Even though there are multiple of them per player, they could at least return the latest one).

    Sorry about that :3
     
  8. edo494

    edo494

    Joined:
    Apr 16, 2012
    Messages:
    3,846
    Resources:
    5
    Spells:
    1
    JASS:
    4
    Resources:
    5
    You know, blizzard... :D