Scripts broken?


#1

print(“hi”);
output:
> hi

Change the code to
print(“foo”);
output:
> hi

Seems like updates to scripts aren’t working… they still run the original code when first executed.

Even when I closed the script and reloaded it, it still spat out > hi even though the code was still print(“foo”);


#2

I guess you used the same name for the script,
What happens, scripts get cached. If you change something in the script, entity , sound etc. The scipt get loaded from cache. And it’s not loading the new script. You can try to press the refresh/reload button behind the script in the running script dialog.

Otherwise you need to add something at the end of your script url. so you get something like

myscripts.somewhere/script.js?1

With ever change you need to change the ?1 in some number you not used before. Yes i complained about it myself many times and still falling into this mistake that i forgot to add it and i see the wrong mesh entity get loaded.


#3

If I’m working at a script, I open it in the script editor in hifi. If I change it outside, I get a message in the script editor, that the script has changed. Then I stop the script in the script editor and start it again. Then always the new script version is running. This works well and it is for me more easy, than always to change the name.


#4

No, this is different. This just started happening today after I updated my interface.

Reloading works, by why did this just start happening today? Shouldn’t have to reload a script you are working on.


#5

Yikes, yes, the script editor is broken: have a script open in it; change it with an external editor; get a message in the script editor saying that the script has been changed; “reload” reloads it in the editor but when subsequently run it the scrip is run from cache instead of running the script currently in the editor!

I’ve entered this as an Asana bug report.

Work-around for now is to use the “refresh” button beside the script listed in Currently Running scripts dialog.


#6

Now the error is come also to the Mac. I change the script in the script editor in hifi, start it and the old script runs. I save it and start it and again the old script dos run.


#7

I remember why i don;'t like the script editor. The colors combinations are bad contrast for me. and the font i cannot set bigger. sofar i know the srcript editor is not javascript ? If it would be javascript it can be changed.


#8

Correct: the script editor is not JavaScript.


#9

The problem of the script editor running script from cache is fixed in Windows build 3212 / OSX build 3077.