Home › Forums › Bug Reports and Feature Requests › TypeError: 0 is read-only
- This topic has 11 replies, 2 voices, and was last updated 4 years, 10 months ago by Yuri Kovelenov.
-
AuthorPosts
-
2020-01-30 at 1:39 am #23111GLiFTeKCustomer
hi,
I’m getting this when trying to write to a dictionary.
when i remove the puzzle to write .. it goes away.any reason it would think that it’s read-only?
thanks.
EDIT: freezes the Verge3D element as well.
Version 2.17.1
windows 10
firefox and chrome both latest behave sameVisit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-01-30 at 6:21 am #23115Yuri KovelenovStaff2020-01-30 at 6:54 am #23116GLiFTeKCustomerHi,
How exactly do you write to a dictionary?/ahem/
Setting a key.
Puzzle: set key “bar” in dictionary “foo” as “0.125”.Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-01-30 at 7:54 am #23118Yuri KovelenovStaff2020-01-30 at 1:37 pm #23123GLiFTeKCustomereeeeyup… have a special key i hit when i want it to update in console to check on it.
the error is pretty random though.the dictionary is updating a value as a mouse drags a jqueryUI slider.
I am using Jquery from a separate js file send the variable to a Verge3D puzzle procedure.Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-01-31 at 6:33 am #23125Yuri KovelenovStaff2020-01-31 at 10:16 am #23130GLiFTeKCustomerI see. Try to output the dictionary’s value before updating its key and see if there is anything unusual.
that’s exactly what i have already.
the keys store the value of the % of completion each corresponding object has in revealing their 3D form.each user input, it retrieves the previous interaction’s last value, to pick up where it left off.
EDIT: ok.. so i fixed this problem.. and this is an oddball one..
when i first made this dictionary..i had initialized the dictionary with all key’s item values being text “” puzzles.however they wouldn’t be updated as numeric values.
when i put in “0” puzzles, instead of the text “” puzzles, it worked.. but then froze with the TypeError: 0 is read-only” described above…i tried “null” logic puzzles, or leaving them empty, and got “object “.this_” is null .. and the error was coming from my animation tween puzzle.
so.. just now.. i used the text “” puzzles.. WITH the “convert to number” puzzles on all of them…
and the error isn’t happening anymore.don’t know which end that issue was on , the jquery code or the puzzle dictionary…
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-01-31 at 12:17 pm #23138Yuri KovelenovStaffKeys in a dictionary are basically properties of JavaScript Object, and if anything else is used for a key it is converted to text automatically.
Glad you worked it out though!
2020-01-31 at 12:20 pm #23140GLiFTeKCustomerwow, ok then!
any suggestions you have for storing numerical data, instead of dictionaries?
just use a list of lists of vars?Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-01-31 at 1:14 pm #23141Yuri KovelenovStaffjust use a list of lists of vars?
yep it should work
2020-02-04 at 1:53 pm #23271GLiFTeKCustomeractually just found none of these issues stemmed from writing numbers to dictionaries.
it was all from the tween.js lib of visual logic not liking my “.this” usage.
fixed though… it was when there was no “this” to say was “this”
Visit the GLIFTEK Verge3D Plugins Store!
GLIFTEK.com for Plugin Documentation & LIVE DEMOS!
LIKE The GLIFTEK Facebook Page for updates!
Join the Verge 3D Discord Server!
plz share Discord link & on your signature!2020-02-05 at 7:14 am #23278Yuri KovelenovStaff -
AuthorPosts
- You must be logged in to reply to this topic.