get_score() function does not return negative values as displayed in the GUI
Case number: | 845813-987811 |
Topic: | Game: Tools |
Opened by: | smith92clone |
Status: | Closed |
Type: | Suggestion |
Opened on: | Saturday, June 5, 2010 - 18:26 |
Last modified: | Wednesday, July 7, 2010 - 11:06 |
The get_score() function does not return negative values as displayed in the GUI.
One has to write a function to gather up the individual segment scores so that one has a script that works when the puzzle has negative values.
Please update get_score() to return negative values.
To prevent this, I always use this function instead oft get_score():
function xscore()
temp=get_score()
if temp==0 then
NumSegs=get_segment_count()
for k=1,NumSegs do
temp=temp+get_segment_score(k)
end -- k
end -- if
return temp
end -- function
If get_score() is 0, it creates a pesudo-sum by adding all segment scores.
But I hope, that it won't be needed some ay, as this function doesn't return the same value as get_score(), but it can be used as reference.
You need add 8000 points to negatives to get same anmount like displayed. Like this:
function score()
s=get_score()
if s==0 then
for i=1, get_segment_count() do
s=s+get_segment_score(i)
end
s=s+8000 --dunno why, but thats right
end
return s
end
Especially after alignment or rebuild, a puzzle score output unequal to a long-lasting 0 is definitely needed.
A friend of me has a very fast PC.
If he does a rebuild, score change this quick that he isn't able to stop rebuilding at a good score.
Looking to the undo bar doesn't help, if the score are equal or below zero.
Yes I realize that the sum of the segment part scores is 8000 points less than the GUI score.
The problem is that if the GUI score is negative, get_score() only returns 0, not the negative score displayed.
@rav3n_pl:
Yes, I noticed a difference, but I didn't that it it is always 8000 points.
I'll change my scripts now.
@smith92clone:
I hope they will fix it for gaining some speed.
If there are problems to change the get_score() function of the game, maybe creating another function would help.
Status: Open » Closed |
I've modified get_score so it will return negative scores. This will go out in a future update.
Status: Closed » Closed |
This went out in the last update. Marking as resolved.
Thanks!
In the developer preview, the undo score bar now shows negative values, thanks,
but the get_score() remains at 0.
Did I get an older DP-version?
For backwards compatibility, just calling get_score() still stops at 0. However, now it takes an optional boolean argument that specifies whether or not returning a negative score is okay. This is also reflected in the documentation.
Now I've seen it.
Thanks!
Yes, that's what I also meant here:
http://fold.it/portal/node/987589