Items Scripting - BD Please Fix
TarotRedhand
Member Posts: 1,481
Apologies if this has already been raised.
I am calling on BD to fix item scripting so that it is less of a pita even with tag based scripting. Please give us the same scheme as with the rest of NwN. So what's the problem? For a start there are only 5 events - OnAquire, OnUnAquire, OnEquip, OnUnEquip, OnActivate - associated with items (unless you use the OnUserDefined event). These may be enough for a sword or shield but are woefully lacking when it comes to items that are containers. No OnOpen, OnClose, OnDisturb (even though the on screen works exactly the same as for everything else) and as far as I am concerned the OnAquire event is wonkey where containers are concerned. When the PC acquires an item they receive a message in the chat window saying that they've acquired it. However, if they get a container not only do they get that message but the entire contents of that container are listed as well! "You have just acquired Pandora's Box, All the woes in the world and the nuclear launch codes for every single dimension everywhere!" sort of spoils the surprise, don't you think. Add to that, the fact that the OnAquire event just fired instead of when an item has been extracted from the container to the PC's inventory. Utter nightmare.
Also, if you mark something as being cursed you can't extract it from a container. The game gives you the error message about not being allowed to drop the item.
Please fix this BD.
TR
I am calling on BD to fix item scripting so that it is less of a pita even with tag based scripting. Please give us the same scheme as with the rest of NwN. So what's the problem? For a start there are only 5 events - OnAquire, OnUnAquire, OnEquip, OnUnEquip, OnActivate - associated with items (unless you use the OnUserDefined event). These may be enough for a sword or shield but are woefully lacking when it comes to items that are containers. No OnOpen, OnClose, OnDisturb (even though the on screen works exactly the same as for everything else) and as far as I am concerned the OnAquire event is wonkey where containers are concerned. When the PC acquires an item they receive a message in the chat window saying that they've acquired it. However, if they get a container not only do they get that message but the entire contents of that container are listed as well! "You have just acquired Pandora's Box, All the woes in the world and the nuclear launch codes for every single dimension everywhere!" sort of spoils the surprise, don't you think. Add to that, the fact that the OnAquire event just fired instead of when an item has been extracted from the container to the PC's inventory. Utter nightmare.
Also, if you mark something as being cursed you can't extract it from a container. The game gives you the error message about not being allowed to drop the item.
Please fix this BD.
TR
8
Comments
Just as when you pick up a bag 'in real life', you've picked up everything IN the bag at the same time.
TR
For convenience, you could put the contents in an inaccessible chest initially.
How about this:
PC gets a bag. We'll call it Bag A for now. Bag A is empty. Bag A has a name like this: A bag. From the heft of it, there is something inside. You don't know what without opening it.
When the bag IS opened, it is destroyed and the full bag, Bag B, is spawned into the PC's inventory, and opened.
Would that work?
-JFK
I'm open to hear suggestions whether it should be merged with https://trello.com/c/hxOQa3Q3/135-provide-more-scripting-and-event-handling-functionality or left as a separate card.
@JFK would love to do that. Unfortunately there is no OnOpen event for items.
TR
Technically that works but it ignores player behaviour. Player right clicks on container and has 2 choices. Either click the double doors icon common to all types of container or try this unique power. Let's be generous and say there is a fifty-fifty chance for either.
Choice - double doors. "Huh, it's just an empty container. Oh well, I can store my gems collection in there." Player transfers several diamonds, rubies, emeralds, etc. Closes container. "Ooh, I wonder what this unique power is...", followed by prolonged bouts of swearing. All because there is no OnOpen event.
Choice - Unique power. "I wonder what this does?" followed by weird on-screen PC animation wherein they appear to be suffering from some strange form of flatulence that won't escape. "What? All it did was open the container! Something must be broken. I'll let the builder know there is a bug (editors note - only if you are lucky)."
So I repeat we need OpOpen and OnClose events for items that are containers. There should be a checkbox in the container items properties that at the very least stops the you have aquired this for the contents and at best stops the OnAquire event from firing for container item contents. The behaviour of items being moved from the container item to the PC's inventory needs fixing so that cursed items can actually be extracted to the PC's inventory. As a bonus I would include something like an OnExamined event for all items as well, but I'll not hold my breath.
TR
TR