• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Need help to make trigger

Level 5
Joined
May 11, 2008
Messages
27
So... i get many search hits on the net for "convert jass to lua", but i need the opposite thing! Which i cant figure out.
I am super low level in jass. Use it only when need things outside gui possibilities (local variable, damage detection system, etc.). All my jass triggers in my maps are blind stumbling trying to copy stuff from other people... (which miraculously ends up working out for me).

Can some1 rewrite this LUA thing into jass for me, please. So it just would be copy paste ready...
To my understanding, this trigger fires at "Time - Elapsed game time is 0.00 seconds" event and hides/removes save menu from options. And prevents from writing text in it too.
I think for people good in jass this is like 2 min job 😅
(before you ask, pre reforged save disables that display dialog button on save event to interupt it doeas not work in reforged version)
Thank you very much.

LUA:
export function hideGameButtons() {
let hideGameButtons = CreateTrigger();
TriggerRegisterTimerEventSingle(hideGameButtons, 0.00);
TriggerAddAction(hideGameButtons, () => {
BlzFrameSetVisible(BlzGetFrameByName("EscMenuSaveLoadContainer", 0), false);
BlzFrameSetEnable(BlzGetFrameByName("SaveGameFileEditBox" , 0), false);
});
}
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
vJASS:
function HideGameButtons takes nothing returns nothing
    call BlzFrameSetVisible(BlzGetFrameByName("EscMenuSaveLoadContainer", 0), false)
    call BlzFrameSetEnable(BlzGetFrameByName("SaveGameFileEditBox" , 0), false)
endfunction
You can call this function whenever you want, although I recommend doing it after the 0.01 second mark:
  • Events
    • Game - Elapsed game time is 0.01 seconds
  • Conditions
  • Actions
    • Custom script: call HideGameButtons()
Also, that code is written in TypeScript, not Lua, but it would convert to Lua in the end.
 
Last edited:
Level 5
Joined
May 11, 2008
Messages
27
Thank you. I managed to get it working in reforged version of the game. Trigger looks:


function Trig_HideGameButtons_Actions takes nothing returns nothing
call BlzFrameSetVisible(BlzGetFrameByName("EscMenuSaveLoadContainer", 0), false)
call BlzFrameSetEnable(BlzGetFrameByName("SaveGameFileEditBox" , 0), false)
endfunction

//===========================================================================
function InitTrig_HideGameButtons takes nothing returns nothing
set gg_trg_HideGameButtons = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_HideGameButtons, 0.00 )
call TriggerAddAction( gg_trg_HideGameButtons, function Trig_HideGameButtons_Actions )
endfunction


Now question:
Is it totally incompatible with older, pre-reforged game versions?
in older version it gives me "Symbol not declared" errors on BlzFrameSetVisible and BlzFrameSetEnable.
Is it because these are "actions" only in reforged game with its updated UI?

Thing is: I make map in older game version, so it is playable for everyone.
Any ideas how make this work for both worlds?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
Thank you. I managed to get it working in reforged version of the game. Trigger looks:


function Trig_HideGameButtons_Actions takes nothing returns nothing
call BlzFrameSetVisible(BlzGetFrameByName("EscMenuSaveLoadContainer", 0), false)
call BlzFrameSetEnable(BlzGetFrameByName("SaveGameFileEditBox" , 0), false)
endfunction

//===========================================================================
function InitTrig_HideGameButtons takes nothing returns nothing
set gg_trg_HideGameButtons = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_HideGameButtons, 0.00 )
call TriggerAddAction( gg_trg_HideGameButtons, function Trig_HideGameButtons_Actions )
endfunction


Now question:
Is it totally incompatible with older, pre-reforged game versions?
in older version it gives me "Symbol not declared" errors on BlzFrameSetVisible and BlzFrameSetEnable.
Is it because these are "actions" only in reforged game with its updated UI?

Thing is: I make map in older game version, so it is playable for everyone.
Any ideas how make this work for both worlds?
You'll need to be patch 1.31 or above to use the custom frame stuff.

Also, you don't need to buy Reforged to play on the latest patch, so there isn't really a "Reforged version" but I understand what you mean. Buying Reforged simply unlocks the HD graphics as far as I understand.
 
Top