Interpolate not working correctly...

DrGlickertDrGlickert Member Posts: 1,135
edited November -1 in Working with GS (Mac)
I'd like to add my bonus scores after completing a level to the player's total score at the end of the level like TShirtBooth did in his tutorial video about interpolating scores.

I have this code:
Interpolate Attribute: game.Score to (game.Score+game.BonusPoints) Duration .5 seconds. Function: Linear

It appears that when the Interpolation begins it's continuously adding to the game.Score (WAYYY more points than what it should be). After the first level the "game.BonusPoints" is only around 200 (at most). So theoretically I should have approx. 1000 points from the level itself then add in ~200 bonus points for a total of 1,200.

After running the interpolation the value comes out to around 6,552. It appears that the game.Score is constantly being updated throughout the .5 seconds of the interpolation...

Any ideas how to fix this so that the game.Score value interpolates correctly??

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    just try a change attribute, game.score to (game.Score+game.BonusPoints) . if you are just adding a couple values I don't see the benefit of using interpolate
  • DrGlickertDrGlickert Member Posts: 1,135
    The benefit is a cool adding effect. Change Attribute works just fine, but it's boring. I was going for cool effects and making it look cooler.
  • AsymptoteellAsymptoteell Member Posts: 1,362
    I think it's because you're referencing game.score in the interpolate to. You should make another attribute that gets changed to game.score after the interpolate is done each time and have that +200.
  • IncendioIncendio Member Posts: 10
    tenrdrmer said:
    just try a change attribute, game.score to (game.Score+game.BonusPoints) . if you are just adding a couple values I don't see the benefit of using interpolate

    DrGlickert,

    I'm having the same issue that you were having with the whole score interpolation technique that T-Booth provided. I also share your view on how cool the effect looks, so I'm wondering how you may have resolved this issue? Did you have success implementing Asymptoteell's suggestion?
  • perfectanswerperfectanswer PRO Posts: 121
    Same issue here. The solution from Asymptoteell make it mch better (for me) but is not the solution at all. In my case I am counting the points (5 points for each hit) and have a score from 193 e.g..

    Use it with a new attrib. like this:

    Change Attribute:
    game.scoretemp To game.score +5

    Interpolate:
    game.score TO game scoreTemp Duration 0.1 Function Linear

    That works in most cases, but if I shoot 2 enemies with one shot, only 5 points added to the score. If you use a longer duration, the score runs away or serve you pretty wrong results.

    I think we need a better solution for this and btw. I love the rolling scores, too! ;)
Sign In or Register to comment.