What are the common causes for script lockup?

Discussion in 'Learning Ruby and RGSSx' started by Silent Darkness, Dec 17, 2013.

  1. Silent Darkness

    Silent Darkness Robomage Veteran

    Messages:
    2,284
    Likes Received:
    321
    Location:
    Dark Realms
    First Language:
    English
    Quite often when i'm trying to get a script to work just right, it "locks up". In other words, can't input anything, no menus appear, nothing except the need to Alt-F4.

    I know there's some obvious reason why a script lockup happens, but I thought it might be good to make this thread to try and get some answers to what i'm sure that plenty of budding developers run into from time to time.

    What are the most common causes for this?
     
    #1
  2. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,067
    Location:
    Toronto
    First Language:
    English
    When a scene de-activates a window, but never activates another window.


    Perhaps due to missing use case, forgot to implement, or other reasons.


    When a script runs itself into an infinite loop.


    This is possible with events as well since you have the loop command.
     
    Last edited by a moderator: Dec 17, 2013
    #2
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    37,796
    Likes Received:
    11,503
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    I've moved this thread to Learning Ruby and RGSSx. Please be sure to post your threads in the correct forum next time. Thank you.


    Good topic. I can't think of any other reasons off the top of my head.
     
    Last edited by a moderator: Dec 17, 2013
    #3
  4. Silent Darkness

    Silent Darkness Robomage Veteran

    Messages:
    2,284
    Likes Received:
    321
    Location:
    Dark Realms
    First Language:
    English
    Yep. Unintentional infinite loop. The bane of a novice eventer/scripter's existence.

    I wonder if this will end up getting pinned or something o_O
     
    Last edited by a moderator: Dec 17, 2013
    #4
  5. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    another thing maybe broken update method.

    it can happen sometimes when someone forget to use super when rewriting update method for child class.

    ex:

    Code:
    Scene_Example < Scene_Equip  def update    puts "example"  endend
     
    #5
    BadMinotaur likes this.
  6. OM3GA-Z3RO

    OM3GA-Z3RO Wounded Seraphim Veteran

    Messages:
    826
    Likes Received:
    180
    Location:
    Manaria
    Hmm I think I have something very similar to this.

    In one of my test events I wish to make it that you can't save or enter your menu at this certain moment but you need to walk to continue the scene, now the problem here is that when I issue a command for a event to disable Menu and Save or just Menu, you can't move or do anything, is that another reason for a script lockup?
     
    #6
  7. Silent Darkness

    Silent Darkness Robomage Veteran

    Messages:
    2,284
    Likes Received:
    321
    Location:
    Dark Realms
    First Language:
    English
    It seems like having autorun events can be quite tempermental on that sort of thing, Omega-Zero.
     
    #7
  8. Shaz

    Shaz Veteran Veteran

    Messages:
    37,796
    Likes Received:
    11,503
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    OM3GA-Z3RO, it sounds like you're asking for help, not contributing to the topic (because you haven't identified a cause). This is not a thread to ask for help.


    A game can lock if you have an autorun event that's not turned off, even if it's doing nothing. But that's an event design issue, not a script issue.
     
    #8
  9. Silent Darkness

    Silent Darkness Robomage Veteran

    Messages:
    2,284
    Likes Received:
    321
    Location:
    Dark Realms
    First Language:
    English
    "Exit Event Processing"

    The event option that time forgot?
     
    #9
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,796
    Likes Received:
    11,503
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Exit Event Processing does not work for autorun or parallel processing events. Let's get back to the topic, please.
     
    #10
  11. Silent Darkness

    Silent Darkness Robomage Veteran

    Messages:
    2,284
    Likes Received:
    321
    Location:
    Dark Realms
    First Language:
    English
    Doh. I actually thought that had something to do with lockups. Apologies.

    So, basically, the causes seem to be:

    Infinite Loops

    Not putting an end to autorun or parallel processes through some means(i.e, a switch or variable)

    That's what he have so far, right?
     
    #11
  12. Shaz

    Shaz Veteran Veteran

    Messages:
    37,796
    Likes Received:
    11,503
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
     
    #12
  13. Silent Darkness

    Silent Darkness Robomage Veteran

    Messages:
    2,284
    Likes Received:
    321
    Location:
    Dark Realms
    First Language:
    English
    Oh. Right.

    • Infinite Loops
    • Unanswered Autoruns/Parallel Processes
    • Deactivating windows without opening another one.
     
    #13
  14. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,630
    Likes Received:
    14,377
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    Loading an outdated save file after doing script changes.
     
    #14
    estriole likes this.
  15. OM3GA-Z3RO

    OM3GA-Z3RO Wounded Seraphim Veteran

    Messages:
    826
    Likes Received:
    180
    Location:
    Manaria
    Oh no, not at all, if I was asking for help I would go to the right place, I was just checking if this is caused by a script lock, like one of the RPGM's main scripts but I was thinking of something else then.
     
    #15

Share This Page