• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Saving the game with triggers?

Status
Not open for further replies.
Level 9
Joined
Apr 19, 2011
Messages
447
Hi.

I need help with a trigger for saving the map. Basicly, the player won't be able to save the game with the classic method. He will have to find a place called "Save Point" if he wants to save.
Okay, I know how to avoid the player from saving. However, when he is in the Save Point, he will have to save from a custom menu, and I need a way to save the game with a trigger. In the default WE actions, I have only seen "Save Game and Load Game" and "Save Game and Change Level".
:goblin_jawdrop:
Is there a way to just save the game? I don't want to load anything, nor change the level! Maybe a custom script...?

Thanks in advance.

Regards
 
Level 4
Joined
Jul 15, 2012
Messages
89
  • Save
    • Actions
      • Game - Save game as Save1.w3z and load <Empty String> (Skip scores)
to load it :
  • Load
    • Actions
      • Game - Load save1.w3z (Skip scores)
 
Level 9
Joined
Apr 19, 2011
Messages
447
I have some problems... I'm using the [call SaveGame()] custom script Pharaoh_ said, but I can't load the game once I save it. After saving the game that way, I go back to WC3 main menu and go to "Load Game", but my saved game is not there.
Why?

Here's the trigger. The custom script is marked with a comment.

  • Save
    • Events
      • Dialog - A dialog button is clicked for Save_Dialog
    • Conditions
      • (Clicked dialog button) Igual a Save_Yes
    • Actions
      • Dialog - Hide Save_Dialog for Player 1 (red)
      • Dialog - Clear Save_Dialog
      • Sound - Play Select <gen>
      • Unit - Remove MENU_Button_02 from the game
      • Set LEAK_Remove = (Center of MENU Button 02 <gen>)
      • Unit - Create 1 Button (Static) for Neutral pasive at LEAK_Remove facing 270.00 degrees
      • Set MENU_Button_02 = (Last created unit)
      • Trigger - Turn off Avoid save <gen>
      • ---------- HERE'S THE CUSTOM SCRIPT ----------
      • Custom script: call SaveGame("Monster_Slayer.w3z")
      • Trigger - Turn on Avoid save <gen>
Regards
 
Level 9
Joined
Apr 19, 2011
Messages
447
I can't believe it... Just a space!?
Okay now it worked, but it didn't saved where I wanted it to save!
The saved game file, the one with .w3z extension, was inside CustomSaves\WorldEditTestMap, inside my Saves folder. When I selected the "Load Game" in the WC3 main menu, the saved game was not there. Is this happening because I'm testing the map in the world editor? I mean, will it happen if I play the map normally from the game?

Regards
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,232
WarCraft III's save system does not capture the in game state as perfectly as games like StarCraft II. As such it is possible that many advanced trigger systems will be broken when the player reloads.

This is why maps like SWAT Aftermath do not support the use of WarCraft III's inbuilt save/load system since it cannot restore the session without resulting in game breaking bugs.
 
Level 9
Joined
Apr 19, 2011
Messages
447
I tested the proyect in-game. Now, the game saves as CustomSaves/Monster_Slayer.w3z inside the Saves folder. Is there any way make the game save directly in the Saves folder, not inside this "CustomSaves" sub-folder. Because if the saved game is inside this sub-folder, I can't load it from the WC3 Main Menu!
Or, at least, anybody knows a way to load the saved game at the beggining of map initialization?

WarCraft III's save system does not capture the in game state as perfectly as games like StarCraft II. As such it is possible that many advanced trigger systems will be broken when the player reloads.

This is why maps like SWAT Aftermath do not support the use of WarCraft III's inbuilt save/load system since it cannot restore the session without resulting in game breaking bugs.


What do you exactly mean with "broken"?
When my game is saved there's not really a lot of triggers running, but if this "break" affects values stored on variables, and things like that, then it could be a problem...

Regards
 
Level 9
Joined
Apr 19, 2011
Messages
447
Well, in my proyect I only use timers for music management, so I don't think those "breaks" would be a too serious problem. Thanks for the warning anyway.

So, relating to my other question (way to load the game), I have thinking of something that could work, but I'm not very sure, and I want you to give me some advise.
When I save the game with the "call SaveGame (SAVE.w3z)", the game is saved inside a "CustomSaves" folder. So, if I use "call LoadGame (SAVE.w3z)", will the game be loaded from the "CustomSaves" folder too?
If that's so, then I suppose I could find myself a solution to my problem.

Regards
 
Status
Not open for further replies.
Top