Aller au contenu

Photo

Plot Item Issues... [Solved]


6 réponses à ce sujet

#1
Challseus

Challseus
  • Members
  • 1 032 messages
Okay, I must be missing something...

So, I have this item, called "palace_of_justice_key.uti". When it's given to the player, I don't want them to be able to drop it/destroy it. In NWN, we would just make it plot. Okay cool, I see something like that in the attributes section of the item. So, I set it to plot, which has the following description:

"A plot item can not be destroyed or removed from the inventory once acquired".

Makes sense to me so far. Now, when I add it via a script like so, I don't get the item:

UT_AddItemToInventory(R"palace_of_justice_key.uti");

As soon as I set the plot flag to false, it shows up no problem. So, I figured I would work around the issue by immediately setting it plot via script, like so:

object oKey = UT_AddItemToInventory(R"palace_of_justice_key.uti");
SetPlot(oKey, TRUE);

I'm still able to destroy the key. I also put in some DEBUG to make sure the returned key was valid. Anyway, then I search for some sort of destroy method, and find SetDestroyable. I replace SetPlot with that (obviously setting it to FALSE), still nothing.

Am I missing something? Is there no way to stop a player from dropping important items? It's been like 7 months since I last played the OC, so I don't even remember if this happened in it or not.

Thanks for your time.

Modifié par Challseus, 06 juin 2010 - 06:31 .


#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
Plot items have a seperate tab in the inventory. Is it possible the player is getting the item, and you're just not lookin in the right place for it?



The second and third things you tried should both also have worked however. I'm not sure what's going on.

#3
TimelordDC

TimelordDC
  • Members
  • 923 messages
Edit: nm

Modifié par TimelordDC, 05 juin 2010 - 10:07 .


#4
Challseus

Challseus
  • Members
  • 1 032 messages

DavidSims wrote...

Plot items have a seperate tab in the inventory. Is it possible the player is getting the item, and you're just not lookin in the right place for it?

The second and third things you tried should both also have worked however. I'm not sure what's going on.


Posted Image

Yeah, so the plot items definitely showed up in that other tab. And to think, I actually put 80 hours into the game so many months ago...

So, it turns out, plot equipment cannot be equipped. So, what functionality should I use to make the player not be able to destroy it? Is it the aforementioned SetDestroyable()? I've tried it, and the player is still able to destroy it.

#5
Proleric

Proleric
  • Members
  • 2 356 messages
SetItemIndestructible prevents the player from destroying equipable items. I've tested it for weapons and armour.

#6
Challseus

Challseus
  • Members
  • 1 032 messages

Proleric1 wrote...

SetItemIndestructible prevents the player from destroying equipable items. I've tested it for weapons and armour.


SetPlot, SetDestroyable... Never would have thought to look up the word, Indestrcutable. Thanks, works perfecly!

EDIT - Hoping there is an item added to inventory event, so I can automatically set these items indestructible when acquired...

Modifié par Challseus, 06 juin 2010 - 03:03 .


#7
Challseus

Challseus
  • Members
  • 1 032 messages
I found multiple ways to detect if an item was added to the inventory, so I'm good with everything. I can either use EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED and catch that in my module core script, or I could use EVENT_TYPE_INVENTORY_ADDED and catch it in my rules core script.

Modifié par Challseus, 06 juin 2010 - 06:33 .