Progression Bar Error

Discussion in 'Buildbox 3.0' started by andre_sprs, Dec 19, 2018.

  1. andre_sprs

    andre_sprs Serious Boxer

    Joined:
    Sep 30, 2015
    Messages:
    844
    Likes Received:
    402
    For the progression bar, what would cause these errors "Undefined" & "Nan"? Also as you can see from the screenshot below the words are behind the bar and the actually progress bar that goes across is behind as well, How can I bring these to the front or on top of the bar?

    Screen Shot 2018-12-19 at 8.11.12 PM.png
     
  2. steve

    steve Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    103
    Likes Received:
    36
    I seem to remember seeing something similar when I was setting one up, but can't for the life of me remember what I did to fix it (sorry). Best suggestion I can give is double check the progression.bbdoc file and make sure you've got everything setup the same way.

    If I can remember what was causing it I'll let you know.
     
    andre_sprs likes this.
  3. steve

    steve Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    103
    Likes Received:
    36
    progressionnodes.png
    Have you added the Level Selector and other nodes to your Character (see yellow box above)?

    I was able to replicate your error, by adding the progression to a new project. Adding the level Selector (it's under Actions) to the character sorted it. Not sure how Nik got his Level selector to appear as green, When I pull one in it's red. Hope that helps.
     
    andre_sprs likes this.
  4. andre_sprs

    andre_sprs Serious Boxer

    Joined:
    Sep 30, 2015
    Messages:
    844
    Likes Received:
    402
    Ah. No I didn't see the Level Selector nodes thanks for pointing this out. I'll add it now to my game and see if that fixes the issue
     
  5. andre_sprs

    andre_sprs Serious Boxer

    Joined:
    Sep 30, 2015
    Messages:
    844
    Likes Received:
    402
    Thx, so adding the level selector node worked but now the bar is overlapping. Did you also run into this issue?

    Screenshot-1125x2436-2018-12-20-10.43.18AM.png
     
  6. steve

    steve Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    103
    Likes Received:
    36
    Well we're making progress (pun intended). No I didn't have that issue. Looks like you just need to go into the bar node of the Progression asset and make it slightly shorter, or move it a bit to the right, if it falls short when it gets to the righthand side.

    Here's what mine looks like:
    progressbar.jpg
     
  7. shahar.m192

    shahar.m192 Avid Boxer

    Joined:
    Oct 7, 2018
    Messages:
    204
    Likes Received:
    44
    can someone tell me about the progress bar the problem here its i have 4 worlds and the first level integrated good with the progress bar its have 2 scenes but if i want to change the progress bar to the level 2 for say to shorter or longer its changes in all worlds what can i do here?
     
  8. thatguyminib

    thatguyminib Serious Boxer

    Joined:
    Jul 1, 2017
    Messages:
    552
    Likes Received:
    309
    OCD lol move the blue up a tad I can see some grey coming through.
     
    steve likes this.
  9. steve

    steve Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    103
    Likes Received:
    36
    Yeah I'm ahead of you on that. It didn't show on my phone, but as soon as I saw the blown up image, I thought I've got to fix that :)
     
  10. steve

    steve Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    103
    Likes Received:
    36
    Yeah I was having a similar problem. I'm not much of a coder, but have managed to fudge it on mine, until such time someone comes up with a better solution.

    The way I've done it is to have an object at the end of the scene. Then within the Progression script I find the position of that object, add in a fudge factor (as the position values in the scene don't tie up with the distance travelled in the game) and use that for the _distance value. A bit of a kerfuffle, but it gets the job done for now.
     
  11. shahar.m192

    shahar.m192 Avid Boxer

    Joined:
    Oct 7, 2018
    Messages:
    204
    Likes Received:
    44
    you mean only here to give the object name by adding it to the end of the scene?
     

    Attached Files:

  12. steve

    steve Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    103
    Likes Received:
    36
    I've set mine up so each scene is a new level rather than having separate worlds, but should work similar. At the end of each scene I have an object called "finish". Within the code I search for entities with the name finish. I know there's always going to be just the one on each scene, so I only then use the first element in the returned array.

    I then get the position of that entity and take the x coordinate (as that's the direction my game moves in) and apply my fudge factor. Don't ask me the basis behind the values here, it's just what works for my game, after a period of trial and error to get it right across the various scenes. You'll probably need to do your own trial and error here to get values that work for you.

    I've highlighted the code changes I made in yellow, but bear in mind I'm not a coder. Any coders out there please feel free to chip in and point out any improvements that can be made to the code;)
    progressionlengthcode.png
     
  13. steve

    steve Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    103
    Likes Received:
    36
    @shahar.m192 thinking a bit more about the fudge factor I use and realise it's not such a fudge factor after all, there is actual method behind it.

    My start scene is goes from a start position of -10 to an end of 10 (so 20 in total) then each of my scenes start at -10, so that means in order to get the distance correct I need to add a total of 30 to each of my finish positions for the distance to be correct. If you multiply 30 x 50 you get 1500, which is the value I've been adding in to all the distances. Then I also multiply my finish distance by 50, so that's obviously the factor required to convert from coordinates when positioning items to the actual distance in the game.

    As you're working at a world level, rather than scene level, you shouldn't need to add in the extra 1500. I'd suggest you put your finish marker on your start scene for each world, but make sure you position it at a far enough distance that it takes into account the distance of all your scenes in that world.
    (e.g. say your have 2 scenes in your world. The start scene runs from 0 to 30 and the 2nd scene runs from 0 to 70, you'd want to put your finish marker at position 100 on the start scene). I don't think there's any reason why it can't be position after the end marker for that scene.
     
  14. steve

    steve Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    103
    Likes Received:
    36
    Just realised that in my code snippet rather than writing:
    let ent = ents[0];
    let pos = ent.position();

    I'd be better writing:
    let pos = ents[0].position();
     
  15. shahar.m192

    shahar.m192 Avid Boxer

    Joined:
    Oct 7, 2018
    Messages:
    204
    Likes Received:
    44
    thank you so much man i will try this later for someone who doesn't know code you done enough haha tnx.
     
  16. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    @NikRudenko
    There seems to be a pretty major bug in using the Level/Progression method in BB3. If you setup a UI Main Menu between your START and World the system will crash when you attempt to do a save with an Uncaught exception error. Take the Main Menu UI out and just go directly from START to your World and it works, unless you have a lot of objects in your world and then you will get the same crash. This is true even if you remove the Progression node. In fact remove the Level Selector node and just do a menu jump and if you have a Main Menu the game will play just fine, but will crash when you attempt to save it.
     
    Last edited: Dec 24, 2018
  17. shahar.m192

    shahar.m192 Avid Boxer

    Joined:
    Oct 7, 2018
    Messages:
    204
    Likes Received:
    44
    you guys facing the same problem in the beta 4 if you make a new scene by copy paste or pressing d its make a new scene but when you test your game some scenes are
    repeating themselves?
    thanks.
     
  18. weboha

    weboha Avid Boxer

    Joined:
    Aug 8, 2018
    Messages:
    239
    Likes Received:
    178
    did you try to add this?

    if(Settings['level'] === undefined){
    Settings['level'] = 1;
    }
     
  19. shahar.m192

    shahar.m192 Avid Boxer

    Joined:
    Oct 7, 2018
    Messages:
    204
    Likes Received:
    44
    you want me to copy it into the level selector node?
    im talking that there is no align scenes eaven im pressing that its not follow the right order for some reason for say scene 2 will be showing 2 times or more.
    also happend to me that i hat start scene and 2 scenes i added but i copy paste new scene and i didnt saw the new scene i added in the game when im playing it
     
  20. tensini

    tensini Boxer

    Joined:
    Jan 14, 2019
    Messages:
    3
    Likes Received:
    0
    @steve Hey! Could you share ur progression asset?
     

Share This Page