• 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.

Disable quick saving with F6 - Possible?

Level 12
Joined
Nov 13, 2010
Messages
277
try

Event:
OSKEY Event - F6 Key Pressed
Condition:
Action:
-Game - Pause game
-Wait 0.01 seconds
-Game - Unpause game

or

JASS:
function InitTrig_DisableQuickSave takes nothing returns nothing   
local trigger t = CreateTrigger()   
call TriggerRegisterPlayerEventOsKey(t, Player(0), OSKEY_F6, true)   
call TriggerAddAction(t, function DisableQuickSave_Actions)
endfunction
 
try

Event:
OSKEY Event - F6 Key Pressed
Condition:
Action:
-Game - Pause game
-Wait 0.01 seconds
-Game - Unpause game

or

JASS:
function InitTrig_DisableQuickSave takes nothing returns nothing  
local trigger t = CreateTrigger()  
call TriggerRegisterPlayerEventOsKey(t, Player(0), OSKEY_F6, true)  
call TriggerAddAction(t, function DisableQuickSave_Actions)
endfunction
Didn't work unfortunately, the game still saves.
 
it was just an ider to try to Disable f6
Should have phrased my question differently. Since my map is in Lua mode, I asked if the map would compile with your JASS code, if I removed the "call" prefixes. It does not compile though, already tested. Got compilation errors, so I have to make a new Lua function the proper way instead. I'll see what I can do, and let you know if it works.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Should have phrased my question differently. Since my map is in Lua mode, I asked if the map would compile with your JASS code, if I removed the "call" prefixes. It does not compile though, already tested. Got compilation errors, so I have to make a new Lua function the proper way instead. I'll see what I can do, and let you know if it works.
Lua and JASS use the same API, it's the same old Warcraft 3 that you're used to.

It's just that different programming languages have different syntax rules:
Lua:
function Test()
    local t = CreateTrigger()
    BlzTriggerRegisterPlayerKeyEvent(t, Player(0), OSKEY_F6, 0, true)
    TriggerAddAction(t, function()
        print("F6 pressed")
        PauseGameOn()
        TriggerSleepAction(0.2)
        PauseGameOff()
    end)
end
Anyway, polardude did not provide the DisableQuickSave_Actions function in his example so I added it in the above code. But like Polar said, this probably doesn't work even if you can get it to compile.

Another possible solution would be to disable the frame(s) related to saving.
 
Last edited:
Lua and JASS use the same API, it's the same old Warcraft 3 that you're used to.

It's just that different programming languages have different syntax rules:
Lua:
function InitTrig_DisableQuickSave()
    local t = CreateTrigger()
    TriggerRegisterPlayerEventOsKey(t, Player(0), OSKEY_F6, true)
    TriggerAddAction(t, function()
        PauseGameOn()
        TriggerSleepAction(0.2)
        PauseGameOff()
    end)
end
Anyway, polardude did not provide the DisableQuickSave_Actions function in his example so I added it in the above code. But like Polar said, this probably doesn't work even if you can get it to compile.

Another possible solution would be to disable the frame(s) related to saving.
Thanks! Although, that didn't work unfortunately.

The solution I have come up with for now is to just ruin the quicksave file by removing units before it's saved, locking the camera, fading to black, and disabling all functions. That way, if they load the quicksave file, they just load into black nothingness. Kinda sucks, since the players unsaved progress will be lost, but that's a mistake they only do one time.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Thanks! Although, that didn't work unfortunately.

The solution I have come up with for now is to just ruin the quicksave file by removing units before it's saved, locking the camera, fading to black, and disabling all functions. That way, if they load the quicksave file, they just load into black nothingness. Kinda sucks, since the players unsaved progress will be lost, but that's a mistake they only do one time.
It was the wrong Event, I updated the code. Although, the Pausing doesn't seem to work.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Ruining the save file it is then :p
How about manipulating the save at the time of pressing the hotkey?

Here I am trying to load the game:
Lua:
function Test()
    local trigger = CreateTrigger()
    BlzTriggerRegisterPlayerKeyEvent(trigger, Player(0), OSKEY_F6, 0, true)
    TriggerAddAction(trigger, function()
        print("F6 pressed")
        LoadGameBJ( "LoadFile.w3z", false )
    end)
end
Maybe you can load an older save or something, unsure how this all works.
 
How about manipulating the save at the time of pressing the hotkey?

Here I am trying to load the game:
Lua:
function Test()
    local trigger = CreateTrigger()
    BlzTriggerRegisterPlayerKeyEvent(trigger, Player(0), OSKEY_F6, 0, true)
    TriggerAddAction(trigger, function()
        print("F6 pressed")
        LoadGameBJ( "LoadFile.w3z", false )
    end)
end
Maybe you can load an older save or something, unsure how this all works.
In what way does this manipulate the save file? I tried it, but the game saved fine, and I could load the generated save file. I see you attempt to load a file called LoadFile.w3z, but that didn't do anything I think.

As for loading an older save, sure, but a quicksave file will still be generated that players can load, making save scumming possible (or at least easier).
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
In what way does this manipulate the save file? I tried it, but the game saved fine, and I could load the generated save file. I see you attempt to load a file called LoadFile.w3z, but that didn't do anything I think.

As for loading an older save, sure, but a quicksave file will still be generated that players can load, making save scumming possible (or at least easier).
You have to edit the code to work for your map since I don't know the name of your save files. That's just the load game function from GUI converted to code.
1730411095630.png

It's also just an idea. There are a bunch of actions related to saving/loading that you can experiment with.

Detecting the F6 hotkey gives you a way to intercept the quick save process, either before or after it generates the file.
 
You have to edit the code to work for your map, I don't know the name of your save files. It's also just an idea. There are a plethora of actions related to saving/loading that you can experiment with.
Aha right, makes sense. Basically you're trying to load another save before the game can save a quicksave file?
 
Top