Custom Save/Load System (lots of scripting)

This forum is meant for people to share their knowledge by writing their own tutorials for Adventure Maker.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Postby Imari » Wed Feb 18, 2009 1:55 am

Exiting the frame to the Menu or Resuming the Current Game

(Moves the player from the Save-Load frame and unloads the two text boxs and their "Yes"/"No" buttons.)
_____________________________________________________________

16. On the Return to Menu button add this to the advanced tab of the hotspot -

Code: Select all
UnloadControl TextBoxObject(1)
UnloadControl TextBoxObject(2)
Hotspot(26).Enabled=False
Text(26).caption=""
Hotspot(27).Enabled=False
Text(27).caption=""
Hotspot(29).Enabled=False
Text(29).caption=""
Hotspot(30).Enabled=False
Text(30).caption=""

Action.GoToFrame "Main_Menu",1,1


17. On the Return to Game button add this to the advanced tab of the hotspot -
Code: Select all
UnloadControl TextBoxObject(1)
UnloadControl TextBoxObject(2)
Hotspot(26).Enabled=False
Text(26).caption=""
Hotspot(27).Enabled=False
Text(27).caption=""
Hotspot(29).Enabled=False
Text(29).caption=""
Hotspot(30).Enabled=False
Text(30).caption=""

Action.GoToFrame Action.ReadINI(filename+".room",1,1),1,1
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby Imari » Wed Feb 18, 2009 2:02 am

Eep.... five posts.... fleeing from the forums, yet? :oops: Sorry.

But, that's the best I could do.... I hope that what I''m trying to accomplish is understandable.

Unless what I have is completely and hopelessly off base, I'd be grateful for any fixes and improvements. Once this last bit is done, I plan to ZIP it up for general consumption.

I'm off to try to find some free and distributable sound effects and bit of free music to add in and I'm done.

Thanks for looking.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby Lyberodoggy » Wed Feb 18, 2009 2:23 pm

Well, as some guys and girls here know (including mercedes :P) I work better when I have a sample project. As soon as you upload I 'll be able to configure during runtime.
Anyway, till then I 'll try to find bad parts to fix

Imari wrote:LOADING THE THUMBNAIL ONTO THE PROPER HOTSPOT

AM is politely asking for a "sub" in here. :roll:
____________________________________________________________

6. Make a thumbnail for each of the frames in your game from which the player can save. Add the thumbnails to the your Areas and your External folder. I made mine 160 x 90 pixels.

7. On the Advanced tab of the Save-Load frame, add this code

'read the INI file to determine the frame to save from
Code: Select all
frametosave=Action.ReadINI(filename+".room",1,1)


'match up your thumbnails with youtr frames
Code: Select all
   If frametosave = "Scene1" then framethumbnail = "Th_Sc1.jpg"
   If frametosave = "Scene2" then framethumbnail = "Th_Sc2.jpg"
   If frametosave = "Scene3" then framethumbnail = "Th_Sc3.jpg"
   If frametosave = "Scene4" then framethumbnail = "Th_Sc4.jpg"
   If frametosave = "Scene5" then framethumbnail = "Th_Sc5.jpg"

'[etc. etc.]

' Make 12 integer variables, one for each save slot and picture spot and call it SAVESPOT1 thru SAVESPOT12
Code: Select all
savespot1 = Hotspot(1)
savespot2 = Hotspot(2)
savespot3 = Hotspot(3)
savespot4 = Hotspot(4)
savespot5 = Hotspot(5)
savespot6 = Hotspot(6)
savespot7 = Hotspot(7)
savespot8 = Hotspot(8)
savespot9 = Hotspot(9)
savespot10 = Hotspot(10)
savespot11 = Hotspot(11)
savespot12 = Hotspot(12)


'make a "highlight" GIF a little bit latger than your thumbnails and with an invisible center the size of your thumbnails. Put one on each hotspot and make it invisible with a corresponding variable -
Code: Select all
highlight1=Hotspot(13)
highlight2=Hotspot(14)
highlight3=Hotspot(15)
highlight4=Hotspot(16)
highlight5=Hotspot(17)
highlight6=Hotspot(18)
highlight7=Hotspot(19)
highlight8=Hotspot(20)
highlight9=Hotspot(21)
highlight10=Hotspot(22)
highlight11=Hotspot(23)
highlight12=Hotspot(24)


'using the above info, load the proper thumbnail onto the NEXT hotspot on the save-load frame and highlight it
Code: Select all
If savespot1=0 then Action.LoadAPicture Hotspot(1), framethumbnail
savespot1=1
highlight1=1
end if

If savespot1=1 & savespot2=0 then Action.LoadAPicture Hotspot(2), framethumbnail
savespot2=1
highlight2=1
end if

If savespot2=1 & savespot3=0 then Action.LoadAPicture Hotspot(3), framethumbnail
savespot3=1
highlight3=1
end if

If savespot3=1 & savespot4=0 then Action.LoadAPicture Hotspot(4), framethumbnail
savespot4=1
highlight4=1
end if

If savespot4=1 & savespot5=0 then Action.LoadAPicture Hotspot(5), framethumbnail
savespot5=1
highlight5=1
end if

If savespot5=1 & savespot6=0 then Action.LoadAPicture Hotspot(6), framethumbnail
savespot6=1
highlight6=1
end if

If savespot6=1 & savespot7=0 then Action.LoadAPicture Hotspot(7), framethumbnail
savespot7=1
highlight7=1
end if

If savespot7=1 & savespot8=0 then Action.LoadAPicture Hotspot(8), framethumbnail
savespot8=1
highlight8=1
end if

If savespot8=1 & savespot9=0 then Action.LoadAPicture Hotspot(9), framethumbnail
savespot9=1
highlight9=1
end if

If savespot9=1 & savespot10=0 then Action.LoadAPicture Hotspot(10), framethumbnail
savespot10=1
highlight10=1
end if

If savespot10=1 & savespot11=0 then Action.LoadAPicture Hotspot(11), framethumbnail
savespot11=1
highlight11=1
end if

If savespot11=1 & savespot12=0 then Action.LoadAPicture Hotspot(12), framethumbnail
savespot12=1
highlight12=1
end if


'if you've reached the limit of saves, then a hotspot JPG that says "NoMoreSaves" controlled by a variable becomes visible
Code: Select all
If savespot11=1 & savespot12=1 then NoMoreSaves=0
end if


'make the SAVE OKAY and save NOT okay buttons invisible
Code: Select all
Hotspot(26).enabled=False
text(26).caption=""
Hotspot(27).enabled=False
text(27).caption=""


'Load Text Box 1 & 2 and Place them where you want them LoadControl
Code: Select all
TextBoxObject(1)
TextBoxObject(1).move 231,627,212,30
TextBoxObject(1).visible=False

LoadControl TextBoxObject(2)
TextBoxObject(2).move 533,627,212,30
TextBoxObject(2).visible=False


This needs fixing:
The integers savespot1 to 12 can't be equal to a hotspot...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Imari » Wed Feb 18, 2009 3:47 pm

This needs fixing:
The integers savespot1 to 12 can't be equal to a hotspot...


Well..... rats. :?

Thanks for looking, Lyberodoggy.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby mercedes » Thu Feb 19, 2009 4:06 am

Well, as some guys and girls here know (including mercedes ) I work better when I have a sample project.


That's true, i can attest to that!..:D..


Adieux~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Imari » Thu Feb 19, 2009 4:47 am

I have it ZIPped and ready to upload for him.... once he gets out of bed over there. :P I think it's about 4AM Lyberodoggy's time.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby Lyberodoggy » Thu Feb 19, 2009 2:02 pm

It was 5:47 actually :P
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Imari » Thu Feb 19, 2009 3:04 pm

Ouch.... the file is on Rapidshare. Thanks for looking, Lyberodoggy.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby mercedes » Thu Feb 19, 2009 9:13 pm

Hey Imari..:D..Just wanted to mention..You may have to post the link to Rapid Share..Unless of course u sent it already to him..:D..Was just adding this in case it slipped your mind..:)


Adieux~
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Imari » Thu Feb 19, 2009 11:56 pm

I did send it, mercedes, but thanks for the reminder. Always good to check. :wink:
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby Imari » Sun Mar 01, 2009 9:04 pm

I'm back again....

Lyberodoggy wrote:
This needs fixing:
The integers savespot1 to 12 can't be equal to a hotspot...


Okay, I've taken out the list of
Code: Select all
savespot# = Hotspot(#)

and the list of
Code: Select all
highlight# = Hotspot(#)

and made the twelve integer variables for each list. Problem one resolved.... :D


Meanwhile, I already have another question....
Is there a basic contradiction in my use of the variable "frametosave"?

Part 1. On the "Menu" hotspot that I have on each frame, I set the hotspot to go to the menu frame and on the Advanced tab I have -
Code: Select all
frametosave = Action.GetCurrentFrameName
Action.WriteINI filename+".room",1,1,frametosave


Part 2. On the Advanced tab of the "Resume Game" hotspot used on the Menu frame, I have -
Code: Select all
Action.GoToFrame Action.ReadINI(filename+".room",1,1)


Thanks to Lyberodoggy, the above two Parts work just fine. :D

Part 3. BUT, on the Advanced Tab of the Frame Properties of the Save-Load frame I have -
Code: Select all
frametosave = Action.ReadINI(filename+".room",1,1)


Part 4. Followed by this code to correlate each frame in the game with a corresponding thumbnail -
Code: Select all
If frametosave = "Scene1" then framethumbnail = "Th_Sc1.jpg"
   If frametosave = "Scene1a" then framethumbnail = "Th_Sc1a.jpg"

, etc.

Since "frametosave" has already been defined as "Action.GetCurrentFrameName" in Part 1 and used to write to the INI file in part 2, should I use a different variable --- say "roomtosave" --- to read the INI file and be used in Parts 3 and 4? Should I change that code to read -
Code: Select all
roomtosave = Action.ReadINI(filename+".room",1,1)

and
Code: Select all
If roomtosave = "Scene1" then framethumbnail = "Th_Sc1.jpg"
   If roomtosave = "Scene1a" then framethumbnail = "Th_Sc1a.jpg"


Thanks, now to go back to figuring out what "sub" is being asked for.... :P
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby Lyberodoggy » Mon Mar 02, 2009 12:12 am

No need to create a second variable...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Imari » Mon Mar 02, 2009 12:18 am

Thanks, Lyberodoggy.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby Imari » Sun May 31, 2009 6:03 pm

I've taken several whacks at this without success. Does anyone else have any ideas about how to save and load games without using the MS pop-up window? Thanks.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Sun May 31, 2009 7:04 pm

When I have time I'll read through this thread and see what you are trying to accomplish. Maybe its a candidate for a plugin.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Lyberodoggy » Mon Jun 01, 2009 11:40 am

Yeah, I wanted to create a plugin out of this but first I needed to finish some other jobs. So I epic failed them all :cry:
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby CBSection31 » Tue Jun 02, 2009 12:23 am

I've been tinkering with this for my upcoming game, but no success so far. I'll keep trying though, and let you all know if I succeed!
CBSection31
Code Master
 
Posts: 564
Joined: Tue Jun 10, 2003 4:00 am

Postby Imari » Tue Jun 02, 2009 3:07 pm

I've posted this somewhere else on the forums, but this link should probably be here as well.

This is the "raw" AM file for the template that I was making with the Save-Load feature as well as other features (Portal Device, Dynamic Journal, and Inventory Viewer). All of the (attempted) coding for the save-load feature is located in the global VBS procedures (starting halfway down with "Function HasItem(ItemName)" and on the Save-Load frame itself (Advanced tabs of hotspots, frame, etc. etc.). -
http://rapidshare.com/files/284963215/A ... st_SDK.zip

Lyberodoggy managed to get the project a bit further along than it appears in the series of posts above, but those posts are still useful in explaining how the save-load feature was supposed to work.

I really hope that someone can figure this out.
Last edited by Imari on Fri Sep 25, 2009 9:40 pm, edited 1 time in total.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Tue Jun 02, 2009 8:17 pm

I would much rather have the requirements that you need and then start building from scratch. It's easier for me this way. If you can state how you want this to look and work, I'll work on it.

I was planning on building it so it would be activated by a hotspot or a keypress.

For the save game: If the user presses 's' on the keyboard or clicks the 'save' hotspot, it would save the game status to an ini file.

I was also planning on adding a frame plugin where you could set any particular frame in a game for game saving as well as an option for autosave.

For the load game, I thought another hotspot and keypress to activate the load, which would open the "load game" frame. There would be a series of thumbnails of saved games with time stamps & caption. This screen would also allow you to delete games.

Does this sound right? Am I missing anything?

I've got the save part finished. I'm working ont the load screen now.
Last edited by reneuend on Wed Jun 03, 2009 3:55 am, edited 3 times in total.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Imari » Wed Jun 03, 2009 3:52 am

Those ideas sound good. I'm not hard set on any particular system. I mostly wanted to avoid having the MS pop-up for saving and loading that is standard in AM.

Lyberodoggy's initial system allowed for the player to type in the name of a saved game in a text box, but in order to load the game, the player had to remember the name of the saved game and type it into another text box.

Building on his idea, I was trying to add a thumbnail picture of the saved scene on the save-load screen, so that when the player returned to the screen to save or load, there was a visual record of the former saved games to select from.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Wed Jun 03, 2009 4:01 am

Ok. What I'm building won't have the user type in anything (not that it's a bad idea), but I wanted it so they just click on the "save" hotspot, or whereever you want to put the call for the save routine.

Because I'm doing it this way, it's important that the "load" feature make it easy enough for the user to select the game they want. And like you were working on, this will have 200x150 thumbnails on the Load screen. I'll build it so the frame will dynamically display multiple pages of thumbnails. This way you are open to set how many saved games the user is allowed.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Vairon » Wed Jun 03, 2009 12:55 pm

Hi comrades!

Lately I do not speak much on the forum, I am working hard on my project Devil's Sea to finish this summer,
but when I have some time I will make a tutorial about the method I'm using to make the save and load screens.

The main problem, I think, is to let the player give a name to saved games.
At the moment I have not gotten into it, I only save the image, the time and date.
User avatar
Vairon
Forum Master
 
Posts: 500
Joined: Sat Jul 14, 2007 12:40 pm
Location: Spain

Postby juhuwoorps » Wed Jun 03, 2009 1:48 pm

I think there's no need to name a save point if you have a picture and the date and time.
Perhaps you can use the frame name.
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby Lyberodoggy » Wed Jun 03, 2009 3:42 pm

You can ask for a user input and then store each save game's name in an INI. Or at least that's what we were trying to do...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Imari » Thu Jun 04, 2009 3:17 am

I'm so glad to see so much interest in improving AM's save-load. :D
A picture by itself sounds just fine to me, so long as the saved thumbnails save in an order.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby mercedes » Thu Jun 04, 2009 4:02 am

I'm not sure if this has been said here..this thread is crazy long..:lol:
But if not..
The one game that reminds me of AM's engine is the Sherlock Holmes-[The Awakened]and the saving/load technique--i would think would or should work for AM..like i can see it being used here..It was made so that each frame had a thumbnail, for save/load, but it would save only to the point of entry of that frame. The user would have to do that frame again, but all else would be saved.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Imari » Thu Jun 04, 2009 11:54 pm

I think that incorporating Lyberodoggy's INI system for the Save files also will save the variables and inventory --- so there would be no need for the player to repeat the frame.

Maybe Lyberodoggy can clarify this? I'm dreadful with the coding end of things.
User avatar
Imari
VIP
 
Posts: 872
Joined: Fri Jun 20, 2003 4:49 pm
Location: Virginia, USA

Postby reneuend » Fri Jun 05, 2009 12:30 am

Actually, I think I understand the advantage or what Mercedes is talking about. By saving at the beginning of the frame, allows the user to ease back into the game from where they left off.

The plugin would be activated in the frame properties for each frame, so everytime a player entered a new scene (frame) it would automatically be saved at that point.

I'm pretty far into building a plugin for this. It will be interesting to see the different solutions everyone comes up with! :)
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2762
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Fri Jun 05, 2009 2:28 am

I only mention it cause, i have played games like that and it worked for me. I had no complaints..I simply clicked the [latest] thumbnail when i reloaded my game, and it took me to beginning of that scene. All other variables and inventory were saved. My inventory was still there..~
[They would reset in that frame]
Just nothing from that scene..was there.. So if there were items in that frame--I had to get them again. But all other frames before, were fine.

Also I thought it might be slightly easier then trying to auto-save---from every point of the game--without using AM's dialogue boxes..

Just an idea..~:D
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby Lyberodoggy » Fri Jun 05, 2009 3:06 pm

Well, what I designed at first was a fully working saving tutorial for saving your game from any frame by storing each and every variable and item into an INI. The only thing that never worked was the thumbnails system (identifying the slots taken and load a thumbnail of the frame), but now I think I can fix this...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

PreviousNext

Return to Post Your Own Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests

cron