ThePowerTool
New member
"While the special-typed variables are declared the same as primitive types (ie: item i), special-typed static values are declared very differently from static values. To specify that a value is of a special type, $typename[value] must be used, with a string in square brackets designating the intended value (ie: $item[cog])."--Veracity's tutorial (Advanced.html).
I have a question regarding this and a sample script:
Why does the 1st declaration work when simply uncommenting the 2nd declaration yields:
I have a question regarding this and a sample script:
script "test-item-w-var.ash"item test_i=$item[bottle of Pete's Sake];print("test_i="+test_i);string my_str="bottle of Pete's Sake";# test_i=$item[my_str];# print("test_i="+test_i);Why does the 1st declaration work when simply uncommenting the 2nd declaration yields:
Bad item value: "my_str" (test-item-w-var.ash, line 7, char 14 to char 20)