Is there any way to just end the game from hamsterscript, set it to fullscreen, change the volume etc?
I am using my own menus, and would like to build myself a nice 'Settings'-Screen.
Also, leaving the game from my custom main menu would be rather nice too ;)
Quit Game and set settings from script?
Moderators: marionline, SDHawk
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
Re: Quit Game and set settings from script?
try ctrl+f in the dictionary for "volume" and "game over" commandsDWRL wrote:Is there any way to just end the game from hamsterscript, set it to fullscreen, change the volume etc?
I am using my own menus, and would like to build myself a nice 'Settings'-Screen.
Also, leaving the game from my custom main menu would be rather nice too ;)
"Imagination. Life is your creation."
The Quit option in the main menu is equivalent to calling "game over". If the titlescreen and load menu are disabled it quits completely out. (I've been meaning to add a command to quit unconditionally).
You can modify the music volume but not the master sound effects volume. I've been meaning to add a command for that.
There's no command to switch fullscreen/windowed. That would be a good addition too.
I'd like to add a builtin settings menu, and let people customise its appearance as a slice collection, in such as way that we can add more settings in the future (there's quite a number I want to add, such as various graphics backend settings (e.g. window scaling mode, smoothing/scaling filters) and screenshot/gif settings.
You can modify the music volume but not the master sound effects volume. I've been meaning to add a command for that.
There's no command to switch fullscreen/windowed. That would be a good addition too.
I'd like to add a builtin settings menu, and let people customise its appearance as a slice collection, in such as way that we can add more settings in the future (there's quite a number I want to add, such as various graphics backend settings (e.g. window scaling mode, smoothing/scaling filters) and screenshot/gif settings.
Thank you both for the fast replies
Great, that does the trick"[G]ame over"[,] If the titlescreen and load menu are disabled it quits completely out.
Would be greatI'd like to add a builtin settings menu, and let people customise its appearance as a slice collection, in such as way that we can add more settings in the future (...).
-
- Red Slime
- Posts: 64
- Joined: Sat Apr 20, 2019 8:59 am
I also suggest you "reset game"
You can also use a command called reset game. The difference between reset game and game over is that reset game make reload the credit at the beginning and/or the into cutscene.
The player still has to press esc to completely leave game.exe
You could make like the one above and make it run after you saved your game.
To use this pick a free text box and put it a yes/no question
If yes the script leave after game is launched. If not the text box is displayed instead.
Then pick up another free txt box (in the script below I chose text box 58) in which you write something like: thanks for playing... see you later
If you want to make the player to quit the game from a sub menu with this script, just edit your menu item, change script type to "run script" and choose it. Edit the item bitset and hit "close when activated". Name the menu item "quit" or "leave"
Also make sure that you hit the bitset "allow gameplay & scripts"
Good luck!
The player still has to press esc to completely leave game.exe
You could make like the one above and make it run after you saved your game.
To use this pick a free text box and put it a yes/no question
If yes the script leave after game is launched. If not the text box is displayed instead.
Then pick up another free txt box (in the script below I chose text box 58) in which you write something like: thanks for playing... see you later
Code: Select all
#----------------------------------------------
script, leave game after playing, begin
suspend player
suspend npcs
suspend box advance
show text box (58)
wait (6)
resume box advance
resume player
resume npcs
#game over #quit game completely
reset game # quit game and re-launch game intro and the load menu
end#end for the script
#------------------------------------------
Also make sure that you hit the bitset "allow gameplay & scripts"
Good luck!