StartAnimation Error

lewws shared this question 1 year ago
Answered

Hi,

I have a board game which was working.

https://www.geogebra.org/m/c5geysdm

After down loading and re saving with minor text changes, the file fails in desktop Geogebra

and also when uploaded.

https://www.geogebra.org/m/kxhbzpps

Button "Throw die" is working but "Make your move" button is giving trouble although the script command is in correct syntax:

SetValue[diethrown,false]

StartAnimation[move,If[roll<2,false,true]]

move is a numerical slider variable and roll is also a numeric variable.


Please assist to troubleshoot.


Regards,

lewws

Comments (3)

photo
1

Hi lewws,

I have downloaded "...kxhbzpps" from GGTube again.

I opened the downloaded file with GGB5.0.606.

Then I opened the algebran view and the properties for "move".

In the properties slider: min and max are empty. This is wrong.

Why these values are empty i do not know. I did not find anything in the scripts that could do this.

So it must have been done on local update, upload or update in ggTube. Among other things it is conceivable that in certain constellations the default values for sliders will be reset (wrongly).

The slider move contain a script onUpdate. This could lead to unexpected errors if GGB was forced to skip some slider steps (for performance reasons). This point as the cause for the missing min and max values seems to me rather unlikely.

Regards

Raymond

243cb5c3bb78779c3d5249a3ebd6da8c

photo
1

Hi rami,

Thanks for reply and the time to check through.

I took a long time trying to debug this problem.

I may have totally redesign this dice throwing and movement part again instead of debugging.


Thanks again Raymond!

Wishing you well!


Regards,

lewws.

photo
1

Hi rami,

I filled in the min max properties


67b01cf83eeea2dba94a256aca96e689


Added these to the On Update of slider move :

SetValue[move,If[move<selectedface,move,selectedface]]

If[move==selectedface,Execute({"StartAnimation(move,false)"})]


And it finally worked!


Thanks for pointing out that using variable selectedface for the max in the slider move is unstable.

photo
© 2022 International GeoGebra Institute