Scripts / Save script

Author
Message
kulet
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 18th Aug 2011
Location: Manila, Philippines
Posted: 26th Feb 2015 08:51
Hey guys, sorry for posting a lot of inquiries here in the scripting forum, but I am really having a hard time on scripting since I am the only one creating my Indie game, from level design, to custom modelling, to stories, to some basic scripting, to arts, trailer and everything... So, please bare with me.

Anyway, I am here to ask, if anyone of you already made a working save script? I mean for example, if a player pressed the Esc. key, the hud Menu will appear asking whether to go to main, load game, exit, and/or save game, so that when the player wanted to play the game again, he/she will not anymore start from the beginning, he/she will already be on the place where he/she last saved the game.
Corno_1
GameGuru Tool Maker
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 26th Feb 2015 13:29
I can not create a ingame hud menu, but I can try to create a script which safes the level number and restore it when you play again. Would that help you?
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 26th Feb 2015 13:38
loading a specific level is possible and quite easy but loading it exactly as you left it requires a lot more work - especially when you try to factor in every change you might have made.

both would require the same set up though i guess, just save the information into a text file (LUA has commands for this) and then when the level loads you will read the file and load the level as required - again for the second option this requires a lot more information to be saved and loaded but the first could be done with only 1 line saved (the name of the map the player was in) and then 1 command from reloaded to load it.
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
Corno_1
GameGuru Tool Maker
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 26th Feb 2015 13:43
That´s the way how to do it
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
kulet
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 18th Aug 2011
Location: Manila, Philippines
Posted: 26th Feb 2015 14:27 Edited at: 26th Feb 2015 14:33
@Corno, I can make a hud for that, can you make me one? If it's ok with you, cause I can't seem to find a save command from the list that SC posted. I also saw you from one of the threads I am commenting, haha, thanks... Or, I will try it first, do you have a complete list of the .lua commands? So I can try it myself first before I ask for your help? Cause I feel like I need to do this than just asking a lot of people around, in that way I will learn to code in .lua myself, and aside from learning, I can customize the script more to my liking.

@smallg, so, I can only load a level where the player is at, but not at the exact place where he left? But what if my map is too huge and needs some save point? Can we make a script for a trigger zone, so that whenever a player reached that zone, the game progress will automatically be saved, and then when he return in game, he will re-spawn on the trigger zone where the game automatically saved?

Thanks in advance, I really appreciate all the help. But, if you can share me a full list of .lua commands available for GG, then it will be much better and be greatly appreciated.

Btw, since I can now a bit understand what the two of you are trying to tell me, here will be what I want for the script to be.

For example, a trigger zone that will be named load zone 1, load zone 2 etc.. and all of those zones will have its auto save script so that, when a player re-enters the game, they will load to the last save zone they encounter, but of course it will be an automatic save, since creating a menu will be hard. Maybe, a little hud saying "automatically saved" will appear. Something like that.

I will try to make one myself first, just give me a full list of .lua commands for GG, if I really can't make it then I will message you guys..
Corno_1
GameGuru Tool Maker
14
Years of Service
User Offline
Joined: 3rd Nov 2010
Location:
Posted: 26th Feb 2015 15:57 Edited at: 26th Feb 2015 16:00
Sadly there is no list. But in the global.lua are all commands in. Thats the way I work with lua. The documention for GameGuru is a joke. This would be a feature I like to see....

Quote: "So I can try it myself first before I ask for your help?"

I would appreciate it If someone could do it himself I always support this. We have/get enought requesters in this forum. So just do it
My dream is to develope games, which makes fun when I create it and fun when other people play it.
PM
J_C
17
Years of Service
User Offline
Joined: 9th Nov 2007
Location:
Posted: 26th Feb 2015 18:06
I have just been on the GameGuru community site on Steam and on there is a document
Basic Concepts of Lua scripting...

And it has a full list of the LUA commands ...

It is the biggest description of LUA in GameGuru I have seen and its on Steam...
PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 26th Feb 2015 21:22
Quote: "so, I can only load a level where the player is at, but not at the exact place where he left? But what if my map is too huge and needs some save point? Can we make a script for a trigger zone, so that whenever a player reached that zone, the game progress will automatically be saved, and then when he return in game, he will re-spawn on the trigger zone where the game automatically saved?"


you can do it but it saving requires a lot of information - enemy placement, (alive/dead/health etc?), player health, lives, weapons and ammo, any collectable items along the way, time of day(?)... this is why 1 script will unlikely be able to do all the work for you, there is a lot you can have in your game that someone else simply won't know

saving and loading only the player location should be as i said pretty simple though and will certainly work with zones as 'save points'
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-12-21 14:56:47
Your offset time is: 2024-12-21 14:56:47