Author Topic: Restricted containers  (Read 388 times)

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Restricted containers
« on: May 18, 2012, 09:33:56 pm »


               A Bookcase that can only hold books.

A pedastal that will only hold a single holy symbol.

I think I have seen this before in modules on the vault, but cannot recall where I saw them, and am not able to get into the toolset to play with it right now...

So I guess what I am really curious about is which functions would one use to restrict stored item types and container capacity?
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Restricted containers
« Reply #1 on: May 18, 2012, 09:51:10 pm »


               

Leurnid wrote...

So I guess what I am really curious about is which functions would one use to restrict stored item types and container capacity?



It sounds to me more like you are asking what event do you use.   It would be OnDisturbed

If you are asking how to the the same for an item container, sadly, it can not be done.  Items have no events for when items are added or removed from them.
               
               

               
            

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Restricted containers
« Reply #2 on: May 18, 2012, 10:04:29 pm »


               Right now I am just musing, until I can open up the toolset and fiddle around with things. I was hoping that perhaps a module builder active on the forums here had already worked these things out and had some advice, so my fiddling started in the right neighborhood.
               
               

               
            

Legacy_lordofworms

  • Sr. Member
  • ****
  • Posts: 422
  • Karma: +0/-0
Restricted containers
« Reply #3 on: May 18, 2012, 11:03:18 pm »


               if (GetBaseItemType(oItem) != BASE_ITEM_SPELLSCROLL)// use BASE_ITEM_XXXX for your own
               {
                DelayCommand(0.3, AssignCommand(OBJECT_SELF, ActionGiveItem(oItem, oPC)));
                FloatingTextStringOnCreature("You can only store scrolls here.",oPC,FALSE);
                return;
                }
            if (GetBaseItemType(oItem) == BASE_ITEM_SPELLSCROLL)
               {
             //do your own storing script stuff
                }
               
               

               
            

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Restricted containers
« Reply #4 on: May 18, 2012, 11:08:42 pm »


               So putting 2 and 2 together:
You can't block the item outright, but you can bounce it back out at them =D