Jump to content

TakePartyItem() works like Habib's scimitar


Recommended Posts

Remember that guy, Habib, who shouted about his mighty scimitar, and threw it at you? And it appeared in your weapon slots like a magicaly created weapon(like Melf's Meteors, for example), and you had to waste a Dispel Magic to get rid of it.


Well, I've just run into the same problem:


When Xan leaves the party, if he doesn't have his moonblade equipped, he takes his moonblade with him via TakePartyItem. However, later, when I take him back, it appears that he doesn't have the moonblade in his inventory, but has it as a magically created weapon in his weapon slots, instead. Cannot be removed, can only be dispelled, and the item is gone. Annoying.


(And yes, I've just noticed this. And, no, I'd prefer not to use a combination of DestroyItem() and CreateItem(), because it will mean too many possibilities).


Fixpack fixes Habib. But their code is scary, and since I am working with my own item, I rather hope to avoid this sort of thing. Maybe I can edit the item somehow, instead? It cannot be that TakePartyItem() is buggy, after all.

Link to comment

Is the problem the way you take the item, or the item itself? I remember reading about TakePartyItem(); I think items taken that way can't be stolen or destroyed. How about this instead?


IF ~HasItem("_SCRLTARN",Player1)~ THEN DO ~ActionOverride(Player1,GiveItem("_SCRLTARN","eseirik"))~ EXIT
IF ~HasItem("_SCRLTARN",Player2)~ THEN DO ~ActionOverride(Player2,GiveItem("_SCRLTARN","eseirik"))~ EXIT
IF ~HasItem("_SCRLTARN",Player3)~ THEN DO ~ActionOverride(Player3,GiveItem("_SCRLTARN","eseirik"))~ EXIT
IF ~HasItem("_SCRLTARN",Player4)~ THEN DO ~ActionOverride(Player4,GiveItem("_SCRLTARN","eseirik"))~ EXIT
IF ~HasItem("_SCRLTARN",Player5)~ THEN DO ~ActionOverride(Player5,GiveItem("_SCRLTARN","eseirik"))~ EXIT
IF ~HasItem("_SCRLTARN",Player6)~ THEN DO ~ActionOverride(Player6,GiveItem("_SCRLTARN","eseirik"))~ EXIT


This worked for Eirik, when he took the scroll from whom ever had it. Not as elegant, but it worked.


[Edit:] Rats, GiveItem() won't work either. It was devsin that told me this: TakePartyItem()

Link to comment

Yes, I know there are substitutes, but since there are four items to take, I guess that wouldn't work. For now, I've just eliminated these commands, leaving TakePartyItem only for the case where he leaves forever. After all, there's still a possibility where the player throws the blade away, or lays it on the ground, sends Xan away and picks it up.


Oh, and Re: Eirik - does he ask the permission to take the item beforehand, and receives it? Otherwise it might look as if he was either stealing the note or wrestling it from another party member, and since it is not exactly his stuff, and he is not exactly leaving forever...

Link to comment
Oh, and Re: Eirik - does he ask the permission to take the item beforehand, and receives it? Otherwise it might look as if he was either stealing the note or wrestling it from another party member, and since it is not exactly his stuff, and he is not exactly leaving forever...

The player could choose to "hand" the scroll to him. I thought it would add a nice touch if the scroll actually ended up in his inventory. Although I could have added *hands the scroll back to you* at the end of his dialog.

Link to comment

It sounds like you may have some funk somewhere. TakePartyItem() isn't really used much on PCs, so there could be additional quirks, but you're describing some serious skank (it does sound familiar for some reason though, although I still don't think it's because you're running TakePartyItem()).


Habib's scimitar is completely unrelated (he throws his dagger at you, and when the projectile impacts, the create magic weapon effect runs on the target; it's supposed to work like any other magically-created weapon spell), and the fixpack patch isn't so much fixing it as it is changing the behavior. TakePartyItem() is used a lot, and you don't ever recall seeing NPCs suddenly wielding gems and scrolls and keys and whatnot, do you? ;)

Link to comment

What do you think it might be? Because I am really curious now, and it's a simple situation: Xan exits the party, PC confirms he is out, Xan says okay, and then, if Xan doesn't have his moonblade equipped, it is a simple TakePartyItem() for his moonblade.


I know it is used in BG1 NPC with various stuff, and it should be working.


Anyway, I got rid of it for now, but if anybody finds a solution, I'd like to hear it.

Link to comment

If i understand this correctly, there are two allegiations:


1. TakePartyItem sets the cannot be stolen flag in the inventory entry.


2. If the inventory of the taker is full, TakePartyItem moves the item to the magic item slot. This may cause trouble later with rejoining npcs.


I don't know if any of these are true or false, but i understood the statements like this.

Link to comment

Originally, the moonblade only has the standard flags(2,3,5,6), but it also has a price=0 - maybe it may have influenced it?


Xan's inventory was empty, I can say this much. Also, I've experimented with this when he had two quarterstaffs equipped in his slots, and then the blade just disappeared.

Link to comment

I'm really not sure. I thought about it after I posted, and I guess I changed my mind that TakePartyItem() could be responsible, but if other mods use it, then there must be something else going on.


I want to say that TakePartyItem() isn't coded so that the item taken is ever retrievable afterward (it's possible the game doesn't even save it but only tracks it in memory for the current session), but I thought for sure that some creatures dropped the taken items when they die.


It may require more testing to figure out exactly what's going on, so unless somebody already knows, the answers may not be coming soon. :(

Link to comment

Oh, that's cool with me - as I said, I dropped it anyway, since full control is impossible here, the player can always cheat, so let them have their freedom. But, yes, it is an interesting issue.

Link to comment

Interesting, iesdp says this:


116 TakePartyItem(S:Item*)

Takes one of the specified party items. Note that this spell will transfer objects to the creature running the script. Useful for thieves. The example is from AR0516.bcs.


Ignoring the fact, this isn't a spell but a scripting action, it isn't the same as DestroyPartyItem.


I'll check this out :)

Link to comment

That's how we're suggesting it works (not that it auto-destroys items). But I seem certain that there are some cases where you can't get the item back (even where there were no DestroyItem() calls). (I pointed out the unstealable bit, so I already know that was at least true.)


As stated, I've never really played with it, especially not with PCs, so I'm not sure what could be going on here. I can't get over the feeling that she's describing something I've seen mentioned before.

Link to comment

Well, the previous test in HoW was when i used this script:




The item went from one PC to another PC and gained the unstealable flag. In case the actor had full inventory, the item appeared on ground.



Aww, i just read DevSin's note about GiveItem tainting the item with unstealable too.


Link to comment

In lieu of more thorough testing:


- GiveItem() doesn't set the item unstealable.

- TakePartyItem() sets the item unstealable.

- When assigning an item to a slot, running GiveItem() fills top-down (starting with the first empty inventory slot).

- When assigning an item to a slot, NPCs running TakePartyItem() fill bottom-up (starting with the magically-created weapon slot).

- When assigning an item to a slot, PCs running TakePartyItem() fill top-down (starting with the first empty inventory slot).

- GiveItem() between PCs runs console feedback.

- TakePartyItem() between PCs doesn't run console feedback.

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...