HTML5 Problem with first click in HTML5 games

Discussion in 'Game Design, Development And Publishing' started by MarianoMaff, Nov 15, 2018.

Tags:
  1. MarianoMaff

    MarianoMaff Member

    Joined:
    Oct 17, 2018
    Posts:
    4
    Hello friends, when I convert my games made for Android to HTML5 almost everything works fine, you always have to make some adjustments but there is something I do not know how to solve and it is driving me crazy, the first click of the mouse does not work or the first released, it throws a error:

    Uncaught TypeError: Can not read property 'length' of undefined

    I need to deliver a game today, I can pay someone to help me solve this problem, please reply to this message and if you want to send me something for private it is a shared.dreams.studios@gmail.com
    Thank you very very much!
     

    Attached Files:

  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    3,240
    Try running under debug mode first. This should hint you at the exact line in GML where the error comes from.
     
  3. MarianoMaff

    MarianoMaff Member

    Joined:
    Oct 17, 2018
    Posts:
    4
    Hi FrostyCat, first of all thank you for helping me. In debug mode the only error that I get is the ini file, everything says 100% but in the ini file it says 0%, can that be the problem?
     
  4. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    3,240
    That could very well be it. The HTML5 export needs INI files to be included files before you can use it with ini_*() functions.
     
  5. MarianoMaff

    MarianoMaff Member

    Joined:
    Oct 17, 2018
    Posts:
    4
    I have tried everything, I guess it will be a Game Maker error and we will have to get used to having people double click to play the game, the error is always the same, if someone with more experience has some other possible solution to taste it I will do. The console, making that invalid click says:
    "Uncaught TypeError: Can not read property" length "of undefinded"
     
  6. dannyjenn

    dannyjenn Member

    Joined:
    Jul 29, 2017
    Posts:
    463
    Maybe it's just slow loading the ini file, and the error is a result of it trying to read from the file before it's loaded?
    Maybe you could make it so that the game waits a second or two before allowing for the first click. Not sure whether that would work, but it's worth a try. Definitely not the best solution though.
     
  7. MarianoMaff

    MarianoMaff Member

    Joined:
    Oct 17, 2018
    Posts:
    4
    Thanks for answering, I also thought it could be a matter of time but not, if you click at the beginning or after half an hour the first one will always be invalid
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice