Force Shutdown Script

Discussion in 'RGSS2 Script Requests' started by Project CROSS, Jul 29, 2015.

  1. Project CROSS

    Project CROSS RGSS2 User Veteran

    Messages:
    208
    Likes Received:
    157
    Location:
    Potato Land
    First Language:
    English
    Primarily Uses:
    RMVX
    Calling a script that will force shutdown the game in an instant.
     
    #1
  2. Seriel

    Seriel Veteran Veteran

    Messages:
    3,018
    Likes Received:
    508
    Location:
    Wales, UK
    First Language:
    English
    Primarily Uses:
    Other
    Try this:

    Code:
    SceneManager.exit
     
    #2
    Rukiri likes this.
  3. Project CROSS

    Project CROSS RGSS2 User Veteran

    Messages:
    208
    Likes Received:
    157
    Location:
    Potato Land
    First Language:
    English
    Primarily Uses:
    RMVX
    didn't work, i got an error "uninitialized constant"
     
    #3
  4. sokita

    sokita Crawling back to the surface Veteran

    Messages:
    198
    Likes Received:
    29
    Location:
    Indonesia
    First Language:
    Indonesian
    But that worked for me. Re-check your script call, it must exactly same with that.

    SceneManager.exit
     
    #4
  5. ??????

    ?????? Diabolical Codemaster Veteran

    Messages:
    6,264
    Likes Received:
    2,312
    Location:
    Your OS
    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: Jul 29, 2015
    #5
    sokita likes this.
  6. sokita

    sokita Crawling back to the surface Veteran

    Messages:
    198
    Likes Received:
    29
    Location:
    Indonesia
    First Language:
    Indonesian
    Oh, thanks mastah. I didn't know before I can just write exit.
     
    #6
  7. Seriel

    Seriel Veteran Veteran

    Messages:
    3,018
    Likes Received:
    508
    Location:
    Wales, UK
    First Language:
    English
    Primarily Uses:
    Other
    dayum, didn't realize it was RGSS2 :unsure:
     
    #7
  8. ??????

    ?????? Diabolical Codemaster Veteran

    Messages:
    6,264
    Likes Received:
    2,312
    Location:
    Your OS
    First Language:
    Binary
    Primarily Uses:
    RMMV
    Neither did I till after I had posted :)
     
    #8
  9. Rukiri

    Rukiri I like to make Action-RPGs Veteran

    Messages:
    838
    Likes Received:
    503
    Location:
    Unity3D Land
    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: Aug 6, 2015
    #9
  10. ??????

    ?????? Diabolical Codemaster Veteran

    Messages:
    6,264
    Likes Received:
    2,312
    Location:
    Your OS
    First Language:
    Binary
    Primarily Uses:
    RMMV
    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: Aug 6, 2015
    #10
  11. Rukiri

    Rukiri I like to make Action-RPGs Veteran

    Messages:
    838
    Likes Received:
    503
    Location:
    Unity3D Land
    First Language:
    English
    Primarily Uses:
    Other
    Sorry about that, been high on C# forever, forgot that you need "==" to actually mean equal. 
     
    #11
    ?????? likes this.
  12. narabuster

    narabuster Villager Member

    Messages:
    9
    Likes Received:
    0
    First Language:
    English
    Alternatively, you could use this script call:

    Code:
    $scene = nil
     
    #12

Share This Page