I need help lol

0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello, I have a sprite that works like a button,

    what im trying to do is, a player needs 180 experience to upgrade an equipment something like that, then it should it make it level 1, and subtract your experience, when your equipment is level 1 it requires 216 experience to upgrade to level 2, right. So, when i click on my sprite button, it makes it level 2 already.

    I want it to upgrade one by one.

    so i just copied my sprite button and paste another one next right to the original sprite button, and on original button i put instance variable value to 1, and my copied paste sprite i put instance variable value to 2, okay. when I run the game, it works perfect when the buttons are next to each other, but when i overlap them, then it doesn't work. T.T

    one of my upgrade system, I had to make over 500 different buttons just to get the upgrade one by one to work and i dont want that many buttons, i just want one button.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You don't need to make loads of objects but I also can't imagine the system from your description. You can use a global variable to track experience and then change the animation of the equipment based on this, or something. I don't know what you want to happen but you can probably do it with one button.

  • when player has enough experience and when you click the Button it should make it level 1, and when you have enough experience you click button again it should make it level 2.

    Level 1 requires 180 experience, and level 2 requires 216 experience.

    when the player has 1600 experience, and then click on button it triggers both events and makes it level 2.

    I want it to upgrade one by one.

  • You need to check for the player level (a global variable) when you click. If it's 1 then you compare the experience and upgrade to 2. Then on next click and you check the player level it will be 2 and you can upgrade from 2 to 3. You can put all these condition checks in the button click event with else.

  • i made a group,

    if Character Equipment lvl is = to level 0

    and experience is greater than or equal to 180

    and button instance variable is equal to 1

    and when click button it should make Text to level 1

    second group

    if Character Equipment lvl is = to level 1

    and experience is greater than or equal to 216

    and button instance variable is equal to 2

    and when click on button it should make Text to level 2

    every time when i have 1600 experience, and then i click on button it makes the Text level 2 already and not level 1 first, It triggers both events at once.

    but if i change the equipment lvl to (if character LVL is = 4 then if u click button it should make Text to level 1, and if character LVL is = 7, then if u click button it makes Text level 2) then it works perfect, i dont understand why the equipment level isn't working :(

  • I still can't see the proper event structure but it sounds like it is changing the character level in the same tick so it changes character level to 1, which is true for the event below then changes it to 2. You can put it all in one event with sub events/else so it checks the level and only runs one of the actions.

    So if level = 1 do this else if level = 2 do this, not separate events down the sheet.

  • It works perfectly when I just copied my button sprite and paste it next to the original button, then i just change its instance variable to "2", original instance variable is "1"

    works perfect when buttons are right next to each other, but it doesn't work when they are over lapping each other, like I place the copied sprite on top of the original button.

    xD ahh well, i'll figure it out soon

  • I'm not sure if that's a great way of doing it though even if it is working, you shouldn't have to create 500 objects to get this to work, just follow the above or I can make an example.

  • it just weird,

    every time i click this item it gives me experience, 160 experience every time i click it

    To upgrade to level 1, I need 180 experience, when I have 320 experience, when i click the button it subtracts 180 and makes the Text level 1. Then I have 140 experience left, 320 - 160 gives you 140

    when i click item again, it will give me 140 + 160 = 300, then i will have 300 experience, and when i click the button it makes the Text level 2. It does everything perfect,

    but every time when i have like 1600 experience, or more, if i then click the button it makes Text level 2 already, it keeps triggering them both.

  • Yes the issue is what I've already described above, not sure what more I can say. In your example you don't have enough experience to do both 1 and 2, thats why it doesnt do them both. When you have 1600 experience it is enough to run both 1 and 2 because it is checking all of your events from top to bottom.

  • How can i make it upgrade one by one?

    if i have 1600 experience, i want to click then it becomes level 1, and i click again it becomes level 2.

  • how to open it?

  • Are you using construct 2? You could probably still open my file on construct 3 here and play it to take a look. Go launch construct 3 at the top and open file.

  • I tried to do what you did, it doesn't work.

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