• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Turn off map

Status
Not open for further replies.
Level 2
Joined
May 18, 2022
Messages
9
Hello Guys&Ladies
Is it possible to turn off minimap via trigger ?
I need to turn of minimap for triggering player for example 10 seconds and then bring the map back. Should somone help ?
Thanks Wormskayy
 

Uncle

Warcraft Moderator
Level 72
Joined
Aug 10, 2018
Messages
7,682
Everything related to ui:

I've got it working like so. Create a new custom script file in the Trigger Editor (Control + U) and add this code to it:
vJASS:
function HideMinimapForPlayer takes player p returns nothing
if GetLocalPlayer() == p then
    call BlzFrameSetVisible(BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP, 0), false)
endif
endfunction

function ShowMinimapForPlayer takes player p returns nothing
if GetLocalPlayer() == p then
    call BlzFrameSetVisible(BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP, 0), true)
endif
endfunction
Make sure JassHelper is enabled (look at the top window of the Trigger Editor and you'll see a menu for it).

Then you can run these functions in your triggers:
  • Actions
    • Set Variable MinimapPlayer = (some player)
    • Custom script: call HideMinimapForPlayer(udg_MinimapPlayer)
    • Wait 10.00 game-time seconds
    • Set Variable MinimapPlayer = (some player)
    • Custom script: call ShowMinimapForPlayer(udg_MinimapPlayer)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,273
Provided trigger uses JASS. If you are using Lua you will need to port it to Lua first.

Also requires newer versions of Warcraft III with UI native support. Legacy versions might be lacking those natives.

Traditionally (long long ago) the way to kind of do what you want was to import a blank minimap image and then dynamically set map camera bounds so that the minimap showed no useful information. There might have been more or less polished variants of that approach but that was likely the only sensible way before UI natives were added.
 
Level 24
Joined
Jun 26, 2020
Messages
1,923
Everything related to ui:

I've got it working like so. Create a new custom script file in the Trigger Editor (Control + U) and add this code to it:
vJASS:
function HideMinimapForPlayer takes player p returns nothing
if GetLocalPlayer() == p then
    call BlzFrameSetVisible(BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP, 0), false)
endif
endfunction

function ShowMinimapForPlayer takes player p returns nothing
if GetLocalPlayer() == p then
    call BlzFrameSetVisible(BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP, 0), true)
endif
endfunction
Make sure JassHelper is enabled (look at the top window of the Trigger Editor and you'll see a menu for it).

Then you can run these functions in your triggers:
  • Actions
    • Set Variable MinimapPlayer = (some player)
    • Custom script: call HideMinimapForPlayer(udg_MinimapPlayer)
    • Wait 10.00 game-time seconds
    • Set Variable MinimapPlayer = (some player)
    • Custom script: call ShowMinimapForPlayer(udg_MinimapPlayer)
I have understood that calling BlzGetOriginFrame() for the first time in a GetLocalPlayer() block may cause a desync, so for safety reasons it would be better do something like this:
vJASS:
globals
    framehandle Minimap = null
endglobals

function HideMinimapForPlayer takes player p returns nothing
    if Minimap == null then
        set Minimap = BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP, 0)
    endif
    if GetLocalPlayer() == p then
        call BlzFrameSetVisible(Minimap, false)
    endif
endfunction

function ShowMinimapForPlayer takes player p returns nothing
    if Minimap == null then
        set Minimap = BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP, 0)
    endif
    if GetLocalPlayer() == p then
        call BlzFrameSetVisible(Minimap, true)
    endif
endfunction
 
Level 2
Joined
May 18, 2022
Messages
9
Thanks guys. I will try it when i will be home. I need to check jass also. I think i have older version of WE. But thanks a lot
 
Status
Not open for further replies.
Top