[solved]Variable sets to wrong number, go to different level then back and it is correct

  • I am playtesting my game and on the level 1 it works fine for a while, then I hit a certain player level and the damage the player deals becomes incorrect. I switch to level 2 and the damage is what it should be, switch back to level 1 and the damage is now correct.

    I have it setup that on level 1-1 on start of layout set playerDungeonDamage to playerStrength / 2

    this is the same for level 2-1

    players strength was 26 but it set the damage to 3 instead of 13. When I went to level 2-1 the damage showed 13, went back to level 1-1 and damage showed 13.

    Any thoughts as to why this would happen?

    before going to level 2-1 I ran the game in debug mode and the playerStrength variable showed 26 and playerDungeonDamage showed 3 before I even entered the level, while I was still on the main menu.

    I didn't upload a capx because i don't want to bother anyone with debugging for me just looking for thoughts as to what might cause that to happen?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You didn't really go into detail about the events that happen when the player levels up. Considering that's where it goes wrong then I would look there. You only set dungeon damage on start of layout, maybe you change that to 3 when the player levels up?

  • You didn't really go into detail about the events that happen when the player levels up. Considering that's where it goes wrong then I would look there. You only set dungeon damage on start of layout, maybe you change that to 3 when the player levels up?

    No I have it set to add playerNextLevelSTR to playerStrength and playerNextLevelSTR is set to 2. As well the only place in the game that I have the set playerDungeonDamage to playerStrength / 2 is in the start of level layout

    this is the level up code

    http://funkyimg.com/i/2HxQy.png[/img]

  • Here is a capx if anyone feels like looking through it. I have looked through the weapon upgrade, player level up and the on start of layout for the levels and just don't see why it would revert to 3 and on another trial it took it down to 0. It usually does it once player reaches a strength of 20

    https://drive.google.com/open?id=1t4FW5UxcMLqQGrK59mxRQ-tKiARYB2lZ

  • No-one is going to be able to help unless they've purchased this parallaxbg behaviour from the store.

  • No-one is going to be able to help unless they've purchased this parallaxbg behaviour from the store.

    oh I thought I removed all instances of it's use, darn I will recheck it or try uninstalling it from that version

  • No-one is going to be able to help unless they've purchased this parallaxbg behaviour from the store.

    oh I thought I removed all instances of it's use, darn I will recheck it or try uninstalling it from that version

  • No-one is going to be able to help unless they've purchased this parallaxbg behaviour from the store.

    Think I found the last instance that used that behavior so it should be able to be opened now without owning that behavior

    https://drive.google.com/open?id=1vxy0dSRlliud5io6Jgih78bSwfi1CCcO

  • Something is still using that behaviour so it can't be opened.

  • Something is still using that behaviour so it can't be opened.

    arg, ok thank you for trying, appreciate it. I will give it one more go to see if i can track down what's using it

  • Something is still using that behaviour so it can't be opened.

    Ok so third times a charm right? I had one level that the background layer was unchecked so that has been removed and that should take care of it. If not then i have no idea what instance is still using it lol. Thank you for all your time in trying to open the file project to check my work, I do appreciate the time spent and feel bad that I haven't had them all removed.

    https://drive.google.com/open?id=1VP-CvqwVY2Vfy1xAuO9rM6kTF1UnVaMR

  • Nope not working. Before you upload it again you could temporarily remove that behaviour from your local folder, then try and open your capx to see if it requests it.

  • Nope not working. Before you upload it again you could temporarily remove that behaviour from your local folder, then try and open your capx to see if it requests it.

    Nope it's looking for it but i don't know where. I even went through and deleted all the background layers for each level lol. Oh well I will just have to keep combing through the code and see if something pops out at me

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