Author Topic: Event_addItem 2.0  (Read 4434 times)

I've made some changes to the addItem event, it's known as addNewItem in the event list.

This event can be like a search, or you can use an existing object if using eval or inside a script. addItem will still exist of other mods are using it, if you have any.
Hopefully this removes some console errors and makes searching a little more efficient after the first time using a cached variable base.
I've also added a findItemByName(%name, %resetItemCache) command as well.
The event doesn't use the item list, it's a string instead. <- This is not an improvement, this is just an item finder

Improvements: Uses "findItemByName" that uses a cached database after the first use; should remove any console errors if any.

"You can add items to yourself like never before!"
Event_addItem
« Last Edit: April 05, 2015, 07:52:38 PM by Advanced Bot »




off to a good start already


This is nice, I was wondering when someone would fix additem up.

The event doesn't use the item list, it's a string instead.
How is this an improvement?

I'm not quite sure what's been improved

I've made some changes to the addItem event, it's known as addNewItem in the event list.

This event can be like a search, or you can use an existing object if using eval or inside a script. addItem will still exist of other mods are using it, if you have any.

The event doesn't use the item list, it's a string instead. <- This is not an improvement, this is just an item finder

Improvements: Uses "findItemByName" that uses a cached database after the first use; should remove any console errors if any.

"You can add items to yourself like never before!"

How is this an improvement?
Basically, you can add items to players that don't have a UI name by using the object name in the string. At least I think that's what he means, and if so that's a very beneficial improvement over the previous list object.

I'm not quite sure what's been improved
You can put any item in the string, and it saves those items in a cached database instead of searching for them each time in the wrench events menu from the list. A small improvement that is generally noticeable on slower computers

I haven't tested this for myself, but I might as well now; the original addItem has a console error iirc

Basically, you can add items to players that don't have a UI name by using the object name in the string. At least I think that's what he means, and if so that's a very beneficial improvement over the previous list object.

Items without an uiname are generally not meant to be added on players with an event anyone can access. I can't think of any case where this is really useful?

Items without an uiname are generally not meant to be added on players with an event anyone can access. I can't think of any case where this is really useful?

I was gonna suggest the event be admin only, but this sorta takes away from game play if someone is hosting a freebuild with this add-on, and it's meant to be used responsibly, or without a minigame. I find this useful in cases where the host generally wants to "hide custom items" without displaying them obviously in the UI, or just to keep the UI neat and clean for freebuilders, but still giving access to them via their own events or an admins. Great for gamemodes n stuff if it works how I think it does
« Last Edit: April 07, 2015, 05:48:40 PM by Goth77 »