wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 07-12-2007, 02:52 AM   #1
Callahan
Bullseye
 
Callahan's Avatar
 
Join Date: Jan 2006
Posts: 977

Submissions (72)

Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)

Default Is there a way to make a custom save trigger?

Hi experienced jassers.I making a map etc...and when my hero acquire a save spot it activate a dialog menu where it ask if you want to save your progression as see in the picture below :
Zoom (requires log in)

I've made a jass trigger when you click the "Save" button but it don't work :

Collapse JASS:
//===========================================================================
// Trigger: Save Yes
//===========================================================================
function Trig_Save_Yes_Func001C takes nothing returns boolean
    if ( not ( GetClickedButtonBJ() == udg_SaveMenu_yes ) ) then
        return false
    endif
    return true
endfunction

function Trig_Save_Yes_Actions takes nothing returns nothing
    if ( Trig_Save_Yes_Func001C() ) then
        call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_1910" )
        call SaveGame( "WoGAutosave.w3z" )
        else
    endif
    call DialogDisplayBJ( false, udg_SaveMenu, Player(0) )
endfunction

//===========================================================================
function InitTrig_Save_Yes takes nothing returns nothing
    set gg_trg_Save_Yes = CreateTrigger(  )
    call TriggerRegisterDialogEventBJ( gg_trg_Save_Yes, udg_SaveMenu )
    call TriggerAddAction( gg_trg_Save_Yes, function Trig_Save_Yes_Actions )
endfunction

//===========================================================================

I think it's the
Collapse JASS:
call SaveGame( "WoGAutosave.w3z" )
that doesn't work.
And it doesn't even display the text message.
But did you know another way to make it or it's simply impossible?

Btw i know what you wonder "Why not using the F10 menu and save?"
And 'ill answer because when you play a campaign you usualy forgot to save your progression.And player don't know when they will meet a "BOSS elite level 100" so there is save spot to make the player save before being pwnd.
Attached Images
File Type: jpg Custom save.jpg (60.1 KB, 101 views)
__________________
Current project:
-Singleplayer RPG:World of Genesia
-Heroes of Genesia

_________
I support every RPG map maker.
_______
OMG!My signature doesn't countains subliminal messages anymore!

Last edited by Callahan : 07-12-2007 at 02:58 AM.
Callahan is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 07-12-2007, 03:38 AM   #2
TheSecretArts
Galaxy Scripter
 
TheSecretArts's Avatar
 
Join Date: Mar 2007
Posts: 1,077

Submissions (2)

TheSecretArts will become famous soon enough (38)TheSecretArts will become famous soon enough (38)

Send a message via AIM to TheSecretArts Send a message via MSN to TheSecretArts Send a message via Yahoo to TheSecretArts
Default

as far as im aware, this kinda stuff doesnt work in Multiplayer... game caches dont work, im im pretty sure save games wont work with multiple players whatsoever.
Edit: If this is Single Player, then are u sure that all buttons are set, load your functions tto the brim with debug messeges
__________________
I have officially moved exclusively to Starcraft 2 mapmaking.
Project: Escape Velocity: Nova Reloaded
Don't expect me to finish this project lol...

Last edited by TheSecretArts : 07-12-2007 at 03:41 AM.
TheSecretArts is offline   Reply With Quote
Old 07-12-2007, 01:47 PM   #3
Callahan
Bullseye
 
Callahan's Avatar
 
Join Date: Jan 2006
Posts: 977

Submissions (72)

Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)

Default

This is singleplayer.
And no the cancel button isn't set but i just want it it do nothing so i didn't think i have to trigger it.
But i think they are set here the trigger :
SaveMenu=Dialog variable
SaveMenu_yes=Dialog button variable
SaveMenu_cancel=Dialog button variable
Trigger:
Save init
Collapse Events
Time - Elapsed game time is 5.00 seconds
Conditions
Collapse Actions
Dialog - Change the title of SaveMenu to Do you want to save...
Dialog - Create a dialog button for SaveMenu labelled Save
Dialog - Create a dialog button for SaveMenu labelled Cancel
So the save menu is set at the begining of the game.

Save0095,0096,0097 are save spot they are unit.
Trigger:
Save
Collapse Events
Unit - A unit comes within 50.00 of Save 0095 <gen>
Unit - A unit comes within 50.00 of Save 0096 <gen>
Unit - A unit comes within 50.00 of Save 0097 <gen>
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Triggering unit) Equal to Hero[1]
(Triggering unit) Equal to Hero[2]
(Triggering unit) Equal to Hero[3]
Collapse Actions
Dialog - Show SaveMenu for Player 1 (Red)
So now when a unit come to a save spot it show the dialog menu.

Trigger:
Save Yes
Collapse Events
Dialog - A dialog button is clicked for SaveMenu
Conditions
Collapse Actions
If ((Clicked dialog button) Equal to SaveMenu_cancel) then do (Dialog - Hide SaveMenu for Player 1 (Red)) else do (Do nothing)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Clicked dialog button) Equal to SaveMenu_yes
Collapse Then - Actions
Custom script: call SaveGame( "WoGAutosave.w3z" )
Game - Display to (All players) the text: |cff00ff00Game save...
Dialog - Hide SaveMenu for Player 1 (Red)
Collapse Else - Actions
Do nothing
And here what happen when u click a button.
Is there anything wrong?
__________________
Current project:
-Singleplayer RPG:World of Genesia
-Heroes of Genesia

_________
I support every RPG map maker.
_______
OMG!My signature doesn't countains subliminal messages anymore!

Last edited by Callahan : 07-12-2007 at 02:00 PM.
Callahan is offline   Reply With Quote
Old 07-12-2007, 02:27 PM   #4
Fireeye
Chos
 
Fireeye's Avatar
 
Join Date: Jun 2006
Posts: 495

Submissions (2)

Fireeye has a spectacular aura about (113)Fireeye has a spectacular aura about (113)Fireeye has a spectacular aura about (113)Fireeye has a spectacular aura about (113)

Default

Callahan, you didn't set the save button to the variable, also you don't need any variable for the cancel button, just leave it blank.
Also i'm pretty sure you don't have to hide the dialog afterwards, because it will be automatically hidden when a button is clicked. (At least when i click a button)
Trigger

Trigger:
Save init
Collapse Events
Time - Elapsed game time is 5.00 seconds
Conditions
Collapse Actions
Dialog - Change the title of SaveMenu to Do you want to save...
Dialog - Create a dialog button for SaveMenu labelled Save
Set WantToSave = (Last created dialog Button)
Dialog - Create a dialog button for SaveMenu labelled Cancel
Trigger:
Save Call
Collapse Events
Unit - A unit comes within 50.00 of Save 0095 <gen>
Unit - A unit comes within 50.00 of Save 0096 <gen>
Unit - A unit comes within 50.00 of Save 0097 <gen>
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Triggering unit) Equal to Hero[1]
(Triggering unit) Equal to Hero[2]
(Triggering unit) Equal to Hero[3]
Collapse Actions
Dialog - Show SaveMenu for Player 1 (Red)
Trigger:
Save
Collapse Events
Dialog - A dialog button is clicked for SaveMenu
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Clicked dialog button) Equal to WantToSave
Collapse Then - Actions
Custom script: call SaveGame( "WoGAutosave.w3z" )
Game - Display to (All players) the text: |cff00ff00Game save...
Else - Actions

__________________
Fireeye is offline   Reply With Quote
Old 07-12-2007, 02:44 PM   #5
Callahan
Bullseye
 
Callahan's Avatar
 
Join Date: Jan 2006
Posts: 977

Submissions (72)

Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)

Default

Okaaaaay
__________________
Current project:
-Singleplayer RPG:World of Genesia
-Heroes of Genesia

_________
I support every RPG map maker.
_______
OMG!My signature doesn't countains subliminal messages anymore!
Callahan is offline   Reply With Quote
Old 07-12-2007, 02:53 PM   #6
Dark.Revenant
User
 
Dark.Revenant's Avatar
 
Join Date: Feb 2007
Posts: 348

Submissions (1)

Dark.Revenant will become famous soon enough (44)Dark.Revenant will become famous soon enough (44)

Default

Wouldn't you be able to do this pretty easily in GUI?
__________________
Dark.Revenant is offline   Reply With Quote
Old 07-12-2007, 03:02 PM   #7
Thunder_Eye
Lol I got a custom title!
 
Thunder_Eye's Avatar
 
Join Date: Aug 2004
Posts: 1,236

Thunder_Eye has a spectacular aura about (92)Thunder_Eye has a spectacular aura about (92)Thunder_Eye has a spectacular aura about (92)Thunder_Eye has a spectacular aura about (92)

Default

Most likely, but why use GUI when you know JASS? (though that jass trigger makes me dizzy)
__________________

Last edited by Thunder_Eye : 07-12-2007 at 03:03 PM.
Thunder_Eye is offline   Reply With Quote
Old 07-12-2007, 04:23 PM   #8
Captain Griffen
Dread Lord of the Cookies
 
Captain Griffen's Avatar


Content Director
 
Join Date: Sep 2003
Posts: 5,375

Submissions (2)

Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)

Approved Map: Warlords[Quicksilver #2] - 1st Place

Default

GUI is fine where performance is no issue, just so long as it doesn't leak excessively or repeatedly.
__________________
Quote:
Originally Posted by Earth-Fury
Griffen is correct, you are not.
Quote:
[13:32] <Akolyt0r> hmm.. stil i want to have some unused women
Captain Griffen is offline   Reply With Quote
Old 07-12-2007, 05:41 PM   #9
Callahan
Bullseye
 
Callahan's Avatar
 
Join Date: Jan 2006
Posts: 977

Submissions (72)

Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)

Default

I have another minor issue :the folder.It save at Save/Profile#/CustomSaves/MapName/ so you cannot load your save from the F10 menu in game unless you change the folder of the .w3z
I can trigger to load the map but it would be annoying since you have to start a new game before load your saved file.

I just want to know if it's possible to specifie the folder in jass trigger like
Collapse JASS:
call SaveGame("C:/Program files/Warcraft3/Save/WoGAutosave.w3z")
__________________
Current project:
-Singleplayer RPG:World of Genesia
-Heroes of Genesia

_________
I support every RPG map maker.
_______
OMG!My signature doesn't countains subliminal messages anymore!
Callahan is offline   Reply With Quote
Old 07-12-2007, 05:43 PM   #10
TheSecretArts
Galaxy Scripter
 
TheSecretArts's Avatar
 
Join Date: Mar 2007
Posts: 1,077

Submissions (2)

TheSecretArts will become famous soon enough (38)TheSecretArts will become famous soon enough (38)

Send a message via AIM to TheSecretArts Send a message via MSN to TheSecretArts Send a message via Yahoo to TheSecretArts
Default

errr.... youd probably have to make a native that does SaveGame but adds a directory because the directory is hardcoded (to my knowledge) in the function.
__________________
I have officially moved exclusively to Starcraft 2 mapmaking.
Project: Escape Velocity: Nova Reloaded
Don't expect me to finish this project lol...
TheSecretArts is offline   Reply With Quote
Old 07-13-2007, 10:37 AM   #11
Callahan
Bullseye
 
Callahan's Avatar
 
Join Date: Jan 2006
Posts: 977

Submissions (72)

Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)

Default

Any i've fixed with another custom load system.And it appear at the begining before starting the game there is a dialog wich ask if you want to start a new game or load game so that they can load they're map.

But i've encounter another problem,The save can work only once unless you reload the map.Is there a way to fix that?
__________________
Current project:
-Singleplayer RPG:World of Genesia
-Heroes of Genesia

_________
I support every RPG map maker.
_______
OMG!My signature doesn't countains subliminal messages anymore!
Callahan is offline   Reply With Quote
Old 07-13-2007, 02:09 PM   #12
TheSecretArts
Galaxy Scripter
 
TheSecretArts's Avatar
 
Join Date: Mar 2007
Posts: 1,077

Submissions (2)

TheSecretArts will become famous soon enough (38)TheSecretArts will become famous soon enough (38)

Send a message via AIM to TheSecretArts Send a message via MSN to TheSecretArts Send a message via Yahoo to TheSecretArts
Default

Make a handler map, with the code
Trigger:
Game - Load Saved Game <saved game>
unless thats not an actual function. Just make a map that when loaded, loads the save <if any>, else starts a 'new game' using the starter map
__________________
I have officially moved exclusively to Starcraft 2 mapmaking.
Project: Escape Velocity: Nova Reloaded
Don't expect me to finish this project lol...

Last edited by TheSecretArts : 07-13-2007 at 02:10 PM.
TheSecretArts is offline   Reply With Quote
Old 07-13-2007, 07:43 PM   #13
Callahan
Bullseye
 
Callahan's Avatar
 
Join Date: Jan 2006
Posts: 977

Submissions (72)

Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)Callahan is a splendid one to behold (688)

Default

The load work properly.
The problem is that you can save only once during the game.If you try to resave during the same game it won't work.You have to reload your saved game to enable the save again.
__________________
Current project:
-Singleplayer RPG:World of Genesia
-Heroes of Genesia

_________
I support every RPG map maker.
_______
OMG!My signature doesn't countains subliminal messages anymore!
Callahan is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:14 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2017, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services