Author Topic: Copied item not usable?  (Read 410 times)

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Copied item not usable?
« on: May 08, 2013, 02:35:08 pm »


               I hit something odd which I can't explain last night. I was wondering if anyone else had an reason for this...

I have a single use item (either unique power or activate item, no difference in this behavior). In the activation script there are cases where it's not appopriate to use the item so a copy is made for the PC since the original is going to be destroyed outside of the control of the activation script.  However, the copied item is then not usable. It returns "You cannot use that item" when I try to use it and never gets activated.

I did not think to try createitem (no variables or anything to worry about) until this morning and haven't had time to test  that, but I have to assume creating it fresh would produce a usable item.

There must be some state on the item that's not a variable (I tried the copy both with and without variables)...

Any one know what this is about?
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Copied item not usable?
« Reply #1 on: May 08, 2013, 07:32:26 pm »


               Try resting with the item in your inventory before using it again.  If this causes it to work, then the issue is with the GUI and the problem would only affect PCs.

EDIT: I have tested copying with a large variety of items (stackable and non-stackable, with and without variables) and all items were fully functional.
               
               

               


                     Modifié par WhiZard, 08 mai 2013 - 06:55 .
                     
                  


            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Copied item not usable?
« Reply #2 on: May 09, 2013, 02:53:20 am »


               

WhiZard wrote...

Try resting with the item in your inventory before using it again.  If this causes it to work, then the issue is with the GUI and the problem would only affect PCs.


Thanks WhiZard! That was a good suggestion. It does indeed work after resting.  It turns out the engine
or something before it gets to my scripts sets the usable flag on the item property to false.  Then when I copy
the item it copies everything correctly including that transient state. That must be the same thing that gets toggled
for uses-per-day properties. 

Edit: I didn't see an obvious way to set that usable bit on an item property from a script...
 

I'll just use create item or play with charges. Or just let the PC waste her bandages...


 
               
               

               


                     Modifié par meaglyn, 09 mai 2013 - 01:54 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Copied item not usable?
« Reply #3 on: May 09, 2013, 02:59:57 pm »


               I worked onthe same problem at one point.   I currently can not look at my solution due to the fact that my system crashed last night.   my solution however involved removing the iProp and adding it back on after a delay.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Copied item not usable?
« Reply #4 on: May 09, 2013, 03:21:32 pm »


               Correct, usability is accessed per item property not per item.  If you are adding and removing and the order of the properties matters, add them in reverse order of how they are gotten by the loop (or remove and add them twice in the same order).  

Order is relevant when you are trying to secure an item from destruction by placing a 0 charge per use (or infinite use per day) cast spell as the bottom cast spell property  (this would be the oldest property when dealing with cast spell properties added by script, although it is the last cast spell added when the blueprint is modified in the Toolset), so that the other cast spell properties will not trigger item deletion.
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Copied item not usable?
« Reply #5 on: May 10, 2013, 09:35:23 pm »


               Thanks guys! I found some old threads about this. One mentioned some wiki write up you did, WhiZard, which I did not find. Good stuff to know though.

I didn't want to have to add a second item prop just to keep the item from deleting. It occurred to me that for this simple throw away item (it's just bandages) I can just make it unlimited uses, put a comment in the description and delete it myself. Works nicely. (Although I may just let them get wasted anyway)

Sorry your system died LF.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Copied item not usable?
« Reply #6 on: May 17, 2013, 06:07:46 pm »


               

Lightfoot8 wrote...

I worked onthe same problem at one point.   I currently can not look at my solution due to the fact that my system crashed last night.   my solution however involved removing the iProp and adding it back on after a delay.


Hope you didn't lose any Data mate....  (That Blows!)

That's why I back up my work EVERY Day....

One Time I had a hard drive fail on me....

I have one major rule about Backup....

Any data you don't have at least 3 copies of, is data you don't mind if you lose!
               
               

               


                     Modifié par _Guile, 17 mai 2013 - 05:07 .