Notification Box displaying old information

0 favourites
  • 6 posts
From the Asset Store
Dynamic, heavy and powerful rock themes. 11 music tracks.
  • My notification box is controlled by two functions: a spawn function and a destroy function. The way the box works is: when a notification needs to be sent, the box appears and moves halfway across the screen. After the user touches the screen, the box moves to the right and is then destroyed.

    The events look like the following:

    <img src="http://i.imgur.com/JVGHm34.png" border="0">

    There are two instances where the notification box is called:

    <img src="http://i.imgur.com/PNdKCaT.png" border="0">

    <img src="http://i.imgur.com/XlMLeRb.png" border="0">

    The group names are relatively self-explanatory: the notification box appears before the player is allowed to spawn, and before the computer spawns.

    You can run the program yourself to see how it works. Basically the problem is, the notification box text doesn't change like it's supposed to when the computer is spawning (it still displays the instructions for player spawning).

    BoardGame.capx

    My current theory is that DestroyNotification() is not being called at all, but I'm unsure how to test for that.

  • I've tossed in a few major actions to see if the DestroyNotification function is firing, and indeed it is.

    I wonder if this is a bug. I've done multiple searches through my events to find problem areas but so far the instances in the screenshots above are the only places where txtNotification is modified.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've made some modifications, but now the issue I'm having is, after EndNotification() is called, the return value doesn't appear to be returning.

    I have a debug active in the program that displays Function.ReturnValue every tick, but it never changes from 0 to 1.

    <img src="http://i.imgur.com/cDCcO0R.png" border="0" />

    In particular, this function that is supposed to be called upon being given the return value is actually never called.

    <img src="http://i.imgur.com/bjpcffL.png" border="0" />

  • I've decided this function.returnvalue thing just isn't going to work. I've implemented a workaround.

    The original issue (the point of this thread) is still present: the second time the notification box appears, it displays the first message instead of the second. I've done a debug test and the second message is correctly being passed into the function, but for some odd reason, the first message overrides the second.

    The three images in the first post of this thread depict every instance of when txtNotification is modified. I'm starting to wonder if this is a C2 bug because I cannot find anywhere in the game logic where the text is being overriden by the text passed in the first function call.

  • You seem to be abusing the Function.ReturnValue. You are using it as a global variable, to control your state, but that value is going to change every time a function is called, whether it returns a value or not. You should only be checking the return value immediately after a function call, and holding any state that you need to for later.

  • Only one function is called at a time in my program :)

    My intention is to check for when the notification box is done.

    EDIT: If a function does not have a specified return value, by 'default' the return value is 0, so this is not the issue since I'm checking for 1.

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