1. #1
    Core2TOM's Avatar Senior Member
    Join Date
    Mar 2014
    Location
    Germany
    Posts
    506

    Percent calculation in sidebar

    on top you see 2x times. center is your current wheelie time and left is your best wheelie time out of 3 attempts. the left sidebar shows the % of your best wheelie time. when the bar is full (100%) you reached your best wheelie time again and that time should be increased.

    best wheelie time / current wheelie time * 100 = %

    my problem is the sidebar itself. on your first attempt interpolation in the variable datasource is on (otherwise it wouldnt display anything at all) if you die, interpolation is turned off.

    interpolation type: exponential
    interpolation speed: 99
    max step: 10

    the problem is that the bar isnt completly filled. sometimes it is, but mostly not. at 1:33 its working!
    any idea how to to solve that problem? i remember i had the same problem in trials evo aswell

    Share this post

  2. #2
    didn't watch the vid but i remember that the sidebars could break if you went above max value
    Share this post

  3. #3
    Blastergamer's Avatar Senior Member
    Join Date
    Mar 2014
    Location
    Rocking Trials Country
    Posts
    2,539
    It's a problem when you're using a set value event with an interpolating variable data source. The reason is when the value sent a value WHILE the variable data is still interpolating, it gets overwritten and the unfinished part of the interpolating is lost.

    You can resolve by using 2 variable data sources. Disable "interpolate"in the first variable. And for the interpolating, use interpolating in the second variable and connect "value" to the first one.

    So like this: Set Value Event --> Variable Data Source -Value-> Variable Data Source (with interpolation) --> Operators etc.
    Share this post

  4. #4
    Core2TOM's Avatar Senior Member
    Join Date
    Mar 2014
    Location
    Germany
    Posts
    506
    @ sparkierjonesz: im not going above the max value. 0% - 100%

    counter 3
    min value: 0
    max value: 100
    sorting order: descending

    everything is correct (or lets say it should be) thats why i dont understand whats going wrong

    @ Blastergamer: like i said interpolation is ONLY activated on the first attempt (it has to be 100% filled on that case) im using a set value event just to deactivate the interpolation. after that there is no interpolation anymore and i get the problems.
    Share this post

  5. #5
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195
    hmm, are you using a generic filter to test if above 100%? if yes, are you then updating the counter after the filter to 100%?
    Share this post

  6. #6
    Core2TOM's Avatar Senior Member
    Join Date
    Mar 2014
    Location
    Germany
    Posts
    506
    variable datasource (best time) -> operand 1 -> two-input operator (divide) -> operand 2 -> variable datasource (current time)

    ... two-input operator (divide) -> two-input operator (multiply with 100) -> COUNTER 3: variable datasource (gets the value from the multiplying two-input operator)

    ... impulse when faulting for the first time -> set value event (0) -> variable datasource (1) -> interpolation on/off -> COUNTER 3: variable datasource

    the times are done separatly. the sidebar is just something i want to add, to make it more clear to the player
    Share this post

  7. #7
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195
    that sounds like its a bug with the max/min clamping for the score system!! i'm going to test this, along the lines of min=0, max=100 and then sve increase 34 to a vds tied to the score.

    if this is a bug with the scoring system, maybe add a interval (ever 30 ticks or so) that checks if >100% and then simply set the value to 100%, then disable the interval.

    edit: it still doesn't really help as it adds code, probably the simplest method would be to use the switch operator and tie the output score to that, then have either 100, or your % as its options and use the generic test to change the switch state.

    edit edit: in-fact you could remove the generic test and have a two input set on greater equals 100 and use the output from that to control the switch operator.
    Share this post

  8. #8
    Core2TOM's Avatar Senior Member
    Join Date
    Mar 2014
    Location
    Germany
    Posts
    506
    not sure if its a bug or not, because SOMETIMES it is working. thats the weird thing i got the same problem in evo.
    and i dont think a set value (100) event would help, the value is 100 already. mostly the bar simply doesnt display the value correctly... maybe the two-input operators calculates the value too fast? so that the bar cant handle it?
    Share this post

  9. #9
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195
    i guess it could be calculating faster, i was surprised to find that if any value is change in a sequence of maths that all items attached are updated, if you updated both operands on a two input say, all the data would be recalculated twice! (ok i get why, but still). Makes me think that they check if the value is over max and then disable the update function until the value goes under max and have missed setting the value to max.
    Share this post

  10. #10
    Magnus2552's Avatar Junior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    18
    Originally Posted by Core2TOM Go to original post
    variable datasource (best time) -> operand 1 -> two-input operator (divide) -> operand 2 -> variable datasource (current time)

    ... two-input operator (divide) -> two-input operator (multiply with 100) -> COUNTER 3: variable datasource (gets the value from the multiplying two-input operator)

    ... impulse when faulting for the first time -> set value event (0) -> variable datasource (1) -> interpolation on/off -> COUNTER 3: variable datasource

    the times are done separatly. the sidebar is just something i want to add, to make it more clear to the player
    I guess, you swapped the operators of the divide function.
    Let P be your Percent variable, then
    P= (Current Time / Best Time) * 100 (you dont need the parentheses, but I put them in to make things clearer)
    You did it the other way around: You made:
    P= (Best Time / Current Time) * 100
    But I think this is wrong

    Please note that my algorithm will raise an Error due to Zero Division, when no best time is set. I dont know, how the Editor handles Errors, but please do a safety algorithm that gets executed, if no best time was set yet.

    I hope this solves the problem.
    Share this post