Item click use problems
Moderators: Moldew, Jakkal, Community Managers
Item click use problems
Not sure what changed , but i had 2 items scripts not work today. I finally figured out what the problem was and it was in the call back function.
AddItemCallback(item, PC, "CapturedCrawler", timer, target) The "item" was working before but now it is not. I had to changed to actually use the item ID #
and it now looks like this AddItemCallback(1274294, PC, "CapturedCrawler", timer, target.
IN boh my scripts that had stopped working , all the script worked fine till it came to the item callback function then it would fail at that point.
AddItemCallback(item, PC, "CapturedCrawler", timer, target) The "item" was working before but now it is not. I had to changed to actually use the item ID #
and it now looks like this AddItemCallback(1274294, PC, "CapturedCrawler", timer, target.
IN boh my scripts that had stopped working , all the script worked fine till it came to the item callback function then it would fail at that point.
Re: Item click use problems
I had to change the underlying way item lua passes the item to c++ functions. I thought I hit all the underlying uses but missed that one. It's a very simple fix and I'll get it corrected soon.
Re: Item click use problems
I just updated the code on this so it should be fixed soon. Expect plenty of item weirdness coming up as I do another pass through that system.
Re: Item click use problems
Thank you zippyzee
I can leave the scripts with actual item id # in right and should still work ?
I can leave the scripts with actual item id # in right and should still work ?
Re: Item click use problems
The script needs to go back to the way it was if you altered it. There should be no need to change any item scripts; this is all handled internally by the code. I tested on some of the IoD scripts and it seems fine.
The reason this had to change is that the item id is not specific enough. A player could have two or more items with the same item id but different characteristics, like charges remaining, durability, etc. With the code changes whatever item is being 'used' or called back will be the actual item and not looked up by item id, which is ambiguous.
This will cause problems in spawn scripts that might want to generate a callback to an item script. The spawn script will need to get a pointer to an actual item to call its script, rather than use the item id. Not a big deal, and we'll cross that bridge if/when we get there.
The reason this had to change is that the item id is not specific enough. A player could have two or more items with the same item id but different characteristics, like charges remaining, durability, etc. With the code changes whatever item is being 'used' or called back will be the actual item and not looked up by item id, which is ambiguous.
This will cause problems in spawn scripts that might want to generate a callback to an item script. The spawn script will need to get a pointer to an actual item to call its script, rather than use the item id. Not a big deal, and we'll cross that bridge if/when we get there.
Re: Item click use problems
Thanks for clearing that up zippyzee ill change the three scripts back today.