This is so frustrating for something that should be so simple..hehe.
Ok. The Item the player has in their inventory is named and tagged Blanket and it's property is Cast Spell: Unique Power Self Only (Single Use). This is the script that places it on the ground. It works fine.
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.c...=4683&id=625テつ テつ テつ */
void main()
{
object oPC;
oPC = GetItemActivatedTarget();
ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 2.5);
object oItem;
oItem = GetItemPossessedBy(oPC, "Blanket");
if (GetIsObjectValid(oItem))
DestroyObject(oItem);
object oTarget;
object oSpawn;
location lTarget;
oPC = GetItemActivator();
oTarget = oPC;
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "blanket2", lTarget);
}
The placeable that gets put on the ground is tagged Blanket2, resref is blanket2. It has a script in the onused slot that opens a conversation asking if the player wants to pick up the blanket. If they choose yes, then this is the script that is supposed to destroy the placeable on the ground, and put the item in their inventory.
/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.3
For download info, please visit:
http://nwvault.ign.c...=4683&id=625テつ テつ テつ */
//Put this on action taken in the conversation editor
void main()
{
object oPC = GetPCSpeaker();
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0f, 1.0f));
object oTarget;
oTarget = GetObjectByTag("Blanket2");
DestroyObject(oTarget, 0.0);
AssignCommand(oPC, ActionWait(1.0f));
CreateItemOnObject("blanket", oPC);
}
I think what's happening is it 'is' picking up the blanket but then it's immediately placing another one on the ground again. I tried the other script suggestions but they aren't helping. Why would it immediately place another blanket on the ground without the player opting to use the item?
I know it's a silly little insignificant script, but it's gnawing at me now.