Skip to content

Items Scripting - BD Please Fix

TarotRedhandTarotRedhand Member Posts: 1,481
edited April 2018 in Builders - Scripting
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

Comments

  • MermutMermut Member Posts: 44
    The container, and all the items inside, ARE acquired at the same time. The items in the container are already in the character's inventory.
    Just as when you pick up a bag 'in real life', you've picked up everything IN the bag at the same time.
  • TarotRedhandTarotRedhand Member Posts: 1,481
    @Mermut However in real life you do not necessarily know what is in your bag when you pick it up. NwN tells you all that is in there and in yellow text. The contents have not been extracted at this point so how do you emulate them being touched? If I pick up a bag in real life and it contains a bomb it will probably explode. However if I pick up a bag with a venomous creature in it I'll be fine as long as I keep my hands out of the bag. To solve this little thing container items need a checkbox in their properties that says something like "hide contents until opened" so that backwards compatibility is maintained.

    TR
  • ProlericProleric Member Posts: 1,316
    As a workaround, how about a unique power item that just looks like a container? When used, you could turn it into an actual container plus contents. (Not sure if this was already mentioned elsewhere).

    For convenience, you could put the contents in an inaccessible chest initially.
  • JFKJFK Member Posts: 214
    That's what I suggested on the Vault. But I can see how what TR is suggesting would be pretty slick to have.

    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
  • JuliusBorisovJuliusBorisov Member, Administrator, Moderator, Developer Posts: 22,754
    For now, this is filed as a separate card - https://trello.com/c/4HZH9oPw/185-improve-item-scripting

    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.
  • TarotRedhandTarotRedhand Member Posts: 1,481
    @JuliusBorisov Thank you. For now I think it needs to be separate as it deals specifically with items but I'm open to suggestions.

    @JFK would love to do that. Unfortunately there is no OnOpen event for items.

    TR
  • meaglynmeaglyn Member Posts: 151
    You don't need an on open event to do what @JFK suggested. Just use a unique power and do the work on activation.
  • TarotRedhandTarotRedhand Member Posts: 1,481
    Sorry for the delay getting back to you. I've had a really heavy cold (includes being deaf for a day).
    @meaglyn You don't need an on open event to do what @JFK suggested. Just use a unique power and do the work on activation.

    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
  • meaglynmeaglyn Member Posts: 151
    Well... I wouldn't use a container item for the first one. Just use the appearance. Then player has one choice still. It's really not that complicated...
  • TarotRedhandTarotRedhand Member Posts: 1,481
    But it is still a work around that shouldn't be necessary. Which is why I am asking for a fix.

    TR
Sign In or Register to comment.