What is this bug? (video)

0 favourites
  • 8 posts
From the Asset Store
8-bit retro-style music and sound effects: 10 loops-able music tracks and 301 individual SFX!
  • Faced a strange bug and do not know what it is.

    In crats.

    Each level has its own rate of withdrawal of health with the distance traveled.

    When we just start viewing, everything works, that is, if (Example) A player passes 100 meters he loses 100 HP for every meter of 1 HP. That is, if a player passes 50 meters, he will lose 50% healthy.

    As we see in the pen video is what happens. But as soon as I do a remote view or import a game to another device, it instantly loses much more health than is written. And regardless of the level, it loses its identical value.

    What's wrong????

    For the loss of health is only 1 line.

    Video:

    yadi.sk/i/NrCD85wJwYZIFw

    Tagged:

  • The loss of health is only one line, yes. But, you are subtracting a constant from HP_Pet, not a percentage. That means, HP_Pet is LESS in remote preview than it is in preview. So how are you setting the value of HP_Pet?

    Just curious, try this: Subtract (HP_Pet * .01) from HP_Pet

    If both preview and remote drain the same amount using the formula above then it's the value of HP_Pet that's definitely different.

  • The loss of health is only one line, yes. But, you are subtracting a constant from HP_Pet, not a percentage. That means, HP_Pet is LESS in remote preview than it is in preview. So how are you setting the value of HP_Pet?

    Just curious, try this: Subtract (HP_Pet * .01) from HP_Pet

    If both preview and remote drain the same amount using the formula above then it's the value of HP_Pet that's definitely different.

    Nothing was remembered unfortunately. The situation remains the same

    The number of HP is a constant value. It does not change = 100 * 5 (its value is always 500)

  • Nothing was remembered? Do you mean that it didn't change the formula to Subtract (HP_Pet * .01) from HP_Pet???

    This sounds strangely like a browser caching issue.

    When you load up the remote preview in Chrome hit Ctl-r and f5. That forces Chrome to reload the page.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nothing was remembered? Do you mean that it didn't change the formula to Subtract (HP_Pet * .01) from HP_Pet???

    This sounds strangely like a browser caching issue.

    When you load up the remote preview in Chrome hit Ctl-r and f5. That forces Chrome to reload the page.

    No, I mean the result is the same as before. In simple viewing, HP is subtracted as it should, and with remote viewing it is very fast.

    I do not think that this is related to caching, since the same problem when importing into xCode

  • Ok, what I would do is to add a global text box somewhere and have it constantly display the actual value for HP_Pet. Right now, your hp bar is showing a percentage. You need to see the actual value of HP_Pet when the game loads and when you move just one space. Something is either changing how fast it makes that calculation or it's performing that calculation multiple times. Until you know the actual amount of HP_Pet and how much 1 move subtracts, you're just guessing.

  • And I just did a test with a progress bar where I subtracted an amount from a global variable every 0.5 seconds and set the progressbar.value to that amount. It worked as intended whether I ran in preview or remote preview.

  • And I just did a test with a progress bar where I subtracted an amount from a global variable every 0.5 seconds and set the progressbar.value to that amount. It worked as intended whether I ran in preview or remote preview.

    Many thanks, I will try to remake the system now as you say.

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