In the end it turned out the problem was that I was setting IntParameters with float values.
I changed all the shader parameters to float types and now the values altered by the script stay altered.