Author Topic: A question about item properties  (Read 650 times)

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
A question about item properties
« on: September 07, 2011, 04:58:05 am »


               Hi all,

I have a question about item properties, specifically the Cast Spell: Unique Power Self Only.
I want to make an item with 20 uses, but the toolset only goes as high as 5 uses. How can this be remedied?

Thank you in advance. '<img'>
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
A question about item properties
« Reply #1 on: September 07, 2011, 05:09:46 am »


               Are you saying you want the item to be usable 20 times or 20 times per day?

If you want it usable only 20 times give it 20 charges and and have each use use 1 charge.

If you want it 20 times per day.  hmm well I guess you could try and modify the 2da to get what you want.   Or do it the same as above and give the players the charges back in the on rest event.
               
               

               
            

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
A question about item properties
« Reply #2 on: September 07, 2011, 05:33:59 am »


               I want it usable only 20 times and then it disappears from the inventory. thank you, sweetie,  i'll give that a try. *hugs*
               
               

               
            

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
A question about item properties
« Reply #3 on: September 07, 2011, 05:58:54 am »


               Well, I'm doing something wrong....hehe.
Here's what I'm going for. I have a large cake, and each time I use it, I should get a slice from the cake, but I only want it to give 20 slices. I have the properties set for Unique Power: Self only, and  I used the script generator to write the script to give the piece of cake when used, but it never runs out.
*stumped*
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
A question about item properties
« Reply #4 on: September 07, 2011, 06:40:49 am »


               You could do something more like so:

-Add a variable to the cake blue print itself: "SLICES" | int | 20

-Give it the Unique Power Self Only "unlimited uses per day".

-Make sure the cake has a unique tag and use the following tag based script (name the script the same as the tag of the cake):


#include "x2_inc_switches"
void main()
{
    int iEvent = GetUserDefinedItemEventNumber();
    if (iEvent != X2_ITEM_EVENT_ACTIVATE) return;

    object oCake = GetItemActivated();
    object oPC = GetItemActivator();
    int iSlices = GetLocalInt(oCake, "SLICES");

    if (iSlices == 1)
    {
        CreateItemOnObject("slice res ref", oPC);
        DestroyObject(oCake);
    }

    else
    {
        CreateItemOnObject("slice res ref", oPC);
        SetLocalInt(oCake, "SLICES", iSlices - 1);
    }
}


Make sure you plug in the correct res ref of the slice you are supposed to create.

Hope that helps. Good luck.


P.S. Or I'm way overcomplicating things. haha. You should just do what Lightfoot suggests. In the Cakes properties (General Tab) give it 20 charges. Then give it the property Unique Power Self Only, 1 Charge/Use. Then your script only needs to create a slice on the activator. No variables on the cake or any of that junk. Simple.
               
               

               


                     Modifié par GhostOfGod, 07 septembre 2011 - 06:54 .
                     
                  


            

Legacy_archer4217

  • Full Member
  • ***
  • Posts: 206
  • Karma: +0/-0
A question about item properties
« Reply #5 on: September 07, 2011, 10:17:31 pm »


               Ah, that's what I was doing wrong. I wasn't setting it to 1 charge/use. Thank you so much!