Function not found "ScriptDictionaryItem"

for once I have a simple question i think, was going to try Script Dictionaries to expand my skillset... and this error came up, I'm still using 5.72...so was this function added in 5.8? otherwise I'm a bit confused. I know "Do" can run an attribute script but had no luck when trying to get it to run a script dictionary


The function could be new; I remember checking and finding there wasn't a function like that. Maybe it's been added in a later version and I didn't notice.

If it isn't available, you would have to do something like:

script = DictionaryItem (dict, key)
invoke (script)

Note that splitting it over two lines like that may be necessary… built-in statements like invoke often check the type of their arguments at compile time, so invoke (DictionaryItem (dict, key)) could check whether DictionaryItem's return type is "script" (it isn't, because it depends on the type of the dictionary) and then fail without even trying to execute the line.


Yeah, I think my version really doesn't have much in the way of Dictionary functions, also seem to be missing DictionaryItem using the editor to search for functions w/show library elements shows none of them as well.

Think I'll have to upgrade at last and just tell my players they'll have to as well..

edit-nope, new version only added functions i thought it did, Maybe its my logic that going wrong

DictionaryItem (Vendor 2.plush, 1)
invoke(script)

Where the Vendor 2.plush is the object attribute and 1 is the associated key,
I assume this would run the script(and code) the key refers too.

edit 2, I think i figured it out, putting the key in " " to treat it like a string seem to have been able to parse it, since i had been using numbers i kept thinking int's


also seem to be missing DictionaryItem using the editor to search for functions w/show library elements shows none of them as well.

It's a hard-coded function; it's written in C#, so you can't see it in the editor.

edit 2, I think i figured it out, putting the key in " " to treat it like a string seem to have been able to parse it, since i had been using numbers i kept thinking int's

Yeah… hard-coded functions are strongly typed; so ScriptDictionaryItem (dictionary, int) and ScriptDictionaryItem (dictionary, string) would be completely separate functions, and it wouldn't find one while looking for the other.

If you'd quoted the whole error message, I would have pointed that out right away.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums