Sub Event Issue [FIXED]

0 favourites
  • 7 posts
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • Is there any particular reason that the sub events are not firing here?

    I've ensured that the variables are tested and are fine but the sub events will just not fire.

  • At a guess, LastData is a string, so convert it to an int.

  • Get rid of the else's.

    They don't really serve a purpose here anyway.

    Else means if none of the other conditions are correct, and probably won't work properly using multiples of it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I was using else statements so that other parts of the code didn't run. If it works like a typical if statement I didn't want it to keep comparing the variables but I removed them anyway.

    I converted the value to an int but unfortunately it still won't run. IsMember returns 1 on a successful login and the debug shows it logs in but the sub events just do not seem to want to fire.

  • These elseif's are useless, but not a problem. They are only usefull if same values compared in more than one if or with a complete else on end.

    If lastData is correct, there must be something wrong with int - string use, is the global int and you int(AJAX.LastData) or int(isMember) on compare?

    You also can change the second compare value to string...

  • Set up a debug text object, put the value of isMember in when it fires and see what is actually coming over.

    Could it be something else ? TextStrings don't appear if they don't fit in their bounding box, so it may actually be firing even if it looks as if its not firing.

    Incidentally, can you do console.log in C2 ?

  • I took away the change to an int and replaced the condition checks with strings and it now operates.

    Thank you for the help.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)