Force Shutdown Script

Clockwarkgate

RGSS2 User
Veteran
Joined
Oct 24, 2014
Messages
219
Reaction score
169
First Language
English
Primarily Uses
RMVX
Calling a script that will force shutdown the game in an instant.
 

Seriel

Veteran
Member
Joined
Aug 16, 2014
Messages
3,018
Reaction score
508
First Language
English
Primarily Uses
Other
Try this:

Code:
SceneManager.exit
 

sokita

Crawling back to the surface
Veteran
Joined
Apr 27, 2014
Messages
198
Reaction score
29
First Language
Indonesian
Primarily Uses
But that worked for me. Re-check your script call, it must exactly same with that.

SceneManager.exit
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,271
Reaction score
2,329
First Language
Binary
Primarily Uses
RMMV
LAWL... Y'all be newbs..

exitThat is all...

Edit...

Dont even know if that works for RGSS2, but I doubt the SceneManager method will work. (im not the best with rgss2 :) )
 
Last edited by a moderator:

sokita

Crawling back to the surface
Veteran
Joined
Apr 27, 2014
Messages
198
Reaction score
29
First Language
Indonesian
Primarily Uses
LAWL... Y'all be newbs..

exitThat is all...

Edit...

Dont even know if that works for RGSS2, but I doubt the SceneManager method will work. (im not the best with rgss2 :) )
Oh, thanks mastah. I didn't know before I can just write exit.
 

Seriel

Veteran
Member
Joined
Aug 16, 2014
Messages
3,018
Reaction score
508
First Language
English
Primarily Uses
Other
dayum, didn't realize it was RGSS2 :unsure:
 

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,271
Reaction score
2,329
First Language
Binary
Primarily Uses
RMMV
Neither did I till after I had posted :)
 

Rukiri

I like to make Action-RPGs
Veteran
Joined
Jan 20, 2014
Messages
838
Reaction score
503
First Language
English
Primarily Uses
Other
def quit_game (arg) if arg = "yes" exit elsif arg = "no" # this is a comment endendSomething like that, just call the method and do quit_game("yes") then it will quit your game. 
 
Last edited by a moderator:

??????

Diabolical Codemaster
Veteran
Joined
May 11, 2012
Messages
6,271
Reaction score
2,329
First Language
Binary
Primarily Uses
RMMV
def quit_game (arg) if arg = "yes" exit elsif arg = "no" # this is a comment endendSomething like that, just call the method and do quit_game("yes") then it will quit your game. 
Well... no...

That would always exit, cause its setting arg to 'yes' then checking if arg exists, which it does, cause you just set it, then its calling exit. You would have to use two equals signs to mean 'if equals', one just sets the variable.

Also, if you were going to do something like that, may as well do it like this..

def quit_game(*argz, &blawk) return unless argz[0] blawk::call if blawk && block_given? exit endThen you can do calls like..

Code:
@time_to_quit = true # or 'yes'quit_game(@time_to_quit) do   # Do some other stuff before exit,   # for whatever reason..end
 
Last edited by a moderator:

Rukiri

I like to make Action-RPGs
Veteran
Joined
Jan 20, 2014
Messages
838
Reaction score
503
First Language
English
Primarily Uses
Other
Well... no...

That would always exit, cause its setting arg to 'yes' then checking if arg exists, which it does, cause you just set it, then its calling exit. You would have to use two equals signs to mean 'if equals', one just sets the variable.

Also, if you were going to do something like that, may as well do it like this..

def quit_game(*argz, &blawk) return unless argz[0] blawk::call if blawk && block_given? exit endThen you can do calls like..

@time_to_quit = true # or 'yes'quit_game(@time_to_quit) do # Do some other stuff before exit, # for whatever reason..end
Sorry about that, been high on C# forever, forgot that you need "==" to actually mean equal. 
 

narabuster

Villager
Member
Joined
Jun 14, 2015
Messages
9
Reaction score
0
First Language
English
Primarily Uses
Alternatively, you could use this script call:

Code:
$scene = nil
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I keep snapping wireless headphones. I think thats how they get ya, good sound quality but cheap plastic...
Broke the 1,000 hour mark on MV last night! Most of that was spent on 1 project, with most of that project being worked on outside the engine so far.
School books are so expensive... I just paid a fortune. :(
Does anyone knows those arts are just rip-offs from anime, or those are custom arts? There are no availlable TOS information so I'm not sure it's safe to get them
The universe does not want me to do another letsplay it seems... I keep bumping into problem after problem... Oh well. Still have several days to sort them out.

Forum statistics

Threads
93,461
Messages
912,653
Members
122,995
Latest member
Nightfight
Top